diff --git a/js/ajax.js b/js/ajax.js index d1579c231e..1f2040226f 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -162,7 +162,7 @@ var AJAX = { menuResize(); } - $('body').children().not('#floating_menubar').not('#page_content').not('#selflink').remove(); + $('body').children().not('#pma_navigation').not('#floating_menubar').not('#page_content').not('#selflink').remove(); $('#page_content').replaceWith("
" + data.message + "
"); if (data.sql_query) { diff --git a/js/functions.js b/js/functions.js index 199030a89d..f583d39c76 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2816,7 +2816,7 @@ AJAX.registerOnload('functions.js', function() { function menuResize() { var $cnt = $('#topmenu'); - var wmax = $cnt.innerWidth() - 5; // 5 px margin for jumping menu in Chrome + var wmax = $cnt.innerWidth() - $('#pma_navigation').width() - 5 ; // 5 px margin for jumping menu in Chrome var $submenu = $cnt.find('.submenu'); var submenu_w = $submenu.outerWidth(true); var $submenu_ul = $submenu.find('ul'); @@ -3614,11 +3614,13 @@ AJAX.registerOnload('functions.js', function() { * Makes the breadcrumbs and the menu bar float at the top of the viewport */ if ($("#floating_menubar").length && $('#PMA_disable_floating_menubar').length == 0) { + var left = $('html').attr('dir') == 'ltr' ? 'left' : 'right'; $("#floating_menubar") + .css('margin-' + left, $('#pma_navigation').width()) + .css(left, 0) .css({ 'position': 'fixed', 'top': 0, - 'left': 0, 'width': '100%', 'z-index': 500 }) @@ -3628,6 +3630,7 @@ AJAX.registerOnload('functions.js', function() { 'padding-top', $('#floating_menubar').outerHeight(true) ); + menuResize(); } /** @@ -3775,3 +3778,14 @@ AJAX.registerOnload('functions.js', function () { $loginform.find('.js-show').show(); $loginform.find('#input_username').select(); }); + +// Load the navigation into the initial page +$(function () { + if ($('body#loginform').length == 0) { + $.get('navigation.php', {ajax_request: true}, function (data) { + if (data.success) { + $('#pma_navigation_tree').html(data.message); + } + }); + } +}); diff --git a/libraries/Header.class.php b/libraries/Header.class.php index 041bd645e5..d8242745af 100644 --- a/libraries/Header.class.php +++ b/libraries/Header.class.php @@ -12,6 +12,7 @@ if (! defined('PHPMYADMIN')) { require_once 'libraries/Scripts.class.php'; require_once 'libraries/RecentTable.class.php'; require_once 'libraries/Menu.class.php'; +require_once 'libraries/NavigationHeader.class.php'; /** * Class used to output the HTTP and HTML headers @@ -306,6 +307,10 @@ class PMA_Header } $retval .= $this->_scripts->getDisplay(); $retval .= $this->_getBodyStart(); + if ($this->_menuEnabled && $GLOBALS['server'] > 0) { + $nav = new PMA_NavigationHeader(); + $retval .= $nav->getDisplay(); + } // Include possible custom headers if (file_exists(CUSTOM_HEADER_FILE)) { ob_start(); diff --git a/libraries/NavigationHeader.class.php b/libraries/NavigationHeader.class.php new file mode 100644 index 0000000000..6b4f526859 --- /dev/null +++ b/libraries/NavigationHeader.class.php @@ -0,0 +1,198 @@ +_commonFunctions = PMA_CommonFunctions::getInstance(); + $buffer = '
'; + $buffer .= $this->logo(); + $buffer .= $this->links(); + $buffer .= $this->serverChoice(); + $buffer .= $this->recent(); + $buffer .= '
'; + $buffer .= '
'; + $buffer .= '
'; + return $buffer; + } + + /** + * Create the code for displaying the phpMyAdmin + * logo based on configuration settings + * + * return string HTML code for the logo + */ + private function logo() + { + $retval = ''; + // display Logo, depending on $GLOBALS['cfg']['LeftDisplayLogo'] + if ($GLOBALS['cfg']['LeftDisplayLogo']) { + $logo = 'phpMyAdmin'; + if (@file_exists($GLOBALS['pmaThemeImage'] . 'logo_left.png')) { + $logo = ''; + } elseif (@file_exists($GLOBALS['pmaThemeImage'] . 'pma_logo2.png')) { + $logo = ''; + } + $retval .= ''; + $retval .= ''; + return $retval; + } + + /** + * Displays the MySQL servers choice form + * + * return string HTML code for the MySQL servers choice + */ + private function serverChoice() + { + $retval = ''; + if ($GLOBALS['cfg']['LeftDisplayServers']) { + require_once './libraries/select_server.lib.php'; + $retval .= ''; + $retval .= '
'; + $retval .= PMA_selectServer(true, true); + $retval .= '
'; + $retval .= ''; + } + return $retval; + } + + /** + * Displays a drop-down choice of most recently used tables + * + * return string HTML code for the Recent tables + */ + private function recent() + { + $retval = ''; + // display recently used tables + if ($GLOBALS['cfg']['LeftRecentTable'] > 0) { + $retval .= ''; + $retval .= '
'; + $retval .= '
'; + $retval .= ' ' . PMA_generate_common_hidden_inputs(); + $retval .= PMA_RecentTable::getInstance()->getHtmlSelect(); + $retval .= '
'; + $retval .= '
'; + $retval .= ''; + } + return $retval; + } +} +?> diff --git a/libraries/navigation_header.inc.php b/libraries/navigation_header.inc.php deleted file mode 100644 index b9e1ccd229..0000000000 --- a/libraries/navigation_header.inc.php +++ /dev/null @@ -1,104 +0,0 @@ -'; - } elseif (@file_exists($GLOBALS['pmaThemeImage'] . 'pma_logo2.png')) { - $logo = ''; - } - - echo '' . "\n"; -} // end of display logo -?> -' . "\n"; - -/** - * Displays the MySQL servers choice form - */ -if ($GLOBALS['cfg']['LeftDisplayServers'] && (count($GLOBALS['cfg']['Servers']) > 1 || $server == 0 && count($GLOBALS['cfg']['Servers']) == 1)) { - echo '
'; - include './libraries/select_server.lib.php'; - PMA_selectServer(true, true); - echo '

'; -} // end if LeftDisplayServers -?> diff --git a/navigation.php b/navigation.php index e7408b6b6e..3e440691da 100644 --- a/navigation.php +++ b/navigation.php @@ -116,18 +116,6 @@ $scripts->addCode( };' ); -require 'libraries/navigation_header.inc.php'; - -// display recently used tables -if ($GLOBALS['cfg']['LeftRecentTable'] > 0) { - echo '
' . "\n" - .'
' . "\n" - .PMA_generate_common_hidden_inputs() . "\n" - .PMA_RecentTable::getInstance()->getHtmlSelect() - .'
' . "\n" - .'
' . "\n"; -} - if (! $GLOBALS['server']) { // no server selected PMA_exitNavigationFrame(); diff --git a/themes/original/css/common.css.php b/themes/original/css/common.css.php index 393793de09..3024b2a832 100644 --- a/themes/original/css/common.css.php +++ b/themes/original/css/common.css.php @@ -31,11 +31,20 @@ body { font-family: ; padding: 0; - margin: 0 0.5em 0 0; + margin: 0; + margin-: 240px; color: ; background: ; } +body#loginform { + margin: 0; +} + +#page_content { + margin: 0 .5em; +} + textarea, tt, pre, code { font-family: ; @@ -1381,7 +1390,8 @@ li#li_user_preferences { display: block; margin-top: 1em; margin-bottom: 1em; - width: 100%; + width: 98%; + margin-left: 1%; border-top: .1em solid silver; text-align: ; } diff --git a/themes/original/css/navigation.css.php b/themes/original/css/navigation.css.php index 8c2fdf98a1..c66756809f 100644 --- a/themes/original/css/navigation.css.php +++ b/themes/original/css/navigation.css.php @@ -16,25 +16,30 @@ if (! defined('PMA_MINIMUM_COMMON') && ! defined('TESTSUITE')) { /******************************************************************************/ /* Navigation */ -body#body_leftFrame { +#pma_navigation { background: ; color: ; - margin: 0; - padding: 0.2em; + width: 240px; + overflow: hidden; + position: fixed; + top: 0; + : 0; + height: 100%; + border-: 1px solid gray; } -#body_leftFrame ul { +#pma_navigation ul { margin: 0; } -#body_leftFrame form { +#pma_navigation form { margin: 0; padding: 0; display: inline; } -#body_leftFrame select#select_server, -#body_leftFrame select#lightm_db { +#pma_navigation select#select_server, +#pma_navigation select#lightm_db { width: 100%; } @@ -44,80 +49,80 @@ body#body_leftFrame { /******************************************************************************/ /* specific elements */ -#body_leftFrame div#pmalogo { +#pma_navigation div#pmalogo { background-color: ; padding:.3em; } -#body_leftFrame div#recentTableList { +#pma_navigation div#recentTableList { text-align: center; margin-bottom: 0.5em; } -#body_leftFrame div#recentTableList select { +#pma_navigation div#recentTableList select { width: 100%; } -#body_leftFrame div#pmalogo, -#body_leftFrame div#leftframelinks, -#body_leftFrame div#databaseList { +#pma_navigation div#pmalogo, +#pma_navigation div#leftframelinks, +#pma_navigation div#databaseList { text-align: center; margin-bottom: 0.5em; padding-bottom: 0.5em; } -#body_leftFrame ul#databaseList { +#pma_navigation ul#databaseList { margin-bottom: 0.5em; padding-bottom: 0.5em; padding-: 1.5em; font-style: italic; } -#body_leftFrame ul#databaseList a { +#pma_navigation ul#databaseList a { display: block; font-style: normal; } -#body_leftFrame div#navidbpageselector a, -#body_leftFrame ul#databaseList a { +#pma_navigation div#navidbpageselector a, +#pma_navigation ul#databaseList a { background: ; color: ; } -#body_leftFrame ul#databaseList ul { +#pma_navigation ul#databaseList ul { padding-left: 1em; padding-right: 0; } -#body_leftFrame ul#databaseList a:hover { +#pma_navigation ul#databaseList a:hover { background: ; color: ; } -#body_leftFrame ul#databaseList li.selected a { +#pma_navigation ul#databaseList li.selected a { background: ; color: ; } -#body_leftFrame div#leftframelinks .icon { +#pma_navigation div#leftframelinks .icon { padding: 0; margin: 0; } -#body_leftFrame div#leftframelinks a img.icon { +#pma_navigation div#leftframelinks a img.icon { margin: 2px; border: 0.1em solid ; padding: 0; } -#body_leftFrame div#leftframelinks a:hover img { +#pma_navigation div#leftframelinks a:hover img { background-color: ; color: ; } /* serverlist */ -#body_leftFrame #list_server { +#pma_navigation #list_server { list-style-image: url(/original/img/s_host.png); list-style-position: inside; list-style-type: none; @@ -125,13 +130,13 @@ body#body_leftFrame { padding: 0; } -#body_leftFrame #list_server li { +#pma_navigation #list_server li { margin: 0; padding: 0; font-size: 80%; } -#body_leftFrame div#left_tableList ul { +#pma_navigation div#left_tableList ul { list-style-type: none; list-style-position: outside; margin: 0; @@ -140,23 +145,23 @@ body#body_leftFrame { background: ; } -#body_leftFrame div#left_tableList ul ul { +#pma_navigation div#left_tableList ul ul { font-size: 100%; } -#body_leftFrame div#left_tableList a { +#pma_navigation div#left_tableList a { background: ; color: ; text-decoration: none; } -#body_leftFrame div#left_tableList a:hover { +#pma_navigation div#left_tableList a:hover { background: ; color: ; text-decoration: underline; } -#body_leftFrame div#left_tableList li { +#pma_navigation div#left_tableList li { margin: 0; padding: 0; white-space: nowrap; @@ -164,27 +169,27 @@ body#body_leftFrame { /* marked items */ -#body_leftFrame div#left_tableList > ul li.marked > a, -#body_leftFrame div#left_tableList > ul li.marked { +#pma_navigation div#left_tableList > ul li.marked > a, +#pma_navigation div#left_tableList > ul li.marked { background: ; color: ; } -#body_leftFrame div#left_tableList > ul li:hover > a, -#body_leftFrame div#left_tableList > ul li:hover { +#pma_navigation div#left_tableList > ul li:hover > a, +#pma_navigation div#left_tableList > ul li:hover { background: ; color: ; } -#body_leftFrame div#left_tableList img { +#pma_navigation div#left_tableList img { padding: 0; vertical-align: middle; } -#body_leftFrame div#left_tableList ul ul { +#pma_navigation div#left_tableList ul ul { margin-: 0; padding-: .1em; border-: .1em solid ; @@ -193,21 +198,21 @@ body#body_leftFrame { } /* for the servers list in navi panel */ -#body_leftFrame #serverinfo .item { +#pma_navigation #serverinfo .item { white-space: nowrap; color: ; } -#body_leftFrame #serverinfo a:hover { +#pma_navigation #serverinfo a:hover { background: ; color: ; } -#body_leftFrame #NavFilter { +#pma_navigation #NavFilter { display: none; } -#body_leftFrame #clear_fast_filter, -#body_leftFrame #clear_fast_db_filter { +#pma_navigation #clear_fast_filter, +#pma_navigation #clear_fast_db_filter { color: black; cursor: pointer; padding: 0; @@ -215,15 +220,15 @@ body#body_leftFrame { float: right; } -#body_leftFrame #fast_filter, -#body_leftFrame #fast_db_filter { +#pma_navigation #fast_filter, +#pma_navigation #fast_db_filter { width: 90%; padding: 2px 0; margin: 0; border: 0; } -#body_leftFrame #fast_filter.gray, -#body_leftFrame #fast_db_fiter.gray { +#pma_navigation #fast_filter.gray, +#pma_navigation #fast_db_fiter.gray { color: gray; } diff --git a/themes/pmahomme/css/common.css.php b/themes/pmahomme/css/common.css.php index 686a399ec5..5124bb1676 100644 --- a/themes/pmahomme/css/common.css.php +++ b/themes/pmahomme/css/common.css.php @@ -31,11 +31,20 @@ body { font-family: ; padding: 0; - margin: 0 .5em 0 0; + margin: 0; + margin-: 240px; color: #444; background: #fff; } +body#loginform { + margin: 0; +} + +#page_content { + margin: 0 .5em; +} + textarea, tt, @@ -1747,7 +1756,8 @@ li#li_user_preferences { display: block; margin-top: 1em; margin-bottom: 1em; - width: 100%; + width: 98%; + margin-left: 1%; border-top: .1em solid silver; text-align: ; } diff --git a/themes/pmahomme/css/navigation.css.php b/themes/pmahomme/css/navigation.css.php index 048c5de06a..e52bf592a8 100644 --- a/themes/pmahomme/css/navigation.css.php +++ b/themes/pmahomme/css/navigation.css.php @@ -16,33 +16,36 @@ if (! defined('PMA_MINIMUM_COMMON') && ! defined('TESTSUITE')) { /******************************************************************************/ /* Navigation */ -body#body_leftFrame { +#pma_navigation { + width: 240px; + overflow: hidden; + position: fixed; + top: 0; + : 0; + height: 100%; background: url(./themes/pmahomme/img/left_nav_bg.png) repeat-y right 0% #f3f3f3; - border-right: 1px solid #aaa; color: ; - margin: 0; - padding: 0; } -#body_leftFrame ul { +#pma_navigation ul { margin: 0; } -#body_leftFrame form { +#pma_navigation form { margin: 0; padding: 0; display: inline; } -#body_leftFrame select#select_server, -#body_leftFrame select#lightm_db { +#pma_navigation select#select_server, +#pma_navigation select#lightm_db { width: 100%; } /******************************************************************************/ /* classes */ -#body_leftFrame .navi_dbName { +#pma_navigation .navi_dbName { font-weight: bold; color: ; } @@ -50,96 +53,97 @@ body#body_leftFrame { /******************************************************************************/ /* specific elements */ -#body_leftFrame div#pmalogo { +#pma_navigation div#pmalogo { } -#body_leftFrame div#recentTableList { +#pma_navigation div#recentTableList { text-align: center; margin: 20px 10px 0px 10px; } -#body_leftFrame div#recentTableList select { +#pma_navigation div#recentTableList select { width: 100%; } -#body_leftFrame div#pmalogo, -#body_leftFrame div#leftframelinks, -#body_leftFrame div#databaseList { +#pma_navigation div#pmalogo, +#pma_navigation div#leftframelinks, +#pma_navigation div#databaseList { text-align: center; margin: 5px 10px 0px 10px; } -#body_leftFrame ul#databaseList { +#pma_navigation ul#databaseList { margin: .8em 0px; padding-bottom: .5em; padding-: .3em; font-style: italic; } -#body_leftFrame ul#databaseList span { +#pma_navigation ul#databaseList span { padding: 5px; } -#body_leftFrame ul#databaseList a { +#pma_navigation ul#databaseList a { color: #333; background: url(./themes/pmahomme/img/database.png) no-repeat 0 5px transparent; display: block; text-indent: 0; padding: 5px 5px 5px 25px; font-style: normal; + border-: 1px solid #aaa; } -#body_leftFrame div#navidbpageselector { +#pma_navigation div#navidbpageselector { margin: .1em; text-align: center; } -#body_leftFrame div#navidbpageselector a, -#body_leftFrame div#navidbpageselector select{ +#pma_navigation div#navidbpageselector a, +#pma_navigation div#navidbpageselector select{ color: #333; margin: .2em; } -#body_leftFrame ul#databaseList ul { +#pma_navigation ul#databaseList ul { margin: 0; padding: 0; } -#body_leftFrame ul#databaseList li { +#pma_navigation ul#databaseList li { list-style: none; text-indent: 20px; margin: 0; padding: 0; } -#body_leftFrame ul#databaseList a:hover { +#pma_navigation ul#databaseList a:hover { background-color: #e4e4e4; } -#body_leftFrame ul#databaseList li.selected a { +#pma_navigation ul#databaseList li.selected a { background: ; color: ; } -#body_leftFrame div#leftframelinks .icon { +#pma_navigation div#leftframelinks .icon { padding: 0; margin: 0; } -#body_leftFrame div#reloadlink a img, -#body_leftFrame div#leftframelinks a img.icon { +#pma_navigation div#reloadlink a img, +#pma_navigation div#leftframelinks a img.icon { margin: .3em; margin-top: .7em; border: 0; } -#body_leftFrame div#leftframelinks a:hover img { +#pma_navigation div#leftframelinks a:hover img { } /* serverlist */ -#body_leftFrame #list_server { +#pma_navigation #list_server { list-style-image: url(/original/img/s_host.png); list-style-position: inside; list-style-type: none; @@ -147,45 +151,45 @@ body#body_leftFrame { padding: 0; } -#body_leftFrame #list_server li { +#pma_navigation #list_server li { margin: 0; padding: 0; } -#body_leftFrame div#left_tableList {margin:10px 10px 0 10px;} -#body_leftFrame div#left_tableList ul { +#pma_navigation div#left_tableList {margin:10px 10px 0 10px;} +#pma_navigation div#left_tableList ul { list-style-type: none; list-style-position: outside; margin: 0; padding: 0; } -#body_leftFrame div#left_tableList ul ul { +#pma_navigation div#left_tableList ul ul { font-size: 100%; } -#body_leftFrame div#left_tableList a { +#pma_navigation div#left_tableList a { color: ; text-decoration: none; } -#body_leftFrame div#left_tableList a:hover { +#pma_navigation div#left_tableList a:hover { background: ; color: ; text-decoration: underline; } -#body_leftFrame div#left_tableList li { +#pma_navigation div#left_tableList li { margin: 0; padding: 2px 0; white-space: nowrap; } -#body_leftFrame #newtable { +#pma_navigation #newtable { margin-top: 15px !important; } -#body_leftFrame #newtable a { +#pma_navigation #newtable a { display: block; padding: 1px; getCssGradient('ffffff', 'cccccc'); ?> @@ -195,42 +199,42 @@ body#body_leftFrame { border-radius: 20px; } -#body_leftFrame #newtable li:hover { +#pma_navigation #newtable li:hover { background: transparent !important; } -#body_leftFrame #newtable a:hover { +#pma_navigation #newtable a:hover { getCssGradient('cccccc', 'dddddd'); ?> } -#body_leftFrame #newtable li a:hover { +#pma_navigation #newtable li a:hover { text-decoration: none; } /* marked items */ -#body_leftFrame div#left_tableList > ul li.marked > a, -#body_leftFrame div#left_tableList > ul li.marked { +#pma_navigation div#left_tableList > ul li.marked > a, +#pma_navigation div#left_tableList > ul li.marked { background: #e4e4e4; color: ; } -#body_leftFrame div#left_tableList > ul li:hover > a, -#body_leftFrame div#left_tableList > ul li:hover { +#pma_navigation div#left_tableList > ul li:hover > a, +#pma_navigation div#left_tableList > ul li:hover { background: #e4e4e4; color: ; } -#body_leftFrame div#left_tableList img { +#pma_navigation div#left_tableList img { padding: 0; vertical-align: middle; } -#body_leftFrame div#left_tableList ul ul { +#pma_navigation div#left_tableList ul ul { margin-: 0; padding-: .1em; border-: .1em solid ; @@ -239,48 +243,48 @@ body#body_leftFrame { } /* for the servers list in navi panel */ -#body_leftFrame #serverinfo .item { +#pma_navigation #serverinfo .item { white-space: nowrap; color: ; } -#body_leftFrame #serverinfo a:hover { +#pma_navigation #serverinfo a:hover { background: ; color: ; } -#body_leftFrame #reloadlink { +#pma_navigation #reloadlink { clear: both; float: ; display: block; padding: 1em; } -#body_leftFrame #NavFilter { +#pma_navigation #NavFilter { display: none; } -#body_leftFrame #clear_fast_filter, -#body_leftFrame #clear_fast_db_filter { +#pma_navigation #clear_fast_filter, +#pma_navigation #clear_fast_db_filter { color: black; cursor: pointer; padding: 0; margin: 0; } -#body_leftFrame #fast_filter { +#pma_navigation #fast_filter { width: 85%; padding: .1em; margin-right: 0; margin-left: 0; } -#body_leftFrame #fast_db_filter { +#pma_navigation #fast_db_filter { width: 85%; padding: .1em; margin-right: 0; margin-left: 10px; } -#body_leftFrame #fast_filter.gray, -#body_leftFrame #fast_db_filter.gray { +#pma_navigation #fast_filter.gray, +#pma_navigation #fast_db_filter.gray { color: gray; }