Procházet zdrojové kódy

Settings improvements

Cerothen před 9 roky
rodič
revize
c5d5114dd4
11 změnil soubory, kde provedl 322 přidání a 258 odebrání
  1. 12 11
      ajax.php
  2. 3 0
      config/configDefaults.php
  3. 22 0
      functions.php
  4. 2 1
      lang/de.ini
  5. 2 1
      lang/en.ini
  6. 2 1
      lang/es.ini
  7. 2 1
      lang/fr.ini
  8. 2 1
      lang/it.ini
  9. 2 1
      lang/nl.ini
  10. 2 1
      lang/pl.ini
  11. 271 240
      settings.php

+ 12 - 11
ajax.php

@@ -84,12 +84,19 @@ switch ($_SERVER['REQUEST_METHOD']) {
 			case 'update-config':
 				sendNotification(updateConfig($_POST));
 				break;
-			case 'editCSS':
-				write_ini_file($_POST["css-show"], "custom.css");
-				$response['parent']['reload'] = true;
-				break;
 			case 'update-appearance':
-				sendNotification(updateDBOptions($_POST));
+				// Custom CSS Special Case START
+				if (isset($_POST['customCSS'])) {
+					if ($_POST['customCSS']) {
+						write_ini_file($_POST['customCSS'], 'custom.css');
+					} else {
+						unlink('custom.css');
+					}
+					$response['parent']['reload'] = true;
+				}
+				unset($_POST['customCSS']);
+				// Custom CSS Special Case END
+				$response['notify'] = sendNotification(updateDBOptions($_POST),false,false);
 				break;
 			case 'deleteDB':
 				deleteDatabase();
@@ -103,12 +110,6 @@ switch ($_SERVER['REQUEST_METHOD']) {
 			case 'deleteLog':
 				sendNotification(unlink(FAIL_LOG));
 				break;
-			case 'nav-test-tab':
-				$response['tab']['goto'] = 'homepage.php';
-				break;
-			case 'nav-test-tab':
-				$response['parent']['goto'] = 'homepage.php';
-				break;
 			default:
 				sendNotification(false, 'Unsupported Action!');
 		}

+ 3 - 0
config/configDefaults.php

@@ -67,4 +67,7 @@ return array(
 	"gravatar" => "true",
 	"calTimeFormat" => "h(:mm)t",
 	"homePageAuthNeeded" => false,
+	"homepageCustomHTML1" => "",
+	"homepageCustomHTML1Auth" => false,
+	
 );

+ 22 - 0
functions.php

@@ -1314,6 +1314,28 @@ function buildField($params, $sizeSm = 12, $sizeMd = 12, $sizeLg = 12) {
 			$bDropdown = (isset($params['buttonDrop'])?$params['buttonDrop']:'');
 			$field = ($bDropdown?'<div class="btn-group">':'').'<button id="'.$id.'" type="button" class="btn waves btn-labeled btn-'.$bType.' btn-sm text-uppercase waves-effect waves-float'.$class.''.($bDropdown?' dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"':'"').' '.implode(' ',$tags).'><span class="btn-label"><i class="fa fa-'.$icon.'"></i></span>'.$label.'</button>'.($bDropdown?$bDropdown.'</div>':'');
 			break;
+		case 'textarea':
+			$rows = (isset($params['rows'])?$params['rows']:5);
+			$field = '<textarea id="'.$id.'" name="'.$name.'" class="form-control'.$class.'" rows="'.$rows.'" '.implode(' ',$tags).'>'.$val.'</textarea>';
+			break;
+		case 'custom':
+			// Settings
+			$settings = array(
+				'$id' => $id,
+				'$name' => $name,
+				'$val' => $val,
+				'$label' => $label,
+				'$labelOut' => $labelOut,
+			);
+			// Get HTML
+			$html = (isset($params['html'])?$params['html']:'Nothing Specified!');
+			// If LabelOut is in html dont print it twice
+			$labelOut = (strpos($html,'$labelOut')!==false?'':$labelOut);
+			// Replace variables in settings
+			$html = preg_replace_callback('/\$\w+\b/', function ($match) use ($settings) { return (isset($settings[$match[0]])?$settings[$match[0]]:'{'.$match[0].' is undefined}'); }, $html);
+			// Build Field
+			$field = '<div id="'.$id.'_html" class="custom-field">'.$html.'</div>';
+			break;
 		case 'space':
 			$labelOut = '';
 			$field = str_repeat('<br>', (isset($params['value'])?$params['value']:1));

+ 2 - 1
lang/de.ini

@@ -242,4 +242,5 @@ SETTINGS_SAVED = "Settings have been Saved"
 SETTINGS_NOT_SAVED = "Settings could not be saved"
 CALTIMEFORMAT = "Select time format"
 SHOW_HOMEPAGE = "Minimum authentication level to access homepage"
-SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+CUSTOMHTML = "Custom HTML"

+ 2 - 1
lang/en.ini

@@ -242,4 +242,5 @@ SETTINGS_SAVED = "Settings have been Saved"
 SETTINGS_NOT_SAVED = "Settings could not be saved"
 CALTIMEFORMAT = "Select time format"
 SHOW_HOMEPAGE = "Minimum authentication level to access homepage"
-SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+CUSTOMHTML = "Custom HTML"

+ 2 - 1
lang/es.ini

@@ -242,4 +242,5 @@ SETTINGS_SAVED = "Settings have been Saved"
 SETTINGS_NOT_SAVED = "Settings could not be saved"
 CALTIMEFORMAT = "Select time format"
 SHOW_HOMEPAGE = "Minimum authentication level to access homepage"
-SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+CUSTOMHTML = "Custom HTML"

+ 2 - 1
lang/fr.ini

@@ -242,4 +242,5 @@ SETTINGS_SAVED = "Settings have been Saved"
 SETTINGS_NOT_SAVED = "Settings could not be saved"
 CALTIMEFORMAT = "Select time format"
 SHOW_HOMEPAGE = "Minimum authentication level to access homepage"
-SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+CUSTOMHTML = "Custom HTML"

+ 2 - 1
lang/it.ini

@@ -242,4 +242,5 @@ SETTINGS_SAVED = "Settings have been Saved"
 SETTINGS_NOT_SAVED = "Settings could not be saved"
 CALTIMEFORMAT = "Select time format"
 SHOW_HOMEPAGE = "Minimum authentication level to access homepage"
-SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+CUSTOMHTML = "Custom HTML"

+ 2 - 1
lang/nl.ini

@@ -242,4 +242,5 @@ SETTINGS_SAVED = "Settings have been Saved"
 SETTINGS_NOT_SAVED = "Settings could not be saved"
 CALTIMEFORMAT = "Select time format"
 SHOW_HOMEPAGE = "Minimum authentication level to access homepage"
-SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+CUSTOMHTML = "Custom HTML"

+ 2 - 1
lang/pl.ini

@@ -242,4 +242,5 @@ SETTINGS_SAVED = "Settings have been Saved"
 SETTINGS_NOT_SAVED = "Settings could not be saved"
 CALTIMEFORMAT = "Select time format"
 SHOW_HOMEPAGE = "Minimum authentication level to access homepage"
-SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+SHOW_ON_HOMEPAGE = "Minimum authentication level for homepage"
+CUSTOMHTML = "Custom HTML"

+ 271 - 240
settings.php

@@ -650,194 +650,195 @@ echo buildSettings(
 		'title' => 'Appearance Settings',
 		'id' => 'appearance_settings',
 		'submitAction' => 'update-appearance',
-		'onready' => '$("#editCssButton, #backToThemeButton").click(function(){ $("#appearance_settings_form").toggle(); $("#editCssForm").toggle(); });',
-		'customAfterForm' => '                                     
-<form style="display: none" id="editCssForm" method="POST" onsubmit="ajax_request(\'POST\', \'editCSS\', {\'css-show\': $(\'#css-show\').val()}); return false;">
-	<button class="btn waves btn-labeled btn-warning btn-sm pull-left text-uppercase waves-effect waves-float" type="button" id="backToThemeButton">
-
-	<span class="btn-label"><i class="fa fa-arrow-left"></i></span>'.translate("GO_BACK").'
-	</button>
-
-	<button class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
-
-	<span class="btn-label"><i class="fa fa-floppy-o"></i></span>'.translate("SAVE_CSS").'
-	</button>
-	<br><br>
-	<h1>'.translate("EDIT_CUSTOM_CSS").'</h1> 
-	<!--<p>Variables Available<code>$topbar - $topbartext - $bottombar - $sidebar - $hoverbg - $activetabBG - $activetabicon - $activetabtext - $inactiveicon - $inactivetext - $loading - $hovertext</code></p>-->
-	<textarea class="form-control" id="css-show" name="css-show" rows="25" style="background: #000; color: #FFF;">'.(file_exists('./custom.css')?file_get_contents('./custom.css'):'').'</textarea>
-</form>',
-		'fields' => array(
-			array(
-				array(
-					'type' => 'button',
-					'labelTranslate' => 'CHOOSE_THEME',
-					'icon' => 'css3',
-					'id' => 'themeSelector',
-					'buttonType' => 'dark',
-					'buttonDrop' => '
-<ul class="dropdown-menu gray-bg">
-	<li class="chooseTheme" id="plexTheme" style="border: 1px #FFFFFF; border-style: groove; background: #000000; border-radius: 5px; margin: 5px;"><a style="color: #E49F0C !important;" href="#">Plex<span><img class="themeImage" src="images/themes/plex.png"></span></a></li>
-	<li class="chooseTheme" id="newPlexTheme" style="border: 1px #E5A00D; border-style: groove; background: #282A2D; border-radius: 5px; margin: 5px;"><a style="color: #E5A00D !important;" href="#">New Plex<span><img class="themeImage" src="images/themes/newplex.png"></span></a></li>
-	<li class="chooseTheme" id="embyTheme" style="border: 1px #FFFFFF; border-style: groove; background: #212121; border-radius: 5px; margin: 5px;"><a style="color: #52B54B !important;" href="#">Emby<span><img class="themeImage" src="images/themes/emby.png"></span></a></li>
-	<li class="chooseTheme" id="bookTheme" style="border: 1px #FFFFFF; border-style: groove; background: #3B5998; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Facebook<span><img class="themeImage" src="images/themes/facebook.png"></span></a></li>
-	<li class="chooseTheme" id="spaTheme" style="border: 1px #66BBAE; border-style: groove; background: #66BBAE; border-radius: 5px; margin: 5px;"><a style="color: #5B391E !important;" href="#">Spa<span><img class="themeImage" src="images/themes/spa.png"></span></a></li>
-	<li class="chooseTheme" id="darklyTheme" style="border: 1px #464545; border-style: groove; background: #375A7F; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Darkly<span><img class="themeImage" src="images/themes/darkly.png"></span></a></li>
-	<li class="chooseTheme" id="slateTheme" style="border: 1px #58C0DE; border-style: groove; background: #272B30; border-radius: 5px; margin: 5px;"><a style="color: #C8C8C8 !important;" href="#">Slate<span><img class="themeImage" src="images/themes/slate.png"></span></a></li>
-	<li class="chooseTheme" id="monokaiTheme" style="border: 1px #AD80FD; border-style: groove; background: #333333; border-radius: 5px; margin: 5px;"><a style="color: #66D9EF !important;" href="#">Monokai<span><img class="themeImage" src="images/themes/monokai.png"></span></a></li>
-	<li class="chooseTheme" id="thejokerTheme" style="border: 1px #CCC6CC; border-style: groove; background: #000000; border-radius: 5px; margin: 5px;"><a style="color: #CCCCCC !important;" href="#">The Joker<span><img class="themeImage" src="images/themes/joker.png"></span></a></li>
-	<li class="chooseTheme" id="redTheme" style="border: 1px #eb6363; border-style: groove; background: #eb6363; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Original Red<span><img class="themeImage" src="images/themes/original.png"></span></a></li>
-</ul>
-					',
-				),
-				array(
-					'type' => 'button',
-					'labelTranslate' => 'EDIT_CUSTOM_CSS',
-					'icon' => 'css3',
-					'buttonType' => 'primary',
-					'id' => 'editCssButton',
-				),
-			),
-			array(
-				'type' => 'header',
-				'labelTranslate' => 'TITLE',
-			),
-			array(
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'labelTranslate' => 'TITLE',
-					'name' => 'title',
-					'id' => 'title',
-					'value' => $title,
-				),
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'class' => 'jscolor {hash:true}',
-					'labelTranslate' => 'TITLE_TEXT',
-					'name' => 'topbartext',
-					'id' => 'topbartext',
-					'value' => $topbartext,
-				),
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'class' => 'jscolor {hash:true}',
-					'labelTranslate' => 'LOADING_COLOR',
-					'name' => 'loading',
-					'id' => 'loading',
-					'value' => $loading,
-				),
-			),
-			array(
-				'type' => 'header',
-				'labelTranslate' => 'NAVIGATION_BARS',
-			),
-			array(
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'class' => 'jscolor {hash:true}',
-					'labelTranslate' => 'TOP_BAR',
-					'name' => 'topbar',
-					'id' => 'topbar',
-					'value' => $topbar,
-				),
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'class' => 'jscolor {hash:true}',
-					'labelTranslate' => 'BOTTOM_BAR',
-					'name' => 'bottombar',
-					'id' => 'bottombar',
-					'value' => $bottombar,
-				),
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'class' => 'jscolor {hash:true}',
-					'labelTranslate' => 'SIDE_BAR',
-					'name' => 'sidebar',
-					'id' => 'sidebar',
-					'value' => $sidebar,
-				),
-			),
-			array(
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'class' => 'jscolor {hash:true}',
-					'labelTranslate' => 'HOVER_BG',
-					'name' => 'hoverbg',
-					'id' => 'hoverbg',
-					'value' => $hoverbg,
-				),
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'class' => 'jscolor {hash:true}',
-					'labelTranslate' => 'HOVER_TEXT',
-					'name' => 'hovertext',
-					'id' => 'hovertext',
-					'value' => $hovertext,
-				),
-			),
-			array(
-				'type' => 'header',
-				'labelTranslate' => 'ACTIVE_TAB',
-			),
+		'tabs' => array(
 			array(
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'class' => 'jscolor {hash:true}',
-					'labelTranslate' => 'ACTIVE_TAB_BG',
-					'name' => 'activetabBG',
-					'id' => 'activetabBG',
-					'value' => $activetabBG,
-				),
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'class' => 'jscolor {hash:true}',
-					'labelTranslate' => 'ACTIVE_TAB_ICON',
-					'name' => 'activetabicon',
-					'id' => 'activetabicon',
-					'value' => $activetabicon,
-				),
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'class' => 'jscolor {hash:true}',
-					'labelTranslate' => 'ACTIVE_TAB_TEXT',
-					'name' => 'activetabtext',
-					'id' => 'activetabtext',
-					'value' => $activetabtext,
+				'title' => 'Colours',
+				'id' => 'theme_colours',
+				'image' => 'images/paint.png',
+				'fields' => array(
+					array(
+						array(
+							'type' => 'button',
+							'labelTranslate' => 'CHOOSE_THEME',
+							'icon' => 'css3',
+							'id' => 'themeSelector',
+							'buttonType' => 'dark',
+							'buttonDrop' => '
+		<ul class="dropdown-menu gray-bg">
+			<li class="chooseTheme" id="plexTheme" style="border: 1px #FFFFFF; border-style: groove; background: #000000; border-radius: 5px; margin: 5px;"><a style="color: #E49F0C !important;" href="#">Plex<span><img class="themeImage" src="images/themes/plex.png"></span></a></li>
+			<li class="chooseTheme" id="newPlexTheme" style="border: 1px #E5A00D; border-style: groove; background: #282A2D; border-radius: 5px; margin: 5px;"><a style="color: #E5A00D !important;" href="#">New Plex<span><img class="themeImage" src="images/themes/newplex.png"></span></a></li>
+			<li class="chooseTheme" id="embyTheme" style="border: 1px #FFFFFF; border-style: groove; background: #212121; border-radius: 5px; margin: 5px;"><a style="color: #52B54B !important;" href="#">Emby<span><img class="themeImage" src="images/themes/emby.png"></span></a></li>
+			<li class="chooseTheme" id="bookTheme" style="border: 1px #FFFFFF; border-style: groove; background: #3B5998; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Facebook<span><img class="themeImage" src="images/themes/facebook.png"></span></a></li>
+			<li class="chooseTheme" id="spaTheme" style="border: 1px #66BBAE; border-style: groove; background: #66BBAE; border-radius: 5px; margin: 5px;"><a style="color: #5B391E !important;" href="#">Spa<span><img class="themeImage" src="images/themes/spa.png"></span></a></li>
+			<li class="chooseTheme" id="darklyTheme" style="border: 1px #464545; border-style: groove; background: #375A7F; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Darkly<span><img class="themeImage" src="images/themes/darkly.png"></span></a></li>
+			<li class="chooseTheme" id="slateTheme" style="border: 1px #58C0DE; border-style: groove; background: #272B30; border-radius: 5px; margin: 5px;"><a style="color: #C8C8C8 !important;" href="#">Slate<span><img class="themeImage" src="images/themes/slate.png"></span></a></li>
+			<li class="chooseTheme" id="monokaiTheme" style="border: 1px #AD80FD; border-style: groove; background: #333333; border-radius: 5px; margin: 5px;"><a style="color: #66D9EF !important;" href="#">Monokai<span><img class="themeImage" src="images/themes/monokai.png"></span></a></li>
+			<li class="chooseTheme" id="thejokerTheme" style="border: 1px #CCC6CC; border-style: groove; background: #000000; border-radius: 5px; margin: 5px;"><a style="color: #CCCCCC !important;" href="#">The Joker<span><img class="themeImage" src="images/themes/joker.png"></span></a></li>
+			<li class="chooseTheme" id="redTheme" style="border: 1px #eb6363; border-style: groove; background: #eb6363; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Original Red<span><img class="themeImage" src="images/themes/original.png"></span></a></li>
+		</ul>
+							',
+						),
+					),
+					array(
+						'type' => 'header',
+						'labelTranslate' => 'TITLE',
+					),
+					array(
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'labelTranslate' => 'TITLE',
+							'name' => 'title',
+							'id' => 'title',
+							'value' => $title,
+						),
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'class' => 'jscolor {hash:true}',
+							'labelTranslate' => 'TITLE_TEXT',
+							'name' => 'topbartext',
+							'id' => 'topbartext',
+							'value' => $topbartext,
+						),
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'class' => 'jscolor {hash:true}',
+							'labelTranslate' => 'LOADING_COLOR',
+							'name' => 'loading',
+							'id' => 'loading',
+							'value' => $loading,
+						),
+					),
+					array(
+						'type' => 'header',
+						'labelTranslate' => 'NAVIGATION_BARS',
+					),
+					array(
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'class' => 'jscolor {hash:true}',
+							'labelTranslate' => 'TOP_BAR',
+							'name' => 'topbar',
+							'id' => 'topbar',
+							'value' => $topbar,
+						),
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'class' => 'jscolor {hash:true}',
+							'labelTranslate' => 'BOTTOM_BAR',
+							'name' => 'bottombar',
+							'id' => 'bottombar',
+							'value' => $bottombar,
+						),
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'class' => 'jscolor {hash:true}',
+							'labelTranslate' => 'SIDE_BAR',
+							'name' => 'sidebar',
+							'id' => 'sidebar',
+							'value' => $sidebar,
+						),
+					),
+					array(
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'class' => 'jscolor {hash:true}',
+							'labelTranslate' => 'HOVER_BG',
+							'name' => 'hoverbg',
+							'id' => 'hoverbg',
+							'value' => $hoverbg,
+						),
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'class' => 'jscolor {hash:true}',
+							'labelTranslate' => 'HOVER_TEXT',
+							'name' => 'hovertext',
+							'id' => 'hovertext',
+							'value' => $hovertext,
+						),
+					),
+					array(
+						'type' => 'header',
+						'labelTranslate' => 'ACTIVE_TAB',
+					),
+					array(
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'class' => 'jscolor {hash:true}',
+							'labelTranslate' => 'ACTIVE_TAB_BG',
+							'name' => 'activetabBG',
+							'id' => 'activetabBG',
+							'value' => $activetabBG,
+						),
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'class' => 'jscolor {hash:true}',
+							'labelTranslate' => 'ACTIVE_TAB_ICON',
+							'name' => 'activetabicon',
+							'id' => 'activetabicon',
+							'value' => $activetabicon,
+						),
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'class' => 'jscolor {hash:true}',
+							'labelTranslate' => 'ACTIVE_TAB_TEXT',
+							'name' => 'activetabtext',
+							'id' => 'activetabtext',
+							'value' => $activetabtext,
+						),
+					),
+					array(
+						'type' => 'header',
+						'labelTranslate' => 'INACTIVE_TAB',
+					),
+					array(
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'class' => 'jscolor {hash:true}',
+							'labelTranslate' => 'INACTIVE_ICON',
+							'name' => 'inactiveicon',
+							'id' => 'inactiveicon',
+							'value' => $inactiveicon,
+						),
+						array(
+							'type' => 'text',
+							'format' => 'colour',
+							'class' => 'jscolor {hash:true}',
+							'labelTranslate' => 'INACTIVE_TEXT',
+							'name' => 'inactivetext',
+							'id' => 'inactivetext',
+							'value' => $inactivetext,
+						),
+					),
 				),
 			),
 			array(
-				'type' => 'header',
-				'labelTranslate' => 'INACTIVE_TAB',
-			),
-			array(
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'class' => 'jscolor {hash:true}',
-					'labelTranslate' => 'INACTIVE_ICON',
-					'name' => 'inactiveicon',
-					'id' => 'inactiveicon',
-					'value' => $inactiveicon,
-				),
-				array(
-					'type' => 'text',
-					'format' => 'colour',
-					'class' => 'jscolor {hash:true}',
-					'labelTranslate' => 'INACTIVE_TEXT',
-					'name' => 'inactivetext',
-					'id' => 'inactivetext',
-					'value' => $inactivetext,
+				'title' => 'Custom CSS',
+				'id' => 'theme_css',
+				'image' => 'images/gear.png',
+				'fields' => array(
+					array(
+						'type' => 'header',
+						'label' => 'Custom CSS',
+					),
+					array(
+						'type' => 'textarea',
+						'name' => 'customCSS',
+						'value' => (file_exists('./custom.css')?file_get_contents('./custom.css'):''),
+						'rows' => 25,
+						'style' => 'background: #000; color: #FFF;',
+					),
 				),
 			),
 		),
@@ -863,6 +864,7 @@ echo buildSettings(
 	array(
 		'title' => 'Homepage Settings',
 		'id' => 'homepage_settings',
+		'onready' => '',
 		'tabs' => array(
 			array(
 				'title' => 'General',
@@ -876,6 +878,13 @@ echo buildSettings(
 						'value' => HOMEPAGEAUTHNEEDED,
 						'options' => $userTypes,
 					),
+					array(
+						'type' => 'custom',
+						'labelTranslate' => 'SHOW_HOMEPAGE',
+						'html' => 'homePageAuthNeeded',
+						'name' => 'homePagelayout',
+						'value' => '',
+					),
 				),
 			),
 			array(
@@ -883,6 +892,13 @@ echo buildSettings(
 				'id' => 'plex',
 				'image' => 'images/plex.png',
 				'fields' => array(
+					array(
+						'type' => $userSelectType,
+						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
+						'name' => 'plexHomeAuth',
+						'value' => PLEXHOMEAUTH,
+						'options' => $userTypes,
+					),
 					array(
 						'type' => 'text',
 						'placeholder' => 'http://hostname:32400',
@@ -900,13 +916,6 @@ echo buildSettings(
 						'pattern' => '[a-zA-Z0-9]{20}',
 						'value' => PLEXTOKEN,
 					),
-					array(
-						'type' => $userSelectType,
-						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
-						'name' => 'plexHomeAuth',
-						'value' => PLEXHOMEAUTH,
-						'options' => $userTypes,
-					),
 					array(
 						array(
 							'type' => 'checkbox',
@@ -940,6 +949,13 @@ echo buildSettings(
 				'id' => 'emby',
 				'image' => 'images/emby.png',
 				'fields' => array(
+					array(
+						'type' => $userSelectType,
+						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
+						'name' => 'embyHomeAuth',
+						'value' => EMBYHOMEAUTH,
+						'options' => $userTypes,
+					),
 					array(
 						'type' => 'text',
 						'placeholder' => 'http://hostname:8096/emby',
@@ -957,13 +973,6 @@ echo buildSettings(
 						'pattern' => '[a-zA-Z0-9]{32}',
 						'value' => EMBYTOKEN,
 					),
-					array(
-						'type' => $userSelectType,
-						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
-						'name' => 'embyHomeAuth',
-						'value' => EMBYHOMEAUTH,
-						'options' => $userTypes,
-					),
 					array(
 						array(
 							'type' => 'checkbox',
@@ -997,6 +1006,13 @@ echo buildSettings(
 				'id' => 'sonarr',
 				'image' => 'images/sonarr.png',
 				'fields' => array(
+					array(
+						'type' => $userSelectType,
+						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
+						'name' => 'sonarrHomeAuth',
+						'value' => SONARRHOMEAUTH,
+						'options' => $userTypes,
+					),
 					array(
 						'type' => 'text',
 						'placeholder' => 'http://hostname:8989',
@@ -1014,13 +1030,6 @@ echo buildSettings(
 						'pattern' => '[a-zA-Z0-9]{32}',
 						'value' => SONARRKEY,
 					),
-					array(
-						'type' => $userSelectType,
-						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
-						'name' => 'sonarrHomeAuth',
-						'value' => SONARRHOMEAUTH,
-						'options' => $userTypes,
-					),
 				),
 			),
 			array(
@@ -1028,6 +1037,13 @@ echo buildSettings(
 				'id' => 'radarr',
 				'image' => 'images/radarr.png',
 				'fields' => array(
+					array(
+						'type' => $userSelectType,
+						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
+						'name' => 'radarrHomeAuth',
+						'value' => RADARRHOMEAUTH,
+						'options' => $userTypes,
+					),
 					array(
 						'type' => 'text',
 						'placeholder' => 'http://hostname:7878',
@@ -1045,13 +1061,6 @@ echo buildSettings(
 						'pattern' => '[a-zA-Z0-9]{32}',
 						'value' => RADARRKEY,
 					),
-					array(
-						'type' => $userSelectType,
-						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
-						'name' => 'radarrHomeAuth',
-						'value' => RADARRHOMEAUTH,
-						'options' => $userTypes,
-					),
 				),
 			),
 			array(
@@ -1059,6 +1068,13 @@ echo buildSettings(
 				'id' => 'sick',
 				'image' => 'images/sickrage.png',
 				'fields' => array(
+					array(
+						'type' => $userSelectType,
+						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
+						'name' => 'sickrageHomeAuth',
+						'value' => SICKRAGEHOMEAUTH,
+						'options' => $userTypes,
+					),
 					array(
 						'type' => 'text',
 						'placeholder' => 'http://hostname:8081/sick',
@@ -1075,13 +1091,6 @@ echo buildSettings(
 						'name' => 'sickrageKey',
 						'value' => SICKRAGEKEY,
 					),
-					array(
-						'type' => $userSelectType,
-						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
-						'name' => 'sickrageHomeAuth',
-						'value' => SICKRAGEHOMEAUTH,
-						'options' => $userTypes,
-					),
 				),
 			),
 			array(
@@ -1089,6 +1098,13 @@ echo buildSettings(
 				'id' => 'headphones',
 				'image' => 'images/headphones.png',
 				'fields' => array(
+					array(
+						'type' => $userSelectType,
+						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
+						'name' => 'headphonesHomeAuth',
+						'value' => HEADPHONESHOMEAUTH,
+						'options' => $userTypes,
+					),
 					array(
 						'type' => 'text',
 						'placeholder' => 'http://hostname:8181',
@@ -1105,13 +1121,6 @@ echo buildSettings(
 						'name' => 'headphonesKey',
 						'value' => HEADPHONESKEY,
 					),
-					array(
-						'type' => $userSelectType,
-						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
-						'name' => 'headphonesHomeAuth',
-						'value' => HEADPHONESHOMEAUTH,
-						'options' => $userTypes,
-					),
 				),
 			),
 			array(
@@ -1119,6 +1128,13 @@ echo buildSettings(
 				'id' => 'sabnzbd',
 				'image' => 'images/sabnzbd.png',
 				'fields' => array(
+					array(
+						'type' => $userSelectType,
+						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
+						'name' => 'sabnzbdHomeAuth',
+						'value' => SABNZBDHOMEAUTH,
+						'options' => $userTypes,
+					),
 					array(
 						'type' => 'text',
 						'placeholder' => 'http://hostname:8080/sabnzbd',
@@ -1135,13 +1151,6 @@ echo buildSettings(
 						'name' => 'sabnzbdKey',
 						'value' => SABNZBDKEY,
 					),
-					array(
-						'type' => $userSelectType,
-						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
-						'name' => 'sabnzbdHomeAuth',
-						'value' => SABNZBDHOMEAUTH,
-						'options' => $userTypes,
-					),
 				),
 			),
 			array(
@@ -1149,6 +1158,13 @@ echo buildSettings(
 				'id' => 'nzbget',
 				'image' => 'images/nzbget.png',
 				'fields' => array(
+					array(
+						'type' => $userSelectType,
+						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
+						'name' => 'nzbgetHomeAuth',
+						'value' => NZBGETHOMEAUTH,
+						'options' => $userTypes,
+					),
 					array(
 						'type' => 'text',
 						'placeholder' => 'http://hostname:6789',
@@ -1170,13 +1186,6 @@ echo buildSettings(
 						'name' => 'nzbgetPassword',
 						'value' => (empty(NZBGETPASSWORD)?'':randString(20)),
 					),
-					array(
-						'type' => $userSelectType,
-						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
-						'name' => 'nzbgetHomeAuth',
-						'value' => NZBGETHOMEAUTH,
-						'options' => $userTypes,
-					),
 				),
 			),
 			array(
@@ -1241,6 +1250,28 @@ echo buildSettings(
 					),
 				),
 			),
+			array(
+				'title' => 'Custom HTML 1',
+				'id' => 'customhtml1',
+				'image' => 'images/gear.png',
+				'fields' => array(
+					array(
+						'type' => $userSelectType,
+						'labelTranslate' => 'SHOW_ON_HOMEPAGE',
+						'name' => 'homepageCustomHTML1Auth',
+						'value' => HOMEPAGECUSTOMHTML1AUTH,
+						'options' => $userTypes,
+					),
+					array(
+						'type' => 'textarea',
+						'labelTranslate' => 'CUSTOMHTML',
+						'name' => 'homepageCustomHTML1',
+						'value' => HOMEPAGECUSTOMHTML1,
+						'rows' => 10,
+						'style' => 'background: #000; color: #FFF;',
+					),
+				),
+			),
 		),
 	)
 );