move user preferences to top level server menu

This commit is contained in:
Crack
2010-07-07 01:27:05 +02:00
parent a9f39a92e7
commit 54c322544c
4 changed files with 56 additions and 25 deletions

View File

@@ -158,7 +158,9 @@ $strConfigForm_Edit_desc = __('Customize edit mode');
$strConfigForm_Export = __('Export'); $strConfigForm_Export = __('Export');
$strConfigForm_Export_defaults = __('Export defaults'); $strConfigForm_Export_defaults = __('Export defaults');
$strConfigForm_Export_defaults_desc = __('Customize default export options'); $strConfigForm_Export_defaults_desc = __('Customize default export options');
$strConfigForm_Features = __('Features');
$strConfigForm_General = __('General settings'); $strConfigForm_General = __('General settings');
$strConfigForm_General_desc = __('Set some commonly used options');
$strConfigForm_Import = __('Import'); $strConfigForm_Import = __('Import');
$strConfigForm_Import_defaults = __('Import defaults'); $strConfigForm_Import_defaults = __('Import defaults');
$strConfigForm_Import_defaults_desc = __('Customize default common import options'); $strConfigForm_Import_defaults_desc = __('Customize default common import options');
@@ -213,6 +215,8 @@ $strConfigForm_Startup = __('Startup');
$strConfigForm_Startup_desc = __('Customize startup page'); $strConfigForm_Startup_desc = __('Customize startup page');
$strConfigForm_Tabs = __('Tabs'); $strConfigForm_Tabs = __('Tabs');
$strConfigForm_Tabs_desc = __('Choose how you want tabs to work'); $strConfigForm_Tabs_desc = __('Choose how you want tabs to work');
$strConfigForm_Text_fields = __('Text fields');
$strConfigForm_Text_fields_desc = __('Customize text input fields');
$strConfigForm_Texy = __('Texy! text'); $strConfigForm_Texy = __('Texy! text');
$strConfigForm_Texy_desc = __('Customize default options'); $strConfigForm_Texy_desc = __('Customize default options');
$strConfigGZipDump_desc = __('Enable [a@http://en.wikipedia.org/wiki/Gzip]gzip[/a] compression for import and export operations'); $strConfigGZipDump_desc = __('Enable [a@http://en.wikipedia.org/wiki/Gzip]gzip[/a] compression for import and export operations');

View File

@@ -91,6 +91,10 @@ $tabs['synchronize']['icon'] = 's_sync.png';
$tabs['synchronize']['link'] = 'server_synchronize.php'; $tabs['synchronize']['link'] = 'server_synchronize.php';
$tabs['synchronize']['text'] = __('Synchronize'); $tabs['synchronize']['text'] = __('Synchronize');
$tabs['settings']['icon'] = 'b_tblops.png';
$tabs['settings']['link'] = 'user_preferences.php';
$tabs['settings']['text'] = __('Settings');
echo PMA_generate_html_tabs($tabs, array()); echo PMA_generate_html_tabs($tabs, array());
unset($tabs); unset($tabs);

View File

@@ -582,55 +582,62 @@ form.login label {
/* specific elements */ /* specific elements */
/* topmenu */ /* topmenu */
ul#topmenu, ul.tabs { ul#topmenu, ul#topmenu2, ul.tabs {
font-weight: bold; font-weight: bold;
list-style-type: none; list-style-type: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
ul#topmenu li { ul#topmenu li, ul#topmenu2 li {
float: <?php echo $left; ?>; float: <?php echo $left; ?>;
margin: 0; margin: 0;
padding: 0; padding: 0;
vertical-align: middle; vertical-align: middle;
} }
#topmenu img { #topmenu img, #topmenu2 img {
vertical-align: middle; vertical-align: middle;
margin-<?php echo $right; ?>: 0.1em; margin-<?php echo $right; ?>: 0.1em;
} }
/* default tab styles */ /* default tab styles */
.tab, .tabcaution, .tabactive { ul#topmenu .tab, ul#topmenu .tabcaution, ul#topmenu .tabactive {
display: block; display: block;
margin: 0.2em 0.2em 0 0.2em; margin: 0.2em 0.2em 0 0.2em;
padding: 0.2em 0.2em 0 0.2em; padding: 0.2em 0.2em 0 0.2em;
white-space: nowrap; white-space: nowrap;
} }
ul#topmenu2 .tab, ul#topmenu2 .tabactive {
display: block;
margin: 0.1em;
padding: 0.2em;
white-space: nowrap;
}
/* disabled tabs */ /* disabled tabs */
span.tab { ul#topmenu span.tab {
color: #666666; color: #666666;
} }
/* disabled drop/empty tabs */ /* disabled drop/empty tabs */
span.tabcaution { ul#topmenu span.tabcaution {
color: #ff6666; color: #ff6666;
} }
/* enabled drop/empty tabs */ /* enabled drop/empty tabs */
a.tabcaution { ul#topmenu a.tabcaution {
color: #FF0000; color: #FF0000;
} }
a.tabcaution:hover { ul#topmenu a.tabcaution:hover {
color: #FFFFFF; color: #FFFFFF;
background-color: #FF0000; background-color: #FF0000;
} }
<?php if ($GLOBALS['cfg']['LightTabs']) { ?> <?php if ($GLOBALS['cfg']['LightTabs']) { ?>
/* active tab */ /* active tab */
a.tabactive { ul#topmenu a.tabactive, ul#topmenu2 a.tabactive {
color: black; color: black;
} }
<?php } else { ?> <?php } else { ?>
@@ -639,12 +646,18 @@ a.tabactive {
padding: 0.1em 0.3em 0.1em 0.3em; padding: 0.1em 0.3em 0.1em 0.3em;
} }
ul#topmenu2 {
margin: 0.25em 0.5em 0;
height: 2em;
clear: both;
}
ul#topmenu li { ul#topmenu li {
border-bottom: 1pt solid black; border-bottom: 1pt solid black;
} }
/* default tab styles */ /* default tab styles */
.tab, .tabcaution, .tabactive { ul#topmenu .tab, ul#topmenu .tabcaution, ul#topmenu .tabactive {
background-color: <?php echo $GLOBALS['cfg']['BgOne']; ?>; background-color: <?php echo $GLOBALS['cfg']['BgOne']; ?>;
border: 1pt solid <?php echo $GLOBALS['cfg']['BgTwo']; ?>; border: 1pt solid <?php echo $GLOBALS['cfg']['BgTwo']; ?>;
border-bottom: 0; border-bottom: 0;
@@ -653,29 +666,37 @@ ul#topmenu li {
} }
/* enabled hover/active tabs */ /* enabled hover/active tabs */
a.tab:hover, ul#topmenu a.tab:hover,
a.tabcaution:hover, ul#topmenu a.tabcaution:hover,
.tabactive, ul#topmenu .tabactive,
.tabactive:hover { ul#topmenu .tabactive:hover {
margin: 0; margin: 0;
padding: 0.2em 0.4em 0.2em 0.4em; padding: 0.2em 0.4em 0.2em 0.4em;
text-decoration: none; text-decoration: none;
} }
a.tab:hover, ul#topmenu a.tab:hover,
.tabactive { ul#topmenu .tabactive {
background-color: <?php echo $GLOBALS['cfg']['MainBackground']; ?>; background-color: <?php echo $GLOBALS['cfg']['MainBackground']; ?>;
} }
ul#topmenu2 a.tab:hover,
ul#topmenu2 a.tabactive {
background-color: <?php echo $GLOBALS['cfg']['BgOne']; ?>;
-moz-border-radius: 0.3em;
border-radius: 0.3em;
text-decoration: none;
}
/* to be able to cancel the bottom border, use <li class="active"> */ /* to be able to cancel the bottom border, use <li class="active"> */
ul#topmenu li.active { ul#topmenu li.active {
border-bottom: 1pt solid <?php echo $GLOBALS['cfg']['MainBackground']; ?>; border-bottom: 1pt solid <?php echo $GLOBALS['cfg']['MainBackground']; ?>;
} }
/* disabled drop/empty tabs */ /* disabled drop/empty tabs */
span.tab, ul#topmenu span.tab,
a.warning, a.warning,
span.tabcaution { ul#topmenu span.tabcaution {
cursor: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>error.ico), default; cursor: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>error.ico), default;
} }
<?php } ?> <?php } ?>

View File

@@ -22,8 +22,10 @@ $GLOBALS['js_include'][] = 'config.js';
require_once './libraries/header.inc.php'; require_once './libraries/header.inc.php';
// build tabs // show server tabs
$tabs = array(); require './libraries/server_links.inc.php';
// build user preferences menu
$form_param = filter_input(INPUT_GET, 'form'); $form_param = filter_input(INPUT_GET, 'form');
if (!isset($forms[$form_param])) { if (!isset($forms[$form_param])) {
$forms_keys = array_keys($forms); $forms_keys = array_keys($forms);
@@ -36,16 +38,16 @@ $tabs_icons = array(
'Main_frame' => 'b_props.png', 'Main_frame' => 'b_props.png',
'Import' => 'b_import.png', 'Import' => 'b_import.png',
'Export' => 'b_export.png'); 'Export' => 'b_export.png');
echo '<ul id="topmenu2">';
foreach (array_keys($forms) as $formset) { foreach (array_keys($forms) as $formset) {
$tabs[] = array( $tab = array(
'link' => 'user_preferences.php', 'link' => 'user_preferences.php',
'text' => PMA_lang('Form_' . $formset), 'text' => PMA_lang('Form_' . $formset),
'icon' => $tabs_icons[$formset], 'icon' => $tabs_icons[$formset],
'active' => $formset == $form_param, 'active' => $formset == $form_param);
'url_params' => array('form' => $formset)); echo PMA_generate_html_tab($tab, array('form' => $formset));
} }
echo '</ul>';
echo PMA_generate_html_tabs($tabs, array());
// show "configuration saved" message and reload navigation frame if needed // show "configuration saved" message and reload navigation frame if needed
if (!empty($_GET['saved'])) { if (!empty($_GET['saved'])) {