Continue to replace warning level with error level

This commit is contained in:
Marc Delisle
2011-05-03 19:05:24 -04:00
parent b2b1953db1
commit 73c57b099e
9 changed files with 9 additions and 37 deletions

View File

@@ -424,7 +424,7 @@ class PMA_Index
$indexes = PMA_Index::getFromTable($table, $schema);
if (count($indexes) < 1) {
return PMA_Message::warning(__('No index defined!'))->getDisplay();
return PMA_Message::error(__('No index defined!'))->getDisplay();
}
$r = '';
@@ -576,7 +576,7 @@ class PMA_Index
// did not find any difference
// so it makes no sense to have this two equal indexes
$message = PMA_Message::warning(__('The indexes %1$s and %2$s seem to be equal and one of them could possibly be removed.'));
$message = PMA_Message::error(__('The indexes %1$s and %2$s seem to be equal and one of them could possibly be removed.'));
$message->addParam($each_index->getName());
$message->addParam($while_index->getName());
$output .= $message->getDisplay();

View File

@@ -423,25 +423,6 @@ class PMA_Message
return $this->getNumber() === PMA_Message::NOTICE;
}
/**
* returns whether this message is a warning message or not
* and optionally makes this message a warning message
*
* @uses PMA_Message::WARNING
* @uses PMA_Message::setNumber()
* @uses PMA_Message::getNumber()
* @param boolean $set
* @return boolean whether this is a warning message or not
*/
public function isWarning($set = false)
{
if ($set) {
$this->setNumber(PMA_Message::WARNING);
}
return $this->getNumber() === PMA_Message::WARNING;
}
/**
* returns whether this message is an error message or not
* and optionally makes this message an error message

View File

@@ -1674,7 +1674,7 @@ function PMA_generate_html_tab($tab, $url_params = array())
}
if (!empty($tab['warning'])) {
$tab['class'] .= ' warning';
$tab['class'] .= ' error';
$tab['attr'] .= ' title="' . htmlspecialchars($tab['warning']) . '"';
}

View File

@@ -175,7 +175,7 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
$uid = uniqid("");
PMA_browseUploadFile($max_upload_size);
} else if (!$GLOBALS['is_upload']) {
PMA_Message::warning(__('File uploads are not allowed on this server.'))->display();
PMA_Message::notice(__('File uploads are not allowed on this server.'))->display();
} else if (!empty($cfg['UploadDir'])) {
PMA_selectUploadFile($import_list, $cfg['UploadDir']);
} // end if (web-server upload directory)

View File

@@ -228,7 +228,7 @@ if (isset($result) && empty($message_to_show)) {
if (! empty($warning_messages)) {
$_message = new PMA_Message;
$_message->addMessages($warning_messages);
$_message->isWarning(true);
$_message->isError(true);
unset($warning_messages);
}
PMA_showMessage($_message, $sql_query, $_type);

View File

@@ -414,7 +414,7 @@ if (! empty($warning_messages)) {
* the message
*/
$message->addMessages($warning_messages, '<br />');
$message->isWarning(true);
$message->isError(true);
}
if (! empty($error_messages)) {
$message->addMessages($error_messages);

View File

@@ -773,7 +773,7 @@ if ($cfg['ShowStats']) {
}
if (isset($free_size)) {
?>
<tr class="<?php echo ($odd_row = !$odd_row) ? 'odd' : 'even'; ?> warning">
<tr class="<?php echo ($odd_row = !$odd_row) ? 'odd' : 'even'; ?> error">
<th class="name"><?php echo __('Overhead'); ?></th>
<td class="value"><?php echo $free_size; ?></td>
<td class="unit"><?php echo $free_unit; ?></td>

View File

@@ -156,20 +156,11 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
public function testIsNotice()
{
$this->assertTrue($this->object->isNotice());
$this->object->isWarning(true);
$this->object->isError(true);
$this->assertFalse($this->object->isNotice());
$this->assertTrue($this->object->isNotice(true));
}
/**
* testing isWarning method
*/
public function testIsWarning()
{
$this->assertFalse($this->object->isWarning());
$this->assertTrue($this->object->isWarning(true));
}
/**
* testing isError method
*/

View File

@@ -64,7 +64,7 @@ if (isset($result)) {
if (! empty($warning_messages)) {
$_message = new PMA_Message;
$_message->addMessages($warning_messages);
$_message->isWarning(true);
$_message->isError(true);
unset($warning_messages);
}
PMA_showMessage($_message, $sql_query, $_type, $is_view = true);