Source

SAM Song Info / application / views / facebook_settings.php

Full commit
<?php header('Content-type: text/html; charset=UTF-8'); ?>
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo facebook_xmlns()?>>
	<head>
		<title>SAM Song Info Poster - Facebook Settings</title>

		<style type="text/css">
			@CHARSET "ISO-8859-1";

			body {
				background-color: #fff;
				margin: 20px 40px;
				font-family: Lucida Grande, Verdana, Sans-serif;
				font-size: 100%;
				color: #4F5155;
			}
			
			h1 {
				color: #767676;
				font-size: 1.6em;
				font-weight: bold;
				letter-spacing: -1px;
				margin-top: 0;
			}
			
			h2 {
				color: #767676;
				background-color: transparent;
				border-bottom: 2px solid #D0D0D0;
				font-size: 1.2em;
				font-weight: bold;
				padding: 5px 0 6px 0;
				margin: 0;
			}
		
			fieldset * {
				float: left;
				margin: 0 5px;
			}
			
			fieldset p {
				white-space: pre-line;
				margin-bottom: 0.5em;
				line-height: 1.2;
				font-size: 75%;
				font-weight: lighter;
				font-style: italic;
			}

			legend {
				color: #767676;
				background-color: transparent;
				font-size: 1.2em;
				font-weight: bold;
				float: none;
			}
			
			label {
				max-width: 50%;
				font-size: 0.9em;
			}

			.orange {
				color: #F27B36;
			}
			
			.facebook-blue {
				color: #3B5998;
			}
			
			.logout,
			.logout:link,
			.logout:visited,
			.logout:active {
				text-decoration: none;
				font-weight: bold;
				float: right;
			}

			.logout:hover {
				text-decoration: underline;
			}
			
			.section {
				margin: 24px 0 2px 0;
				border-bottom: 4px solid #D0D0D0;
			}
			
			fieldset.nostyle {
				display: block;
				border:  0 none;
				margin-left: 0;
				padding-left: 0;
				width: 100%;
			}
			
			fieldset.nostyle legend {
				float: left;
				font-size: 100%;
				min-width: 10%;
			}
			
			fieldset.nostyle label {
				max-width: 90%;
			}
			
			fieldset.nostyle p {
				margin: 0;
			}
					
			.radio {
				margin-top: 2px;	
			}
			
			.collapsed > legend:after {
				content: '  [+]';
				font-weight: normal;
				font-size: 0.6em;
				letter-spacing: -2px;
				position: relative;
				bottom: 2px; 
			}
			
			.expanded > legend:after {
				content: ' [-]';
				font-weight: normal;
				font-size: 0.6em;
				letter-spacing: -2px;
				position: relative;
				bottom: 2px; 
			}
					
			.collapsed fieldset.nostyle {
				display: none;	
			}
			
			.expanded fieldset.nosytle {
				display: block;	
			}
			
        	#sortable { 
				list-style-type: none;
				margin: 0;
				padding: 0;
				width: auto;
				min-width: 10em;
			}
			       	
			#sortable li {
				margin: 0 5px 0px 5px;
				padding: 0 5px;
				border: 1px dashed black;
				cursor: move;
			}
			
        	.ui-state-highlight {
				line-height: 1.2em;
				height: 1.2em;
				width: 3em;
				background-color: #767676;
			}

			.credits
			{
				font-size: 0.5em;
				text-align: center;
			}

			a,
			a:link,
			a:visited,
			a:active {
				text-decoration: none;
				font-style: italic;
				font-family: Lucida Grande, Verdana, Sans-serif;
				font-size: 100%;
			}
			
			a:hover {
				text-decoration: underline;
			}
			
			.hiddenlink {
				color: #4F5155;
				font-variant: small-caps;
			}
			
			.expandbutton,
			.expandbutton:link,
			.expandbutton:visited,
			.expandbutton:active,
			.expandbutton:hover {
				margin: 0;
				padding: 0;
				color: #4F5155;
				font-style: normal;
				font-weight: bold;
				text-decoration: underline;
				line-height: 2;
				cursor: pointer;
			}
			
			.hidden {
				display: none;	
			}
			
			.emphasize {
				font-weight: bold;
				color: #F27B36;
			}
		</style>
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script>
		<script src="<?php echo $base?>js/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>
		<script src="<?php echo $base?>js/display.js" type="text/javascript"></script>
		<link rel="icon" href="<?php echo $base?>favicon.ico" type="image/x-icon" />
		<link rel="shortcut icon" href="<?php echo $base?>favicon.ico" type="image/x-icon" />
		
	</head>
	<body>
		<div class="intro">
    		<img src="<?php echo $base ?>images/sam_64.png" alt="SAM Broadcaster Logo" />
    		<img src="<?php echo $base ?>images/facebook_64.png" alt="Facebook Logo" />
    		<a class="logout orange" href="/logout">Logout</a>
    		<h1>SAM <span class="orange">Broadcaster</span> Song Info Poster: <span class="facebook-blue">Facebook</span> Settings</h1>
		</div>
		
		<?php if ('' !== validation_errors()):?>
		<div class="section">
			<h2>Errors</h2>
		    <?php echo validation_errors()?>
		</div>
		<?php endif;?>
		
		<?php echo form_open($this_url)?>
		    <?php echo form_fieldset('Basic', array('class' => 'collapseable expanded', 'id' => 'basic'))?> 
				<p>Basic settings needed to generate a custom PAL script for you. 
					<span class="emphasize">All fields required</span>, but you're good to go with the default values.
					<a class="expandbutton">Show/Hide Options</a></p>
		        <?php echo form_fieldset('Songtypes', array('class' => 'nostyle'))?>
                    <?php echo form_multiselect('songtypes[]', $songtypes, array('S'), 'id="songtypes"')?>
					<?php echo form_label('Select songtypes to be sent (Drag or hold ctrl when clicking to select multiple)', 'songtypes')?>
				</fieldset>
                <?php echo form_fieldset('Post Timing', array('class' => 'nostyle'))?>
                    <?php 
                        foreach ($timings as $key => $value)
                        {  
            				$timings_radio = '<input type="radio" class="radio" name="timing"  id="'.$key.'" value="'.$key.'"'.set_radio('timing', $key).' />';
            			    echo form_label($timings_radio.$value, $key);
                        }
                    ?>
                </fieldset>                    
                <?php echo form_fieldset('Interval', array('class' => 'nostyle'))?>
					<input type="text" name="timing_value" id="timing_value" value="<?php echo set_value('timing_value', $timing_value)?>" maxlength="2" />
                    <?php echo form_label('Skip all songs within the specified interval', 'timing_value')?>
                </fieldset>
			</fieldset>
			<?php echo form_fieldset('Advanced', array('class' => 'collapseable expanded', 'id' => 'advanced'))?>
				<p>Slightly more advanced settings regarding the layout of your posts on facebook.
					If you leave this section closed your previously stored settings will be used.
					Default behavior on first setup is to only post {Artist} - {Title}
					<a class="expandbutton">Show/Hide Options</a></p>
			    <?php echo form_fieldset('Page Posting', array('class' => 'nostyle'))?>
				    <select name="account" id="account">
                    <?php foreach ($accounts as $userdata):?>
                    <option value="<?php echo $userdata->access_token?>"><?php echo $userdata->name?></option>											
					<?php endforeach;?>
					</select>
					<?php echo form_label('Donors may select a Facebook-page as post-target', 'account')?>
				</fieldset>
				<?php echo form_fieldset('Action Title', array('class' => 'nostyle'))?>
					<input type="text" name="action_title" id="action_title" value="<?php echo set_value('action_title', $action_title)?>" />
					<?php echo form_label('Custom Link at bottom-right along with Like etc. (ex. Listen Now)', 'action_title')?>
				</fieldset>
				<?php echo form_fieldset('Action Link', array('class' => 'nostyle'))?>
					<input type="text" name="action_link" id="action_link" value="<?php echo set_value('action_link', $action_link)?>" />
					<?php echo form_label('URL the link will point to (ex. direct link to your stream)', 'action_link')?>
				</fieldset>
				<?php echo form_fieldset('Prefix', array('class' => 'nostyle'))?>
					<input type="text" name="prefix" id="prefix" value="<?php echo set_value('prefix', $prefix)?>" />
					<?php echo form_label('Text in front of the actual Song Info (ex. Now Playing)', 'prefix')?>
				</fieldset>
				<?php echo form_fieldset('Postfix', array('class' => 'nostyle'))?>
					<input type="text" name="postfix" id="postfix" value="<?php echo set_value('postfix', $postfix)?>" />
					<?php echo form_label('Text behind the actual Song Info (ex. presented by station)', 'postfix')?>
				</fieldset>
				<?php echo form_fieldset('Fieldorder', array('class' => 'nostyle'))?>
					<ul id="sortable">
                    	<li class="ui-state-default" id="artist">Artist</li>
                    	<li class="ui-state-default" id="title">Title</li>
                    </ul>
				    <input type="hidden" name="field_order" id="field_order" value="<?php echo set_value('field_order', 'artist|title')?>" />
				    <?php echo form_label('Order the SongInfo Fields by drag and drop (requires JavaScript)', 'field_order')?>
				</fieldset>
			</fieldset>
			<?php echo form_fieldset('Website', array('class' => 'collapseable expanded', 'id' => 'website'))?>
				<p>Attach a link to your website and include a longer description of your station.
					If you leave this section closed your previously stored settings will be used.
					Default behavior on first setup is no website attached.
				<a class="expandbutton">Show/Hide Options</a></p>
				<?php echo form_fieldset('Title', array('class' => 'nostyle'))?>
					<input type="text" name="website_title" id="website_title" value="<?php echo set_value('website_title', $website_title)?>" />
					<?php echo form_label('The name of your station', 'website_title')?>
				</fieldset>
				<?php echo form_fieldset('Link', array('class' => 'nostyle'))?>
					<input type="text" name="website_link" id="website_link" value="<?php echo set_value('website_link', $website_link)?>" />
					<?php echo form_label('URL (webaddress) of your website', 'website_link')?>
				</fieldset>
				<?php echo form_fieldset('Description', array('class' => 'nostyle'))?>
					<textarea name="website_description" id="website_description" cols="30" rows="4"><?php echo set_value('website_description', $website_description)?></textarea>
					<?php echo form_label('Describe your station in short words', 'website_description')?>
				</fieldset>
			</fieldset>
			<?php echo form_fieldset('Album Art', array('class' => 'collapseable expanded', 'id' => 'artwork'))?>
				<p>Show Album Art for the Song
					Uses the pictures from SAM if you have the PHP/HTMLweb Template set up
					If you leave this section closed your previously stored settings will be used.
					Default behavior on first setup is no pictures.
					<a class="expandbutton">Show/Hide Options</a></p>
				<?php echo form_fieldset('Picturedir', array('class' => 'nostyle'))?>
					<input type="text" name="picture_dir" id="picture_dir" value="<?php echo set_value('picture_dir', $picture_dir)?>" />
					<?php echo form_label('Webaddress to a folder containing album pictures (with trailing /)', 'picture_dir')?>
				</fieldset>
			</fieldset>
			<?php echo form_fieldset('', array('class' => 'nostyle'));?>
				<?php echo form_submit('submit', 'Save Settings').' '.form_reset('reset', 'Reset'); ?>
			</fieldset>
			<fieldset class="hidden">
				<input type="hidden" name="advancedchanged" id="advancedchanged" value="0" />
				<input type="hidden" name="websitechanged" id="websitechanged" value="0" />
				<input type="hidden" name="artworkchanged" id="artworkchanged" value="0" />
				<input type="hidden" name="basicchanged" id="basicchanged" value="0" />
			</fieldset>
		</form>