diff --git a/js/ajax.js b/js/ajax.js index d4adfc3e12..57e5edfadc 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -155,6 +155,10 @@ var AJAX = { AJAX.scriptHandler.reset(); + if (data._title) { + $('title').replaceWith(data._title); + } + if (data._menu) { $('#floating_menubar').html(data._menu) .children().first().remove(); // Remove duplicate wrapper (TODO: don't send it in the response) diff --git a/js/common.js b/js/common.js index 305cb40914..1cb6743df6 100644 --- a/js/common.js +++ b/js/common.js @@ -267,21 +267,3 @@ function openDb(new_db) refreshMain(opendb_url); return true; } - -function updateTableTitle( table_link_id, new_title ) -{ - //alert('updateTableTitle'); - if ( window.parent.frame_navigation.document && window.parent.frame_navigation.document.getElementById(table_link_id) ) { - var left = window.parent.frame_navigation.document; - - var link = left.getElementById(table_link_id); - link.title = window.parent.pma_text_default_tab + ': ' + new_title; - - var link = left.getElementById('quick_' + table_link_id); - link.title = window.parent.pma_text_left_default_tab + ': ' + new_title; - - return true; - } - - return false; -} diff --git a/libraries/Header.class.php b/libraries/Header.class.php index 37bcbcb915..9c11020afc 100644 --- a/libraries/Header.class.php +++ b/libraries/Header.class.php @@ -293,7 +293,7 @@ class PMA_Header $retval .= $this->_getHtmlStart(); $retval .= $this->_getMetaTags(); $retval .= $this->_getLinkTags(); - $retval .= $this->_getTitleTag(); + $retval .= $this->getTitleTag(); $title = PMA_sanitize( PMA_escapeJsString($this->_getPageTitle()), false, @@ -452,7 +452,7 @@ class PMA_Header * * @return string the TITLE tag */ - private function _getTitleTag() + public function getTitleTag() { $retval = ""; $retval .= $this->_getPageTitle(); diff --git a/libraries/Response.class.php b/libraries/Response.class.php index 45e32ea229..c186010092 100644 --- a/libraries/Response.class.php +++ b/libraries/Response.class.php @@ -291,6 +291,7 @@ class PMA_Response } if ($this->_isAjaxPage) { + $this->addJSON('_title', $this->getHeader()->getTitleTag()); $this->addJSON('_menu', $this->getHeader()->getMenu()->getDisplay()); $this->addJSON('_scripts', $this->getHeader()->getScripts()->getFiles()); $url = basename(PMA_getenv('SCRIPT_NAME')) . '?' . PMA_generate_common_url(); diff --git a/libraries/Util.class.php b/libraries/Util.class.php index ed73476e74..916c2dd2ae 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -1056,22 +1056,6 @@ class PMA_Util unset($GLOBALS['using_bookmark_message']); } - // Corrects the tooltip text via JS if required - // @todo this is REALLY the wrong place to do this - very unexpected here - if (! $is_view && strlen($GLOBALS['table']) && $cfg['ShowTooltip']) { - $tooltip = PMA_Table::sGetToolTip($GLOBALS['db'], $GLOBALS['table']); - $uni_tbl = PMA_jsFormat($GLOBALS['db'] . '.' . $GLOBALS['table'], false); - $retval .= "\n"; - $retval .= '<script type="text/javascript">' . "\n"; - $retval .= '//<![CDATA[' . "\n"; - $retval .= 'if (window.parent.updateTableTitle) {' . "\n"; - $retval .= " window.parent.updateTableTitle('" - . $uni_tbl . "', '" . PMA_jsFormat($tooltip, false) . "');" . "\n"; - $retval .= '}' . "\n"; - $retval .= '//]]>' . "\n"; - $retval .= '</script>' . "\n"; - } // end if ... elseif - // In an Ajax request, $GLOBALS['cell_align_left'] may not be defined. Hence, // check for it's presence before using it $retval .= '<div id="result_query"'