From 48fe48a68635745a90eb785d40930a575424a283 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Fri, 27 Nov 2015 16:41:17 +0530 Subject: [PATCH] CRM-13678 - Make tabset hook generic --- CRM/Contact/Page/View/Summary.php | 3 ++- CRM/Contribute/Form/ContributionPage/TabHeader.php | 1 + CRM/Contribute/Page/ContributionPage.php | 5 +++++ CRM/Utils/Hook.php | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index eac81adab9..877a871a1a 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -389,8 +389,9 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { $weight += 10; } + $context = array('contact_id' => $this->_contactId); // see if any other modules want to add any tabs - CRM_Utils_Hook::tabs($allTabs, $this->_contactId); + CRM_Utils_Hook::tabset('civicrm/contact/view', $allTabs, $context); // now sort the tabs based on weight usort($allTabs, array('CRM_Utils_Sort', 'cmpFunc')); diff --git a/CRM/Contribute/Form/ContributionPage/TabHeader.php b/CRM/Contribute/Form/ContributionPage/TabHeader.php index 1bcbf3abfe..7cd255ea25 100644 --- a/CRM/Contribute/Form/ContributionPage/TabHeader.php +++ b/CRM/Contribute/Form/ContributionPage/TabHeader.php @@ -134,6 +134,7 @@ class CRM_Contribute_Form_ContributionPage_TabHeader { ); $contribPageId = $form->getVar('_id'); + CRM_Utils_Hook::tabset('civicrm/admin/contribute', $tabs, array('contribution_page_id' => $contribPageId)); $fullName = $form->getVar('_name'); $className = CRM_Utils_String::getClassName($fullName); diff --git a/CRM/Contribute/Page/ContributionPage.php b/CRM/Contribute/Page/ContributionPage.php index a133520f24..8c15d2f54c 100644 --- a/CRM/Contribute/Page/ContributionPage.php +++ b/CRM/Contribute/Page/ContributionPage.php @@ -182,6 +182,11 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page { 'uniqueName' => 'pcp', ), ); + $context = array( + 'urlString' => $urlString, + 'urlParams' => $urlParams + ); + CRM_Utils_Hook::tabset('civicrm/admin/contribute', self::$_configureActionLinks, $context); } return self::$_configureActionLinks; diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 242a7b4d37..39eee8a03b 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -640,6 +640,7 @@ abstract class CRM_Utils_Hook { * The contactID for whom the dashboard is being rendered. * * @return null + * @deprecated Use tabset() instead. */ public static function tabs(&$tabs, $contactID) { return self::singleton()->invoke(2, $tabs, $contactID, -- 2.25.1