Esempio n. 1
0
 static function &xmlItems()
 {
     if (!self::$_items) {
         $config = CRM_Core_Config::singleton();
         // We needs this until Core becomes a component
         $coreMenuFilesNamespace = 'CRM_Core_xml_Menu';
         $coreMenuFilesPath = str_replace('_', DIRECTORY_SEPARATOR, $coreMenuFilesNamespace);
         global $civicrm_root;
         $files = CRM_Utils_File::getFilesByExtension($civicrm_root . DIRECTORY_SEPARATOR . $coreMenuFilesPath, 'xml');
         // Grab component menu files
         $files = array_merge($files, CRM_Core_Component::xmlMenu());
         // lets call a hook and get any additional files if needed
         CRM_Utils_Hook::xmlMenu($files);
         self::$_items = array();
         foreach ($files as $file) {
             self::read($file, self::$_items);
         }
     }
     return self::$_items;
 }