Metadata: Add html:label for Contribution Status ID
[civicrm-core.git] / CRM / Admin / Page / Admin.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * Page for displaying Administer CiviCRM Control Panel.
20 */
21 class CRM_Admin_Page_Admin extends CRM_Core_Page {
22
23 /**
24 * Run page.
25 *
26 * @return string
27 */
28 public function run() {
29 Civi::resources()->addStyleFile('civicrm', 'css/admin.css');
30
31 $this->assign('registerSite', htmlspecialchars('https://civicrm.org/register-your-site?src=iam&sid=' . CRM_Utils_System::getSiteID()));
32
33 $groups = [
34 'Customize Data and Screens' => ts('Customize Data and Screens'),
35 'Communications' => ts('Communications'),
36 'Localization' => ts('Localization'),
37 'Users and Permissions' => ts('Users and Permissions'),
38 'System Settings' => ts('System Settings'),
39 ];
40
41 $config = CRM_Core_Config::singleton();
42
43 foreach ($config->enableComponents as $component) {
44 $comp = CRM_Core_Component::get($component);
45 $groups[$comp->info['name']] = $comp->info['translatedName'];
46 }
47
48 $values = CRM_Core_Menu::getAdminLinks();
49
50 foreach ($groups as $group => $title) {
51 $groupId = str_replace(' ', '_', $group);
52 $adminPanel[$groupId] = array_merge($values[$group] ?? [], ['title' => $title]);
53 }
54
55 CRM_Utils_Hook::alterAdminPanel($adminPanel);
56 foreach ($adminPanel as $groupId => $group) {
57 if (count($group) == 1) {
58 // Presumably the only thing is the title; remove the section.
59 // This is done here to give the hook a chance to edit the section.
60 unset($adminPanel[$groupId]);
61 }
62 }
63 $this->assign('adminPanel', $adminPanel);
64 return parent::run();
65 }
66
67 }