From ba816bef223673518285580f64eef86e2f464662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 14 Nov 2013 10:16:40 +0100 Subject: [PATCH] Better approach to showing demo server message --- js/ajax.js | 1 + libraries/Footer.class.php | 20 ++++++++------------ themes/original/css/common.css.php | 2 +- themes/pmahomme/css/common.css.php | 2 +- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/js/ajax.js b/js/ajax.js index 239b11fd23..95d26b39a5 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -263,6 +263,7 @@ var AJAX = { .not('#session_debug') .not('#pma_header') .not('#pma_footer') + .not('#pma_demo') .remove(); // Replace #page_content with new content if (data.message && data.message.length > 0) { diff --git a/libraries/Footer.class.php b/libraries/Footer.class.php index 623a767a90..06044402ef 100644 --- a/libraries/Footer.class.php +++ b/libraries/Footer.class.php @@ -61,11 +61,11 @@ class PMA_Footer } /** - * Adds the message for demo server to error messages + * Returns the message for demo server to error messages * * @return string */ - private function _addDemoMessage() + private function _getDemoMessage() { $message = '' . __('phpMyAdmin Demo Server') . ': '; if (file_exists('./revision-info.php')) { @@ -81,13 +81,7 @@ class PMA_Footer $message .= __('Git information missing!'); } - $GLOBALS['error_handler']->addError( - $message, - E_USER_NOTICE, - '', - '', - false - ); + return PMA_Message::notice($message)->getDisplay(); } /** @@ -264,9 +258,6 @@ class PMA_Footer if (! $this->_isAjax) { $retval .= ""; } - if ($GLOBALS['cfg']['DBG']['demo']) { - $this->_addDemoMessage(); - } if (! $this->_isAjax && ! $this->_isMinimal) { if (PMA_getenv('SCRIPT_NAME') && empty($_POST) @@ -296,6 +287,11 @@ class PMA_Footer $retval .= $this->_getDebugMessage(); $retval .= $this->getErrorMessages(); $retval .= $this->_scripts->getDisplay(); + if ($GLOBALS['cfg']['DBG']['demo']) { + $retval .= '
'; + $retval .= $this->_getDemoMessage(); + $retval .= '
'; + } // Include possible custom footers if (file_exists(CUSTOM_FOOTER_FILE)) { $retval .= '