return $files;
}
- /**
- * @return array
- */
- public static function &menu() {
- $info = self::_info();
- $items = [];
- foreach ($info as $name => $comp) {
- $mnu = $comp->getMenuObject();
-
- $ret = $mnu->permissioned();
- $items = array_merge($items, $ret);
-
- $ret = $mnu->main($task);
- $items = array_merge($items, $ret);
- }
- return $items;
- }
-
/**
* @param string $componentName
*
if (!empty($info[$componentName])) {
return $info[$componentName]->componentID;
}
- else {
- return;
- }
}
/**
*/
public function isEnabled() {
$config = CRM_Core_Config::singleton();
- if (in_array($this->info['name'], $config->enableComponents)) {
- return TRUE;
- }
- return FALSE;
- }
-
- /**
- * Provides component's menu definition object.
- *
- * @return mixed
- * component's menu definition object
- */
- public function getMenuObject() {
- return $this->_instantiate(self::COMPONENT_MENU_CLASS);
+ return in_array($this->info['name'], $config->enableComponents, TRUE);
}
/**
*/
private function _instantiate($cl) {
$className = $this->namespace . '_' . $cl;
- require_once str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
return new $className();
}