make use of PMA_Message

This commit is contained in:
Sebastian Mendel
2007-10-17 12:14:19 +00:00
parent 06b2fea3e3
commit 085a7c8f22
9 changed files with 54 additions and 50 deletions

View File

@@ -29,7 +29,7 @@ $export_page_title = $strViewDumpDB;
// exit if no tables in db found // exit if no tables in db found
if ($num_tables < 1) { if ($num_tables < 1) {
echo '<div class="warning">' . $strNoTablesFound . '</div>'; PMA_Message::error('strNoTablesFound')->display();
require './libraries/footer.inc.php'; require './libraries/footer.inc.php';
exit; exit;
} // end if } // end if

View File

@@ -38,7 +38,7 @@ if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) {
if (isset($_REQUEST['submit_sql']) if (isset($_REQUEST['submit_sql'])
&& ! preg_match('@^SELECT@i', $sql_query)) { && ! preg_match('@^SELECT@i', $sql_query)) {
echo '<div class="warning">' . $GLOBALS['strHaveToShow'] . '</div>'; PMA_Message::warning('strHaveToShow')->display();
} }

View File

@@ -19,8 +19,8 @@
* *
* @access public * @access public
*/ */
function PMA_auth() { function PMA_auth()
{
/* Perform logout to custom URL */ /* Perform logout to custom URL */
if (!empty($_REQUEST['old_usr']) && !empty($GLOBALS['cfg']['Server']['LogoutURL'])) { if (!empty($_REQUEST['old_usr']) && !empty($GLOBALS['cfg']['Server']['LogoutURL'])) {
PMA_sendHeaderLocation($GLOBALS['cfg']['Server']['LogoutURL']); PMA_sendHeaderLocation($GLOBALS['cfg']['Server']['LogoutURL']);
@@ -46,22 +46,25 @@ function PMA_auth() {
?> ?>
</head> </head>
<body> <body>
<?php if (file_exists('./config.header.inc.php')) { <?php
require './config.header.inc.php'; if (file_exists('./config.header.inc.php')) {
} require './config.header.inc.php';
?> }
?>
<br /><br /> <br /><br />
<center> <center>
<h1><?php echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION); ?></h1> <h1><?php echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION); ?></h1>
</center> </center>
<br /> <br />
<div class="warning"><?php echo $GLOBALS['strWrongUser']; ?></div>
<?php if (file_exists('./config.footer.inc.php')) { <?php
require './config.footer.inc.php'; PMA_Message::error('strWrongUser')->display();
}
?> if (file_exists('./config.footer.inc.php')) {
require './config.footer.inc.php';
}
?>
</body> </body>
</html> </html>

View File

@@ -15,11 +15,12 @@ if ($GLOBALS['cfg']['DBG']['enable']) {
* Loads the DBG extension if needed * Loads the DBG extension if needed
*/ */
if (! @extension_loaded('dbg') && ! PMA_dl('dbg')) { if (! @extension_loaded('dbg') && ! PMA_dl('dbg')) {
echo '<div class="warning">' $message = PMA_Message::error('strCantLoad');
.sprintf($GLOBALS['strCantLoad'], 'DBG') $message->addParam('DBG');
.' <a href="./Documentation.html#faqdbg" target="documentation">' $message->addMessage('<a href="./Documentation.html#faqdbg" target="documentation">');
.$GLOBALS['strDocu'] . '</a>' $message->addString('strDocu');
.'</div>'; $message->addMessage('</a>');
$message->display();
} else { } else {
$GLOBALS['DBG'] = true; $GLOBALS['DBG'] = true;
} }

View File

@@ -36,23 +36,22 @@ echo PMA_pluginGetJavascript($import_list);
<fieldset class="options"> <fieldset class="options">
<legend><?php echo $strFileToImport; ?></legend> <legend><?php echo $strFileToImport; ?></legend>
<?php <?php
if ($GLOBALS['is_upload']) { if ($GLOBALS['is_upload']) {
?> ?>
<div class="formelementrow"> <div class="formelementrow">
<label for="input_import_file"><?php echo $strLocationTextfile; ?></label> <label for="input_import_file"><?php echo $strLocationTextfile; ?></label>
<input style="margin: 5px" type="file" name="import_file" id="input_import_file" onchange="match_file(this.value);" /> <input style="margin: 5px" type="file" name="import_file" id="input_import_file" onchange="match_file(this.value);" />
<?php <?php
echo PMA_displayMaximumUploadSize($max_upload_size) . "\n"; echo PMA_displayMaximumUploadSize($max_upload_size) . "\n";
// some browsers should respect this :) // some browsers should respect this :)
echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n"; echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n";
} else { ?>
echo '<div class="warning">' . "\n";
echo $strUploadsNotAllowed . "\n";
}
?>
</div> </div>
<?php <?php
} else {
PMA_Message::warning('strUploadsNotAllowed')->display();
}
if (!empty($cfg['UploadDir'])) { if (!empty($cfg['UploadDir'])) {
$extensions = ''; $extensions = '';
foreach ($import_list as $key => $val) { foreach ($import_list as $key => $val) {
@@ -66,10 +65,7 @@ if (!empty($cfg['UploadDir'])) {
$files = PMA_getFileSelectOptions(PMA_userDir($cfg['UploadDir']), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : ''); $files = PMA_getFileSelectOptions(PMA_userDir($cfg['UploadDir']), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : '');
echo '<div class="formelementrow">' . "\n"; echo '<div class="formelementrow">' . "\n";
if ($files === FALSE) { if ($files === FALSE) {
echo ' <div class="warning">' . "\n"; PMA_Message::error('strWebServerUploadDirectoryError')->display();
echo ' <strong>' . $strError . '</strong>: ' . "\n";
echo ' ' . $strWebServerUploadDirectoryError . "\n";
echo ' </div>' . "\n";
} elseif (!empty($files)) { } elseif (!empty($files)) {
echo "\n"; echo "\n";
echo ' <i>' . $strOr . '</i><br/><label for="select_local_import_file">' . $strWebServerUploadDirectory . '</label>&nbsp;: ' . "\n"; echo ' <i>' . $strOr . '</i><br/><label for="select_local_import_file">' . $strWebServerUploadDirectory . '</label>&nbsp;: ' . "\n";

View File

@@ -106,10 +106,9 @@ function PMA_check_indexes($idx_collection)
reset($while_index); reset($while_index);
$first_column = current($while_index); $first_column = current($while_index);
$output .= '<div class="warning">'; $message = PMA_Message::warning('strIndexesSeemEqual');
$output .= $GLOBALS['strIndexesSeemEqual'] . ' '; $message->addMessage($each_index_name . ', ' . $first_column['Key_name']);
$output .= $each_index_name . ', ' . $first_column['Key_name']; $output .= $message->getDisplay();
$output .= '</div>';
// there is no need to check any further indexes if we have already // there is no need to check any further indexes if we have already
// found that this one has a duplicate // found that this one has a duplicate

View File

@@ -328,9 +328,9 @@ if (window.parent.openDb(\'' . PMA_jsFormat($current['SCHEMA_NAME'], false) . '\
.' title="' . $strDatabasesStatsDisable . '">' . "\n" .' title="' . $strDatabasesStatsDisable . '">' . "\n"
.' ' . $strDatabasesStatsDisable; .' ' . $strDatabasesStatsDisable;
} }
echo '</a></strong><br />' . "\n" echo '</a></strong><br />' . "\n";
.' <div class="warning">' PMA_Message::warning('strDatabasesStatsHeavyTraffic')->display();
. $strDatabasesStatsHeavyTraffic . '</div></li>' . "\n" echo '</li>' . "\n"
.'</ul>' . "\n"; .'</ul>' . "\n";
echo '</form>'; echo '</form>';
} else { } else {

View File

@@ -309,7 +309,9 @@ elseif (!defined('PMA_IDX_INCLUDED')
<br class="clearfloat" /> <br class="clearfloat" />
<div class="warning"><?php echo $strPrimaryKeyWarning; ?></div> <?php
PMA_Message::warning('strPrimaryKeyWarning')->display();
?>
<table> <table>
<thead> <thead>
@@ -441,8 +443,9 @@ elseif (!defined('PMA_IDX_INCLUDED')
else { else {
// none indexes // none indexes
echo '<tbody>' echo '<tbody>'
.'<tr><td colspan="7"><div class="warning">' . $strNoIndex .'<tr><td colspan="7">';
.'</div></td></tr>' . "\n"; PMA_Message::warning('strNoIndex')->display();
echo '</td></tr>' . "\n";
} }
?> ?>

View File

@@ -220,8 +220,10 @@ if (isset($_REQUEST['destination_innodb'])) {
echo PMA_showMySQLDocu('manual_Table_types', 'InnoDB_foreign_key_constraints') . "\n"; echo PMA_showMySQLDocu('manual_Table_types', 'InnoDB_foreign_key_constraints') . "\n";
} }
if (substr($tmp_error, 1, 4) == '1005') { if (substr($tmp_error, 1, 4) == '1005') {
echo '<p class="warning">' . $strForeignKeyError . ' : ' . $master_field $message = PMA_Message::warning('strForeignKeyError');
.'</p>' . PMA_showMySQLDocu('manual_Table_types', 'InnoDB_foreign_key_constraints') . "\n"; $message->addMessage(htmlspecialchars($master_field), ' : ');
$message->display();
echo PMA_showMySQLDocu('manual_Table_types', 'InnoDB_foreign_key_constraints') . "\n";
} }
unset($tmp_error); unset($tmp_error);
$sql_query = ''; $sql_query = '';