Skip to content

Commit

Permalink
Merge pull request #21086 from colemanw/removeUnusedCode
Browse files Browse the repository at this point in the history
CRM_Core_Component - Remove unused code
  • Loading branch information
totten authored Aug 11, 2021
2 parents f60c30e + 89c997b commit d4da6b9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
21 changes: 0 additions & 21 deletions CRM/Core/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,24 +203,6 @@ public static function xmlMenu() {
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
*
Expand All @@ -231,9 +213,6 @@ public static function getComponentID($componentName) {
if (!empty($info[$componentName])) {
return $info[$componentName]->componentID;
}
else {
return;
}
}

/**
Expand Down
16 changes: 1 addition & 15 deletions CRM/Core/Component/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,20 +221,7 @@ abstract public function getActivityTypes();
*/
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);
}

/**
Expand Down Expand Up @@ -352,7 +339,6 @@ private function _getMenuXMLPath() {
*/
private function _instantiate($cl) {
$className = $this->namespace . '_' . $cl;
require_once str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
return new $className();
}

Expand Down

0 comments on commit d4da6b9

Please sign in to comment.