X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FComponent%2FInfo.php;h=a7548f46fcd3a37d8af95b6f3d9bc663c34fde65;hb=72b3a70c5e7890c69dd70bf00092e1217c5f15b7;hp=63f5089c0327e330e948bba208e094ff3b40b872;hpb=d44c681d9105af668449d16d9f53832d7982f47e;p=civicrm-core.git diff --git a/CRM/Core/Component/Info.php b/CRM/Core/Component/Info.php index 63f5089c03..a7548f46fc 100644 --- a/CRM/Core/Component/Info.php +++ b/CRM/Core/Component/Info.php @@ -1,7 +1,7 @@ name = $name; - $this->namespace = $namespace; + $this->name = $name; + $this->namespace = $namespace; $this->componentID = $componentID; - $this->info = $this->getInfo(); + $this->info = $this->getInfo(); $this->info['url'] = $this->getKeyword(); } /** * EXPERIMENTAL: Get a list of AngularJS modules * - * @return array list of modules; same format as CRM_Utils_Hook::angularModules(&$angularModules) + * @return array + * list of modules; same format as CRM_Utils_Hook::angularModules(&$angularModules) * @see CRM_Utils_Hook::angularModules */ public function getAngularModules() { @@ -125,16 +127,16 @@ abstract class CRM_Core_Component_Info { * Needs to be implemented in component's information * class. * - * @return array collection of required component settings - * @access public - * + * @return array + * collection of required component settings */ abstract public function getInfo(); /** * Get a list of entities to register via API * - * @return array list of entities; same format as CRM_Utils_Hook::managedEntities(&$entities) + * @return array + * list of entities; same format as CRM_Utils_Hook::managedEntities(&$entities) * @see CRM_Utils_Hook::managedEntities */ public function getManagedEntities() { @@ -144,7 +146,8 @@ abstract class CRM_Core_Component_Info { /** * Provides permissions that are unwise for Anonymous Roles to have * - * @return array list of permissions + * @return array + * list of permissions * @see CRM_Component_Info::getPermissions */ public function getAnonymousPermissionWarnings() { @@ -161,16 +164,18 @@ abstract class CRM_Core_Component_Info { * * @param bool $getAllUnconditionally * - * @return array|null collection of permissions, null if none - * @access public + * @return array|null + * collection of permissions, null if none */ abstract public function getPermissions($getAllUnconditionally = FALSE); /** * Determine how many other records refer to a given record * - * @param CRM_Core_DAO $dao the item for which we want a reference count - * @return array each item in the array is an array with keys: + * @param CRM_Core_DAO $dao + * The item for which we want a reference count. + * @return array + * each item in the array is an array with keys: * - name: string, eg "sql:civicrm_email:contact_id" * - type: string, eg "sql" * - count: int, eg "5" if there are 5 email addresses that refer to $dao @@ -183,10 +188,9 @@ abstract class CRM_Core_Component_Info { * Provides information about user dashboard element * offered by this component. * - * @return array|null collection of required dashboard settings, + * @return array|null + * collection of required dashboard settings, * null if no element offered - * @access public - * */ abstract public function getUserDashboardElement(); @@ -194,10 +198,9 @@ abstract class CRM_Core_Component_Info { * Provides information about user dashboard element * offered by this component. * - * @return array|null collection of required dashboard settings, + * @return array|null + * collection of required dashboard settings, * null if no element offered - * @access public - * */ abstract public function registerTab(); @@ -205,10 +208,9 @@ abstract class CRM_Core_Component_Info { * Provides information about advanced search pane * offered by this component. * - * @return array|null collection of required pane settings, + * @return array|null + * collection of required pane settings, * null if no element offered - * @access public - * */ abstract public function registerAdvancedSearchPane(); @@ -218,9 +220,8 @@ abstract class CRM_Core_Component_Info { * Needs to be implemented in component's information * class. * - * @return array|null collection of activity types - * @access public - * + * @return array|null + * collection of activity types */ abstract public function getActivityTypes(); @@ -228,9 +229,8 @@ abstract class CRM_Core_Component_Info { * Provides information whether given component is currently * marked as enabled in configuration. * - * @return boolean true if component is enabled, false if not - * @access public - * + * @return boolean + * true if component is enabled, false if not */ public function isEnabled() { $config = CRM_Core_Config::singleton(); @@ -243,9 +243,8 @@ abstract class CRM_Core_Component_Info { /** * Provides component's configuration object. * - * @return mixed component's configuration object - * @access public - * + * @return mixed + * component's configuration object */ public function getConfigObject() { return $this->_instantiate(self::COMPONENT_CONFIG_CLASS); @@ -254,9 +253,8 @@ abstract class CRM_Core_Component_Info { /** * Provides component's menu definition object. * - * @return mixed component's menu definition object - * @access public - * + * @return mixed + * component's menu definition object */ public function getMenuObject() { return $this->_instantiate(self::COMPONENT_MENU_CLASS); @@ -265,9 +263,8 @@ abstract class CRM_Core_Component_Info { /** * Provides component's invocation object. * - * @return mixed component's invocation object - * @access public - * + * @return mixed + * component's invocation object */ public function getInvokeObject() { return $this->_instantiate(self::COMPONENT_INVOKE_CLASS); @@ -276,9 +273,8 @@ abstract class CRM_Core_Component_Info { /** * Provides component's BAO Query object. * - * @return mixed component's BAO Query object - * @access public - * + * @return mixed + * component's BAO Query object */ public function getBAOQueryObject() { return $this->_instantiate(self::COMPONENT_BAO_QUERY_CLASS); @@ -286,9 +282,6 @@ abstract class CRM_Core_Component_Info { /** * Builds advanced search form's component specific pane. - * - * @access public - * */ public function buildAdvancedSearchPaneForm(&$form) { $bao = $this->getBAOQueryObject(); @@ -298,9 +291,8 @@ abstract class CRM_Core_Component_Info { /** * Provides component's user dashboard page object. * - * @return mixed component's User Dashboard applet object - * @access public - * + * @return mixed + * component's User Dashboard applet object */ public function getUserDashboardObject() { return $this->_instantiate(self::COMPONENT_USERDASHBOARD_CLASS); @@ -309,9 +301,8 @@ abstract class CRM_Core_Component_Info { /** * Provides component's contact record tab object. * - * @return mixed component's contact record tab object - * @access public - * + * @return mixed + * component's contact record tab object */ public function getTabObject() { return $this->_instantiate(self::COMPONENT_TAB_CLASS); @@ -320,9 +311,8 @@ abstract class CRM_Core_Component_Info { /** * Provides component's advanced search pane's template path. * - * @return string component's advanced search pane's template path - * @access public - * + * @return string + * component's advanced search pane's template path */ public function getAdvancedSearchPaneTemplatePath() { $fullpath = $this->namespace . '_' . self::COMPONENT_ADVSEARCHPANE_CLASS; @@ -332,9 +322,8 @@ abstract class CRM_Core_Component_Info { /** * Provides information whether given component uses system wide search. * - * @return boolean true if component needs search integration - * @access public - * + * @return boolean + * true if component needs search integration */ public function usesSearch() { return $this->info['search'] ? TRUE : FALSE; @@ -343,9 +332,8 @@ abstract class CRM_Core_Component_Info { /** * Provides the xml menu files * - * @return array array of menu files - * @access public - * + * @return array + * array of menu files */ public function menuFiles() { return CRM_Utils_File::getFilesByExtension($this->_getMenuXMLPath(), 'xml'); @@ -356,9 +344,8 @@ abstract class CRM_Core_Component_Info { * FIXME: It should be protected so the keyword is not * FIXME: accessed from beyond component infrastructure. * - * @return string component keyword - * @access public - * + * @return string + * component keyword */ public function getKeyword() { return $this->keyword; @@ -367,9 +354,8 @@ abstract class CRM_Core_Component_Info { /** * Helper for figuring out menu XML file location. * - * @return mixed component's element as class instance - * @access private - * + * @return mixed + * component's element as class instance */ private function _getMenuXMLPath() { global $civicrm_root; @@ -382,13 +368,12 @@ abstract class CRM_Core_Component_Info { * * @param $cl * - * @return mixed component's element as class instance - * @access private + * @return mixed + * component's element as class instance */ private function _instantiate($cl) { $className = $this->namespace . '_' . $cl; - require_once (str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'); + require_once str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; return new $className(); } } -