3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * Page for displaying Administer CiviCRM Control Panel.
21 class CRM_Admin_Page_Admin
extends CRM_Core_Page
{
28 public function run() {
29 Civi
::resources()->addStyleFile('civicrm', 'css/admin.css');
32 'Customize Data and Screens' => ts('Customize Data and Screens'),
33 'Communications' => ts('Communications'),
34 'Localization' => ts('Localization'),
35 'Users and Permissions' => ts('Users and Permissions'),
36 'System Settings' => ts('System Settings'),
39 $config = CRM_Core_Config
::singleton();
41 foreach ($config->enableComponents
as $component) {
42 $comp = CRM_Core_Component
::get($component);
43 $groups[$comp->info
['name']] = $comp->info
['translatedName'];
46 $values = CRM_Core_Menu
::getAdminLinks();
48 foreach ($groups as $group => $title) {
49 $groupId = str_replace(' ', '_', $group);
50 $adminPanel[$groupId] = array_merge($values[$group] ??
[], ['title' => $title]);
53 CRM_Utils_Hook
::alterAdminPanel($adminPanel);
54 foreach ($adminPanel as $groupId => $group) {
55 if (count($group) == 1) {
56 // Presumably the only thing is the title; remove the section.
57 // This is done here to give the hook a chance to edit the section.
58 unset($adminPanel[$groupId]);
61 $this->assign('adminPanel', $adminPanel);