From: jitendrapurohit Date: Fri, 27 Nov 2015 11:11:17 +0000 (+0530) Subject: CRM-13678 - Make tabset hook generic X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=48fe48a68635745a90eb785d40930a575424a283;p=civicrm-core.git CRM-13678 - Make tabset hook generic --- 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,