Better approach to showing demo server message

This commit is contained in:
Michal Čihař 2013-11-14 10:16:40 +01:00
parent 972075d032
commit ba816bef22
4 changed files with 11 additions and 14 deletions

View File

@ -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) {

View File

@ -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 = '<a href="/">' . __('phpMyAdmin Demo Server') . '</a>: ';
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 .= "</div>";
}
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 .= '<div id="pma_demo">';
$retval .= $this->_getDemoMessage();
$retval .= '</div>';
}
// Include possible custom footers
if (file_exists(CUSTOM_FOOTER_FILE)) {
$retval .= '<div id="pma_footer">';

View File

@ -393,7 +393,7 @@ td .icon {
}
/* message boxes: error, confirmation */
#pma_errors {
#pma_errors, #pma_demo {
padding: 0 0.5em;
}

View File

@ -607,7 +607,7 @@ td .icon {
}
/* message boxes: error, confirmation */
#pma_errors {
#pma_errors, #pma_demo {
padding: 0 0.5em;
}