[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_0RC2-655-g73c57b0

Marc Delisle lem9 at users.sourceforge.net
Wed May 4 01:05:34 CEST 2011


The branch, master has been updated
       via  73c57b099e8b2d2c99fcb4d0888dcc40f4dd366a (commit)
      from  b2b1953db11219b5ac801ab58c3ecff2cfbb7f29 (commit)


- Log -----------------------------------------------------------------
commit 73c57b099e8b2d2c99fcb4d0888dcc40f4dd366a
Author: Marc Delisle <marc at infomarc.info>
Date:   Tue May 3 19:05:24 2011 -0400

    Continue to replace warning level with error level

-----------------------------------------------------------------------

Summary of changes:
 libraries/Index.class.php        |    4 ++--
 libraries/Message.class.php      |   19 -------------------
 libraries/common.lib.php         |    2 +-
 libraries/display_import.lib.php |    2 +-
 tbl_operations.php               |    2 +-
 tbl_replace.php                  |    2 +-
 tbl_structure.php                |    2 +-
 test/PMA_Message_test.php        |   11 +----------
 view_operations.php              |    2 +-
 9 files changed, 9 insertions(+), 37 deletions(-)

diff --git a/libraries/Index.class.php b/libraries/Index.class.php
index 6fc0bec..ee266aa 100644
--- a/libraries/Index.class.php
+++ b/libraries/Index.class.php
@@ -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();
diff --git a/libraries/Message.class.php b/libraries/Message.class.php
index 5c46e86..3064868 100644
--- a/libraries/Message.class.php
+++ b/libraries/Message.class.php
@@ -424,25 +424,6 @@ class PMA_Message
     }
 
     /**
-     * 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
      *
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 3161132..4969463 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -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']) . '"';
     }
 
diff --git a/libraries/display_import.lib.php b/libraries/display_import.lib.php
index 53a9351..3a9c2ea 100644
--- a/libraries/display_import.lib.php
+++ b/libraries/display_import.lib.php
@@ -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)
diff --git a/tbl_operations.php b/tbl_operations.php
index 04f1165..28530da 100644
--- a/tbl_operations.php
+++ b/tbl_operations.php
@@ -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);
diff --git a/tbl_replace.php b/tbl_replace.php
index 0abe124..40d0ad4 100644
--- a/tbl_replace.php
+++ b/tbl_replace.php
@@ -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);
diff --git a/tbl_structure.php b/tbl_structure.php
index fce4f39..99ec0e9 100644
--- a/tbl_structure.php
+++ b/tbl_structure.php
@@ -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>
diff --git a/test/PMA_Message_test.php b/test/PMA_Message_test.php
index e3a4492..27e4b7f 100644
--- a/test/PMA_Message_test.php
+++ b/test/PMA_Message_test.php
@@ -156,21 +156,12 @@ 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
      */
     public function testIsError()
diff --git a/view_operations.php b/view_operations.php
index 55d1c74..4a315d0 100644
--- a/view_operations.php
+++ b/view_operations.php
@@ -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);


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list