Merge pull request #5446 from atif-shaikh/CRM-14105
[civicrm-core.git] / CRM / Core / Menu.php
index 65d8c1ceae81911503af872bfe94dea4854eabe4..02a288955259ca7f7ab574f56269051453891239 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  * This file contains the various menus of the CiviCRM module
@@ -42,18 +42,16 @@ require_once 'CRM/Core/I18n.php';
 class CRM_Core_Menu {
 
   /**
-   * The list of menu items
+   * The list of menu items.
    *
    * @var array
-   * @static
    */
   static $_items = NULL;
 
   /**
-   * The list of permissioned menu items
+   * The list of permissioned menu items.
    *
    * @var array
-   * @static
    */
   static $_permissionedItems = NULL;
 
@@ -69,7 +67,7 @@ class CRM_Core_Menu {
   const MENU_ITEM = 1;
 
   /**
-   * This function fetches the menu items from xml and xmlMenu hooks
+   * This function fetches the menu items from xml and xmlMenu hooks.
    *
    * @param boolen $fetchFromXML
    *   Fetch the menu items from xml and not from cache.
@@ -128,9 +126,12 @@ class CRM_Core_Menu {
         if (strpos($key, '_callback') &&
           strpos($value, '::')
         ) {
+          // FIXME Remove the rewrite at this level. Instead, change downstream call_user_func*($value)
+          // to call_user_func*(Civi\Core\Resolver::singleton()->get($value)).
           $value = explode('::', $value);
         }
         elseif ($key == 'access_arguments') {
+          // FIXME Move the permission parser to its own class (or *maybe* CRM_Core_Permission).
           if (strpos($value, ',') ||
             strpos($value, ';')
           ) {
@@ -161,12 +162,12 @@ class CRM_Core_Menu {
   }
 
   /**
-   * This function defines information for various menu items
+   * This function defines information for various menu items.
    *
    * @param boolen $fetchFromXML
    *   Fetch the menu items from xml and not from cache.
    *
-   * @static
+   * @return array
    */
   public static function &items($fetchFromXML = FALSE) {
     return self::xmlItems($fetchFromXML);
@@ -237,7 +238,7 @@ class CRM_Core_Menu {
   }
 
   /**
-   * We use this function to
+   * We use this function to.
    *
    * 1. Compute the breadcrumb
    * 2. Compute local tasks value if any
@@ -261,7 +262,7 @@ class CRM_Core_Menu {
   }
 
   /**
-   * This function recomputes menu from xml and populates civicrm_menu
+   * This function recomputes menu from xml and populates civicrm_menu.
    * @param bool $truncate
    */
   public static function store($truncate = TRUE) {
@@ -490,7 +491,6 @@ class CRM_Core_Menu {
    * @return array
    *   The breadcrumb for this path
    *
-   * @static
    */
   public static function buildBreadcrumb(&$menu, $path) {
     $crumbs = array();
@@ -749,4 +749,5 @@ UNION (
     }
     return $arr;
   }
+
 }