addStyleFile('civicrm', 'css/admin.css'); $this->assign('registerSite', htmlspecialchars('https://civicrm.org/register-your-site?src=iam&sid=' . CRM_Utils_System::getSiteID())); $groups = array( 'Customize Data and Screens' => ts('Customize Data and Screens'), 'Communications' => ts('Communications'), 'Localization' => ts('Localization'), 'Users and Permissions' => ts('Users and Permissions'), 'System Settings' => ts('System Settings'), ); $config = CRM_Core_Config::singleton(); if (in_array('CiviContribute', $config->enableComponents)) { $groups['CiviContribute'] = ts('CiviContribute'); } if (in_array('CiviMember', $config->enableComponents)) { $groups['CiviMember'] = ts('CiviMember'); } if (in_array('CiviEvent', $config->enableComponents)) { $groups['CiviEvent'] = ts('CiviEvent'); } if (in_array('CiviMail', $config->enableComponents)) { $groups['CiviMail'] = ts('CiviMail'); } if (in_array('CiviCase', $config->enableComponents)) { $groups['CiviCase'] = ts('CiviCase'); } if (in_array('CiviReport', $config->enableComponents)) { $groups['CiviReport'] = ts('CiviReport'); } if (in_array('CiviCampaign', $config->enableComponents)) { $groups['CiviCampaign'] = ts('CiviCampaign'); } $values = CRM_Core_Menu::getAdminLinks(); $this->_showHide = new CRM_Core_ShowHideBlocks(); foreach ($groups as $group => $title) { $groupId = str_replace(' ', '_', $group); $this->_showHide->addShow("id_{$groupId}_show"); $this->_showHide->addHide("id_{$groupId}"); $v = CRM_Core_ShowHideBlocks::links($this, $groupId, '', '', FALSE); if (isset($values[$group])) { $adminPanel[$groupId] = $values[$group]; $adminPanel[$groupId]['show'] = $v['show']; $adminPanel[$groupId]['hide'] = $v['hide']; $adminPanel[$groupId]['title'] = $title; } else { $adminPanel[$groupId] = array(); $adminPanel[$groupId]['show'] = ''; $adminPanel[$groupId]['hide'] = ''; $adminPanel[$groupId]['title'] = $title; } } $this->assign('adminPanel', $adminPanel); $this->_showHide->addToTemplate(); return parent::run(); } }