From 8f4eb478a097df5bf696d0df30e772e29215e132 Mon Sep 17 00:00:00 2001 From: yashodha Date: Thu, 4 Jul 2019 16:06:07 +0530 Subject: [PATCH] (dev/core#1104) make admin panels hookable --- CRM/Admin/Page/Admin.php | 2 ++ CRM/Utils/Hook.php | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CRM/Admin/Page/Admin.php b/CRM/Admin/Page/Admin.php index f195b5d693..1c0fdc56ae 100644 --- a/CRM/Admin/Page/Admin.php +++ b/CRM/Admin/Page/Admin.php @@ -105,6 +105,8 @@ class CRM_Admin_Page_Admin extends CRM_Core_Page { $adminPanel[$groupId]['title'] = $title; } } + + CRM_Utils_Hook::alterAdminPanel($adminPanel); $this->assign('adminPanel', $adminPanel); $this->_showHide->addToTemplate(); return parent::run(); diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 2595679938..6b70eadf01 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -835,6 +835,21 @@ abstract class CRM_Utils_Hook { ); } + /** + * This hook allows modification of the admin panels + * + * @param array $panels + * Associated array of admin panels + * + * @return mixed + */ + public static function alterAdminPanel(&$panels) { + return self::singleton()->invoke(array('panels'), $panels, + self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, + 'civicrm_alterAdminPanel' + ); + } + /** * This hook is called when sending an email / printing labels to get the values for all the * tokens returned by the 'tokens' hook -- 2.25.1