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
CONST MENU_ITEM = 1;
/**
+ * This function fetches the menu items from xml and xmlMenu hooks
+ *
+ * @param boolen $fetchFromXML fetch the menu items from xml and not from cache
+ *
* @return array
*/
- static function &xmlItems() {
- if (!self::$_items) {
+ static function &xmlItems($fetchFromXML = FALSE) {
+ if (!self::$_items || $fetchFromXML) {
$config = CRM_Core_Config::singleton();
// We needs this until Core becomes a component
}
/**
- * @param $name
+ * @param string $name
* @param $menu
*
* @throws Exception
/**
* This function defines information for various menu items
*
+ * @param boolen $fetchFromXML fetch the menu items from xml and not from cache
+ *
* @static
* @access public
*/
- static function &items() {
- return self::xmlItems();
+ static function &items($fetchFromXML = FALSE) {
+ return self::xmlItems($fetchFromXML);
}
/**
}
/**
+ * This function recomputes menu from xml and populates civicrm_menu
* @param bool $truncate
*/
static function store($truncate = TRUE) {
$query = 'TRUNCATE civicrm_menu';
CRM_Core_DAO::executeQuery($query);
}
- $menuArray = self::items();
+ $menuArray = self::items($truncate);
self::build($menuArray);
',' => '_', '/' => '_',
)
),
- 'url' => CRM_Utils_System::url($path, $query, FALSE),
+ 'url' => CRM_Utils_System::url($path, $query,
+ FALSE, // absolute
+ NULL, // fragment
+ TRUE, // htmlize
+ FALSE, // frontend
+ TRUE // forceBackend; CRM-14439 work-around; acceptable for now because we don't display breadcrumbs on frontend
+ ),
'icon' => CRM_Utils_Array::value('icon', $item),
'extra' => CRM_Utils_Array::value('extra', $item),
);
$args = array();
$elements = explode(',', $pathArgs);
- //CRM_Core_Error::debug( 'e', $elements );
foreach ($elements as $keyVal) {
list($key, $val) = explode('=', $keyVal, 2);
$arr[$key] = $val;