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); $indexes = PMA_Index::getFromTable($table, $schema);
if (count($indexes) < 1) { if (count($indexes) < 1) {
return PMA_Message::warning(__('No index defined!'))->getDisplay(); return PMA_Message::error(__('No index defined!'))->getDisplay();
} }
$r = ''; $r = '';
@@ -576,7 +576,7 @@ class PMA_Index
// did not find any difference // did not find any difference
// so it makes no sense to have this two equal indexes // 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($each_index->getName());
$message->addParam($while_index->getName()); $message->addParam($while_index->getName());
$output .= $message->getDisplay(); $output .= $message->getDisplay();

View File

@@ -423,25 +423,6 @@ class PMA_Message
return $this->getNumber() === PMA_Message::NOTICE; 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 * returns whether this message is an error message or not
* and optionally makes this message an error message * 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'])) { if (!empty($tab['warning'])) {
$tab['class'] .= ' warning'; $tab['class'] .= ' error';
$tab['attr'] .= ' title="' . htmlspecialchars($tab['warning']) . '"'; $tab['attr'] .= ' title="' . htmlspecialchars($tab['warning']) . '"';
} }

View File

@@ -175,7 +175,7 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
$uid = uniqid(""); $uid = uniqid("");
PMA_browseUploadFile($max_upload_size); PMA_browseUploadFile($max_upload_size);
} else if (!$GLOBALS['is_upload']) { } 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'])) { } else if (!empty($cfg['UploadDir'])) {
PMA_selectUploadFile($import_list, $cfg['UploadDir']); PMA_selectUploadFile($import_list, $cfg['UploadDir']);
} // end if (web-server upload directory) } // end if (web-server upload directory)

View File

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

View File

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

View File

@@ -773,7 +773,7 @@ if ($cfg['ShowStats']) {
} }
if (isset($free_size)) { 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> <th class="name"><?php echo __('Overhead'); ?></th>
<td class="value"><?php echo $free_size; ?></td> <td class="value"><?php echo $free_size; ?></td>
<td class="unit"><?php echo $free_unit; ?></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() public function testIsNotice()
{ {
$this->assertTrue($this->object->isNotice()); $this->assertTrue($this->object->isNotice());
$this->object->isWarning(true); $this->object->isError(true);
$this->assertFalse($this->object->isNotice()); $this->assertFalse($this->object->isNotice());
$this->assertTrue($this->object->isNotice(true)); $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 * testing isError method
*/ */

View File

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