The `xmlMenu` hook requires a literal XML file. The `alterMenu` exposes the
live data structure, so that you can more easily mix in data from other
sources.
foreach ($files as $file) {
self::read($file, self::$_items);
}
+
+ CRM_Utils_Hook::alterMenu(self::$_items);
}
return self::$_items;
);
}
+ /**
+ * (Experimental) This hook is called when build the menu table.
+ *
+ * @param array $items
+ * List of records to include in menu table.
+ * @return null
+ * the return value is ignored
+ */
+ public static function alterMenu(&$items) {
+ return self::singleton()->invoke(1, $items,
+ self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+ 'civicrm_alterMenu'
+ );
+ }
+
/**
* This hook is called for declaring managed entities via API.
*