Преглед изворни кода

Login (Enhanced & Minimized Themes): Login box should now stretch to fit its content. Added login_shadow_color Default Setting.

Default Settings: When using Enabled toggle link, scrolls to previous position in setting list.
Nate Jones пре 10 година
родитељ
комит
1d940d03c6

+ 1 - 0
core/default_settings/default_setting_edit.php

@@ -415,6 +415,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
 	}
 	elseif (
 		$category == "theme" && $subcategory == "background_color" && $name == "array" ||
+		$category == "theme" && $subcategory == "login_shadow_color" && $name == "text" ||
 		$category == "theme" && $subcategory == "login_background_color" && $name == "text" ||
 		$category == "theme" && $subcategory == "domain_color" && $name == "text" ||
 		$category == "theme" && $subcategory == "domain_background_color" && $name == "text" ||

+ 3 - 2
core/default_settings/default_settings.php

@@ -46,6 +46,7 @@ if (sizeof($_REQUEST) > 0) {
 	$action = check_str($_REQUEST["action"]);
 	$default_setting_uuids = $_REQUEST["id"];
 	$enabled = check_str($_REQUEST['enabled']);
+	$category = check_str($_REQUEST['category']);
 
 	if (sizeof($default_setting_uuids) == 1 && $enabled != '') {
 		$sql = "update v_default_settings set ";
@@ -55,7 +56,7 @@ if (sizeof($_REQUEST) > 0) {
 		unset($sql);
 
 		$_SESSION["message"] = $text['message-update'];
-		header("Location: default_settings.php");
+		header("Location: default_settings.php#".$category);
 		exit;
 	}
 
@@ -428,7 +429,7 @@ if (permission_exists("domain_select") && permission_exists("domain_setting_add"
 			echo "		 \n";
 			echo "	</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]." tr_link_void' style='text-align: center;'>\n";
-			echo "		<a href='?id[]=".$row['default_setting_uuid']."&enabled=".(($row['default_setting_enabled'] == 'true') ? 'false' : 'true')."'>".ucwords($row['default_setting_enabled'])."</a>\n";
+			echo "		<a href='?id[]=".$row['default_setting_uuid']."&enabled=".(($row['default_setting_enabled'] == 'true') ? 'false' : 'true')."&category=".$category."'>".ucwords($row['default_setting_enabled'])."</a>\n";
 			echo "	</td>\n";
 			echo "	<td valign='top' class='row_stylebg'>".$row['default_setting_description']."&nbsp;</td>\n";
 			echo "	<td class='list_control_icons'>";

+ 9 - 2
themes/enhanced/app_defaults.php

@@ -36,11 +36,18 @@ if ($domains_processed == 1) {
 		$array[$x]['default_setting_description'] = 'Set the opacity of the login box (decimal).';
 		$x++;
 		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'login_shadow_color';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '#888888';
+		$array[$x]['default_setting_enabled'] = 'true';
+		$array[$x]['default_setting_description'] = 'Set the shadow color (HTML compatible) of the login box.';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
 		$array[$x]['default_setting_subcategory'] = 'login_background_color';
 		$array[$x]['default_setting_name'] = 'text';
 		$array[$x]['default_setting_value'] = '#ffffff';
 		$array[$x]['default_setting_enabled'] = 'true';
-		$array[$x]['default_setting_description'] = 'Set the background color (HTML compatible) for the login box.';
+		$array[$x]['default_setting_description'] = 'Set the background color (hexadecimal) for the login box.';
 		$x++;
 		$array[$x]['default_setting_category'] = 'theme';
 		$array[$x]['default_setting_subcategory'] = 'domain_visible';
@@ -61,7 +68,7 @@ if ($domains_processed == 1) {
 		$array[$x]['default_setting_name'] = 'text';
 		$array[$x]['default_setting_value'] = '#000000';
 		$array[$x]['default_setting_enabled'] = 'false';
-		$array[$x]['default_setting_description'] = 'Set the background color (hexidecimal) for the domain name.';
+		$array[$x]['default_setting_description'] = 'Set the background color (hexadecimal) for the domain name.';
 		$x++;
 		$array[$x]['default_setting_category'] = 'theme';
 		$array[$x]['default_setting_subcategory'] = 'domain_background_opacity';

+ 14 - 48
themes/enhanced/template.php

@@ -97,38 +97,24 @@ if (
 	?>
 <?php } ?>
 
-DIV#default_login {
-	z-index: 1000;
-	position: absolute;
-	top: 0;
-	left: 0;
-	right: 0;
-	bottom: 0;
-	width: 100%;
-	height: 100%;
-}
-
-#default_login_container {
-	display: block;
-	width: 300px;
-	height: <?php echo ($_SESSION['login']['domain_name.visible']['boolean']) ? '300px' : '267px'; ?>;
+#default_login {
+	display: inline-block;
+	padding: 30px;
+	margin-bottom: 28px;
 	<?php
 	if (
 		isset($_SESSION['theme']['background_image']) ||
 		$_SESSION['theme']['background_color'][0] != '' ||
 		$_SESSION['theme']['background_color'][1] != ''
 		) { ?>
-		background-color: <?php echo $_SESSION['theme']['login_background_color']['text']; ?>;
-		opacity: <?php echo $_SESSION['theme']['login_opacity']['text']; ?>;
-		filter: alpha(opacity=<?php echo (100 * (float) $_SESSION['theme']['login_opacity']['text']); ?>);
-		-moz-opacity: <?php echo $_SESSION['theme']['login_opacity']['text']; ?>;
-		-khtml-opacity: <?php echo $_SESSION['theme']['login_opacity']['text']; ?>;
+		background-color: <?php echo ($_SESSION['theme']['login_background_color']['text'] != '') ? $_SESSION['theme']['login_background_color']['text'] : "#fff"; ?>;
+		background: rgba(<?php echo ($_SESSION['theme']['login_background_color']['text'] != '') ? hex2rgb($_SESSION['theme']['login_background_color']['text'], ',') : "255, 255, 255"; ?>, <?php echo ($_SESSION['theme']['login_opacity']['text'] != '') ? $_SESSION['theme']['login_opacity']['text'] : "1"; ?>);
 		-webkit-border-radius: 4px;
 		-moz-border-radius: 4px;
 		border-radius: 4px;
-		-webkit-box-shadow: 0 1px 20px #888;
-		-moz-box-shadow: 0 1px 20px #888;
-		box-shadow: 0 1px 20px #888;
+		-webkit-box-shadow: 0 1px 20px <?php echo ($_SESSION['theme']['login_shadow_color']['text'] != '') ? $_SESSION['theme']['login_shadow_color']['text'] : "#888"; ?>;
+		-moz-box-shadow: 0 1px 20px <?php echo ($_SESSION['theme']['login_shadow_color']['text'] != '') ? $_SESSION['theme']['login_shadow_color']['text'] : "#888"; ?>;
+		box-shadow: 0 1px 20px <?php echo ($_SESSION['theme']['login_shadow_color']['text'] != '') ? $_SESSION['theme']['login_shadow_color']['text'] : "#888"; ?>;
 		<?php
 	}
 	?>
@@ -1434,13 +1420,16 @@ if (strlen($_SESSION['message']) > 0) {
 
 		// default login being used
 		else {
+			$logo = (isset($_SESSION['theme']['logo']['text'])) ? $_SESSION['theme']['logo']['text'] : PROJECT_PATH."/themes/enhanced/images/logo.png";
 			?>
 			<div id="main_content" class='main_content' style='position: absolute; top: 0; left: 0; right: 0; bottom: 0; padding: 0;'>
 				<table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'>
 					<tr>
 						<td align='center' valign='middle'>
-							<span id='default_login_container'></span>
-							<br /><br /><br />
+							<span id='default_login'>
+								<a href='<?php echo PROJECT_PATH; ?>/'><img src='<?php echo $logo; ?>' width='250'></a><br />
+								<!--{body}-->
+							</span>
 						</td>
 					</tr>
 				</table>
@@ -1451,29 +1440,6 @@ if (strlen($_SESSION['message']) > 0) {
 	</div>
 
 	<?php
-	if (isset($_SESSION['theme']['logo']['text'])){
-		$logo = $_SESSION['theme']['logo']['text'];
-	}
-	else {
-		$logo = PROJECT_PATH."/themes/enhanced/images/logo.png";
-	}
-
-	if ($default_login) {
-		?>
-		<div id="default_login">
-			<table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'>
-				<tr>
-					<td align='center' valign='middle'>
-						<a href='<?php echo PROJECT_PATH; ?>/'><img src='<?php echo $logo; ?>' width='250'></a>
-						<br />
-						<!--{body}-->
-						<br /><br /><br />
-					</td>
-				</tr>
-			</table>
-		</div>
-		<?php
-	}
 	$footer .= "&copy; Copyright 2008 - ".date("Y")." <a href='http://www.fusionpbx.com' class='footer' target='_blank'>fusionpbx.com</a>. All rights reserved.\n";
 	echo "<div id='footer' style='position: absolute; z-index; 10000;'><span class='footer'>".$footer."</span></div>\n";
 	?>

+ 15 - 49
themes/minimized/template.php

@@ -97,38 +97,24 @@ if (
 	?>
 <?php } ?>
 
-DIV#default_login {
-	z-index: 1000;
-	position: absolute;
-	top: 0;
-	left: 0;
-	right: 0;
-	bottom: 0;
-	width: 100%;
-	height: 100%;
-}
-
-#default_login_container {
-	display: block;
-	width: 300px;
-	height: <?php echo ($_SESSION['login']['domain_name.visible']['boolean']) ? '300px' : '267px'; ?>;
+#default_login {
+	display: inline-block;
+	padding: 30px;
+	margin-bottom: 28px;
 	<?php
 	if (
 		isset($_SESSION['theme']['background_image']) ||
 		$_SESSION['theme']['background_color'][0] != '' ||
 		$_SESSION['theme']['background_color'][1] != ''
 		) { ?>
-		background-color: <?php echo $_SESSION['theme']['login_background_color']['text']; ?>;
-		opacity: <?php echo $_SESSION['theme']['login_opacity']['text']; ?>;
-		filter: alpha(opacity=<?php echo (100 * (float) $_SESSION['theme']['login_opacity']['text']); ?>);
-		-moz-opacity: <?php echo $_SESSION['theme']['login_opacity']['text']; ?>;
-		-khtml-opacity: <?php echo $_SESSION['theme']['login_opacity']['text']; ?>;
+		background-color: <?php echo ($_SESSION['theme']['login_background_color']['text'] != '') ? $_SESSION['theme']['login_background_color']['text'] : "#fff"; ?>;
+		background: rgba(<?php echo ($_SESSION['theme']['login_background_color']['text'] != '') ? hex2rgb($_SESSION['theme']['login_background_color']['text'], ',') : "255, 255, 255"; ?>, <?php echo ($_SESSION['theme']['login_opacity']['text'] != '') ? $_SESSION['theme']['login_opacity']['text'] : "1"; ?>);
 		-webkit-border-radius: 4px;
 		-moz-border-radius: 4px;
 		border-radius: 4px;
-		-webkit-box-shadow: 0 1px 20px #888;
-		-moz-box-shadow: 0 1px 20px #888;
-		box-shadow: 0 1px 20px #888;
+		-webkit-box-shadow: 0 1px 20px <?php echo ($_SESSION['theme']['login_shadow_color']['text'] != '') ? $_SESSION['theme']['login_shadow_color']['text'] : "#888"; ?>;
+		-moz-box-shadow: 0 1px 20px <?php echo ($_SESSION['theme']['login_shadow_color']['text'] != '') ? $_SESSION['theme']['login_shadow_color']['text'] : "#888"; ?>;
+		box-shadow: 0 1px 20px <?php echo ($_SESSION['theme']['login_shadow_color']['text'] != '') ? $_SESSION['theme']['login_shadow_color']['text'] : "#888"; ?>;
 		<?php
 	}
 	?>
@@ -1441,13 +1427,16 @@ legend {
 
 		// default login being used
 		else {
+			$logo = (isset($_SESSION['theme']['logo']['text'])) ? $_SESSION['theme']['logo']['text'] : PROJECT_PATH."/themes/enhanced/images/logo.png";
 			?>
-			<div id="main_content" style='position: absolute; top: 0; left: 0; right: 0; bottom: 0; padding: 0;'>
+			<div id="main_content" class='main_content' style='position: absolute; top: 0; left: 0; right: 0; bottom: 0; padding: 0;'>
 				<table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'>
 					<tr>
 						<td align='center' valign='middle'>
-							<span id='default_login_container'></span>
-							<br /><br /><br />
+							<span id='default_login'>
+								<a href='<?php echo PROJECT_PATH; ?>/'><img src='<?php echo $logo; ?>' width='250'></a><br />
+								<!--{body}-->
+							</span>
 						</td>
 					</tr>
 				</table>
@@ -1458,29 +1447,6 @@ legend {
 	</div>
 
 	<?php
-	if (isset($_SESSION['theme']['logo']['text'])){
-		$logo = $_SESSION['theme']['logo']['text'];
-	}
-	else {
-		$logo = PROJECT_PATH."/themes/minimized/images/logo.png";
-	}
-
-	if ($default_login) {
-		?>
-		<div id="default_login">
-			<table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'>
-				<tr>
-					<td align='center' valign='middle'>
-						<a href='<?php echo PROJECT_PATH; ?>/'><img src='<?php echo $logo; ?>' width='250'></a>
-						<br />
-						<!--{body}-->
-						<br /><br /><br />
-					</td>
-				</tr>
-			</table>
-		</div>
-		<?php
-	}
 	$footer .= "&copy; Copyright 2008 - ".date("Y")." <a href='http://www.fusionpbx.com' class='footer' target='_blank'>fusionpbx.com</a>. All rights reserved.\n";
 	echo "<div id='footer' style='position: absolute; z-index; 10000;'><span class='footer'>".$footer."</span></div>\n";
 	?>