Author: sevein
Date: Sun Oct 10 10:06:50 2010
New Revision: 8043

Log:
Cosmetic changes.

Modified:
   trunk/lib/model/QubitMenu.php

Modified: trunk/lib/model/QubitMenu.php
==============================================================================
--- trunk/lib/model/QubitMenu.php       Sun Oct 10 09:39:27 2010        (r8042)
+++ trunk/lib/model/QubitMenu.php       Sun Oct 10 10:06:50 2010        (r8043)
@@ -19,24 +19,22 @@
 
 class QubitMenu extends BaseMenu
 {
-  // The following Menu ids are assigned constant values because they are used
-  // in application code and can't rely on database id values, since these 
could
-  // be changed
-
-  // Root menu
-  const ROOT_ID = 1;
-
-  // 2nd generation constant ids
-  const MAIN_MENU_ID = 2;
-  const QUICK_LINKS_ID  = 3;
-  const BROWSE_ID = 4;
-
-  // 3rd generation constant ids
-  const ADD_EDIT_ID = 5;
-  const TAXONOMY_ID = 6;
-  const IMPORT_ID = 7;
-  const TRANSLATE_ID = 8;
-  const ADMIN_ID = 9;
+  const
+
+    // Root menu
+    ROOT_ID = 1,
+
+    // 2nd generation constant ids
+    MAIN_MENU_ID = 2,
+    QUICK_LINKS_ID  = 3,
+    BROWSE_ID = 4,
+
+    // 3rd generation constant ids
+    ADD_EDIT_ID = 5,
+    TAXONOMY_ID = 6,
+    IMPORT_ID = 7,
+    TRANSLATE_ID = 8,
+    ADMIN_ID = 9;
 
   /**
    * Wrapper for BaseMenu::getPath() call to allow additional functionality
@@ -93,11 +91,12 @@
    */
   public function isProtected()
   {
-    return $this->getId() == QubitMenu::ROOT_ID ||
-    $this->getId() == QubitMenu::MAIN_MENU_ID ||
-    $this->getId() == QubitMenu::QUICK_LINKS_ID ||
-    $this->getId() == QubitMenu::ADD_EDIT_ID ||
-    $this->getId() == QubitMenu::ADMIN_ID;
+    return in_array($this->id, array(
+      QubitMenu::ROOT_ID,
+      QubitMenu::MAIN_MENU_ID,
+      QubitMenu::QUICK_LINKS_ID,
+      QubitMenu::ADD_EDIT_ID,
+      QubitMenu::ADMIN_ID));
   }
 
   /**

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to