User can now have different theme per server (RFE #1231599).
This commit is contained in:
@@ -8,6 +8,10 @@ $Source$
|
|||||||
2005-07-10 Michal Čihař <michal@cihar.com>
|
2005-07-10 Michal Čihař <michal@cihar.com>
|
||||||
* libraries/auth/http.auth.lib.php: Support FastGCI in http auth (patch
|
* libraries/auth/http.auth.lib.php: Support FastGCI in http auth (patch
|
||||||
#1192219)
|
#1192219)
|
||||||
|
* Documentation.html, config.inc.php, left.php, queryframe.php,
|
||||||
|
libraries/common.lib.php, libraries/config_import.lib.php,
|
||||||
|
libraries/header_meta_style.inc.php, libraries/select_theme.lib.php:
|
||||||
|
User can now have different theme per server (RFE #1231599).
|
||||||
|
|
||||||
2005-07-10 Marc Delisle <lem9@users.sourceforge.net>
|
2005-07-10 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* libraries/display_tbl.lib.php: bug #1235473 display_tbl.lib.php,
|
* libraries/display_tbl.lib.php: bug #1235473 display_tbl.lib.php,
|
||||||
|
@@ -1839,6 +1839,12 @@ Defaults to FALSE (drop-down). <br />
|
|||||||
<br /><br />
|
<br /><br />
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
<dt><b>$cfg['ThemePerServer'] </b>boolean</dt>
|
||||||
|
<dd>
|
||||||
|
Whether to allow different theme for each server.
|
||||||
|
<br /><br />
|
||||||
|
</dd>
|
||||||
|
|
||||||
<dt><b>$cfg['DefaultQueryTable']</b> string</dt>
|
<dt><b>$cfg['DefaultQueryTable']</b> string</dt>
|
||||||
<dt><b>$cfg['DefaultQueryDatabase']</b> string</dt>
|
<dt><b>$cfg['DefaultQueryDatabase']</b> string</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
@@ -577,6 +577,7 @@ $cfg['ThemeManager'] = TRUE; // if you want to use selectable th
|
|||||||
$cfg['ThemeDefault'] = 'original'; // set up default theme, if ThemePath not empty
|
$cfg['ThemeDefault'] = 'original'; // set up default theme, if ThemePath not empty
|
||||||
// you can set up here an valid path to themes or 'original' for
|
// you can set up here an valid path to themes or 'original' for
|
||||||
// the original pma-theme
|
// the original pma-theme
|
||||||
|
$cfg['ThemePerServer'] = FALSE; // allow diferent theme for each configured server
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
4
left.php
4
left.php
@@ -289,11 +289,11 @@ if (($num_dbs > 1 || !empty($cfg['LeftFrameTableSeparator'])) && !$cfg['LeftFram
|
|||||||
|
|
||||||
var isServer = <?php echo ($server > 0) ? 'true' : 'false'; ?>;
|
var isServer = <?php echo ($server > 0) ? 'true' : 'false'; ?>;
|
||||||
|
|
||||||
document.writeln('<link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?lang=<?php echo $lang; ?>&js_frame=left&js_capable=' + capable + '&js_isDOM=' + isDOM + '&js_isIE4=' + isIE4 + '" />');
|
document.writeln('<link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?<?php echo PMA_generate_common_url(); ?>&js_frame=left&js_capable=' + capable + '&js_isDOM=' + isDOM + '&js_isIE4=' + isIE4 + '" />');
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
<noscript>
|
<noscript>
|
||||||
<link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?lang=<?php echo $lang; ?>&js_frame=left&js_capable=0&js_isDOM=0&js_isIE4=0" />
|
<link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?<?php echo PMA_generate_common_url(); ?>&js_frame=left&js_capable=0&js_isDOM=0&js_isIE4=0" />
|
||||||
</noscript>
|
</noscript>
|
||||||
|
|
||||||
<script src="libraries/left.js" type="text/javascript" language="javascript1.2"></script>
|
<script src="libraries/left.js" type="text/javascript" language="javascript1.2"></script>
|
||||||
|
@@ -142,7 +142,7 @@ if (isset($cfg['FileRevision'])) {
|
|||||||
} else {
|
} else {
|
||||||
$cfg['FileRevision'] = array(1, 1);
|
$cfg['FileRevision'] = array(1, 1);
|
||||||
}
|
}
|
||||||
if ($cfg['FileRevision'][0] < 2 || ($cfg['FileRevision'][0] == 2 && $cfg['FileRevision'][1] < 56)) {
|
if ($cfg['FileRevision'][0] < 2 || ($cfg['FileRevision'][0] == 2 && $cfg['FileRevision'][1] < 58)) {
|
||||||
require_once('./libraries/config_import.lib.php');
|
require_once('./libraries/config_import.lib.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,8 +328,14 @@ if (strtolower($cfg['OBGzip']) == 'auto') {
|
|||||||
* and if the directory $ThemePath/$theme/img/ exists
|
* and if the directory $ThemePath/$theme/img/ exists
|
||||||
* If not, it will use default images
|
* If not, it will use default images
|
||||||
*/
|
*/
|
||||||
|
// Allow different theme per server
|
||||||
|
$theme_cookie_name = 'pma_theme';
|
||||||
|
if ($GLOBALS['cfg']['ThemePerServer'] && isset($server)) {
|
||||||
|
$theme_cookie_name .= '-' . $server;
|
||||||
|
}
|
||||||
|
//echo $theme_cookie_name;
|
||||||
// Theme Manager
|
// Theme Manager
|
||||||
if (!$cfg['ThemeManager'] || !isset($_COOKIE['pma_theme']) || empty($_COOKIE['pma_theme'])){
|
if (!$cfg['ThemeManager'] || !isset($_COOKIE[$theme_cookie_name]) || empty($_COOKIE[$theme_cookie_name])){
|
||||||
$GLOBALS['theme'] = $cfg['ThemeDefault'];
|
$GLOBALS['theme'] = $cfg['ThemeDefault'];
|
||||||
$ThemeDefaultOk = FALSE;
|
$ThemeDefaultOk = FALSE;
|
||||||
if ($cfg['ThemePath']!='' && $cfg['ThemePath'] != FALSE) {
|
if ($cfg['ThemePath']!='' && $cfg['ThemePath'] != FALSE) {
|
||||||
@@ -352,7 +358,7 @@ if (!$cfg['ThemeManager'] || !isset($_COOKIE['pma_theme']) || empty($_COOKIE['pm
|
|||||||
if (isset($_POST['set_theme'])) {
|
if (isset($_POST['set_theme'])) {
|
||||||
$GLOBALS['theme'] = PMA_securePath($_POST['set_theme']);
|
$GLOBALS['theme'] = PMA_securePath($_POST['set_theme']);
|
||||||
} else {
|
} else {
|
||||||
$GLOBALS['theme'] = PMA_securePath($_COOKIE['pma_theme']);
|
$GLOBALS['theme'] = PMA_securePath($_COOKIE[$theme_cookie_name]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -756,6 +756,9 @@ if (!isset($cfg['ThemePath'])) {
|
|||||||
$cfg['ThemeManager'] = TRUE;
|
$cfg['ThemeManager'] = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!isset($cfg['ThemePerServer'])){
|
||||||
|
$cfg['ThemePerServer'] = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($cfg['DefaultQueryTable'])) {
|
if (!isset($cfg['DefaultQueryTable'])) {
|
||||||
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
|
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
|
||||||
|
@@ -61,10 +61,10 @@ if (!empty($GLOBALS['cfg']['PmaAbsoluteUri'])) {
|
|||||||
}
|
}
|
||||||
} // end if... else if...
|
} // end if... else if...
|
||||||
} // end if
|
} // end if
|
||||||
document.writeln('<link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : './'; ?>css/phpmyadmin.css.php?lang=<?php echo $GLOBALS['lang']; ?>&js_frame=<?php echo isset($print_view) ? 'print' : 'right'; ?>&js_isDOM=' + isDOM + '" />');
|
document.writeln('<link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : './'; ?>css/phpmyadmin.css.php?<?php echo PMA_generate_common_url(); ?>&js_frame=<?php echo isset($print_view) ? 'print' : 'right'; ?>&js_isDOM=' + isDOM + '" />');
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
<noscript>
|
<noscript>
|
||||||
<link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : './'; ?>css/phpmyadmin.css.php?lang=<?php echo $GLOBALS['lang']; ?>&js_frame=<?php echo isset($print_view) ? 'print' : 'right'; ?>" />
|
<link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : './'; ?>css/phpmyadmin.css.php?<?php echo PMA_generate_common_url(); ?>&js_frame=<?php echo isset($print_view) ? 'print' : 'right'; ?>" />
|
||||||
</noscript>
|
</noscript>
|
||||||
<link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : './'; ?>css/print.css" media="print" />
|
<link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : './'; ?>css/print.css?<?php echo PMA_generate_common_url(); ?>" media="print" />
|
||||||
|
@@ -79,25 +79,31 @@ if ($PMA_ThemeAvailable == TRUE) { // themeManager is available
|
|||||||
|
|
||||||
asort($available_themes_choices);
|
asort($available_themes_choices);
|
||||||
|
|
||||||
|
// Allow different theme per server
|
||||||
|
$theme_cookie_name = 'pma_theme';
|
||||||
|
if ($GLOBALS['cfg']['ThemePerServer']) {
|
||||||
|
$theme_cookie_name .= '-' . $server;
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($set_theme)) { // if user submit a theme
|
if (isset($set_theme)) { // if user submit a theme
|
||||||
setcookie('pma_theme', $set_theme, time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']);
|
setcookie($theme_cookie_name, $set_theme, time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']);
|
||||||
} else { // else check if user have a theme cookie
|
} else { // else check if user have a theme cookie
|
||||||
if (!isset($_COOKIE['pma_theme']) || empty($_COOKIE['pma_theme'])) {
|
if (!isset($_COOKIE[$theme_cookie_name]) || empty($_COOKIE[$theme_cookie_name])) {
|
||||||
if ($PMA_ThemeDefault == TRUE) {
|
if ($PMA_ThemeDefault == TRUE) {
|
||||||
if (basename($PHP_SELF) == 'index.php') {
|
if (basename($PHP_SELF) == 'index.php') {
|
||||||
setcookie('pma_theme', $cfg['ThemeDefault'], time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']);
|
setcookie($theme_cookie_name, $cfg['ThemeDefault'], time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']);
|
||||||
}
|
}
|
||||||
$pmaTheme=$cfg['ThemeDefault'];
|
$pmaTheme=$cfg['ThemeDefault'];
|
||||||
}else{
|
}else{
|
||||||
if (basename($PHP_SELF) == 'index.php') {
|
if (basename($PHP_SELF) == 'index.php') {
|
||||||
setcookie('pma_theme', 'original', time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']);
|
setcookie($theme_cookie_name, 'original', time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']);
|
||||||
}
|
}
|
||||||
$pmaTheme='original';
|
$pmaTheme='original';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$pmaTheme=$_COOKIE['pma_theme'];
|
$pmaTheme=$_COOKIE[$theme_cookie_name];
|
||||||
if (basename($PHP_SELF) == 'index.php') {
|
if (basename($PHP_SELF) == 'index.php') {
|
||||||
setcookie('pma_theme', $pmaTheme, time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']);
|
setcookie($theme_cookie_name, $pmaTheme, time() + 60*60*24*30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end if
|
} // end if
|
||||||
|
@@ -52,7 +52,7 @@ echo "<?xml version=\"1.0\" encoding=\"" . $GLOBALS['charset'] . "\"?".">"; // r
|
|||||||
<title>phpMyAdmin</title>
|
<title>phpMyAdmin</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
|
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
|
||||||
<base<?php if (!empty($cfg['PmaAbsoluteUri'])) echo ' href="' . $cfg['PmaAbsoluteUri'] . '"'; ?> />
|
<base<?php if (!empty($cfg['PmaAbsoluteUri'])) echo ' href="' . $cfg['PmaAbsoluteUri'] . '"'; ?> />
|
||||||
<link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?lang=<?php echo $lang; ?>&js_frame=left&num_dbs=0" />
|
<link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?<?php echo PMA_generate_common_url(); ?>&js_frame=left&num_dbs=0" />
|
||||||
<?php
|
<?php
|
||||||
if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
|
if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user