Skip to content

Commit

Permalink
Merge pull request #14616 from mattwire/contributionpage_tabset_cleanup
Browse files Browse the repository at this point in the history
REF Simple cleanup of tabset code for contributionpages
  • Loading branch information
eileenmcnaughton authored Jul 7, 2019
2 parents d66bdc3 + a8b477f commit c5295cd
Showing 1 changed file with 17 additions and 45 deletions.
62 changes: 17 additions & 45 deletions CRM/Contribute/Form/ContributionPage/TabHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,73 +68,45 @@ public static function process(&$form) {
return NULL;
}

$default = [
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
'current' => FALSE,
];

$tabs = [
'settings' => [
'title' => ts('Title'),
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
'current' => FALSE,
],
] + $default,
'amount' => [
'title' => ts('Amounts'),
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
'current' => FALSE,
],
] + $default,
'membership' => [
'title' => ts('Memberships'),
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
'current' => FALSE,
],
] + $default,
'thankyou' => [
'title' => ts('Receipt'),
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
'current' => FALSE,
],
] + $default,
'friend' => [
'title' => ts('Tell a Friend'),
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
'current' => FALSE,
],
] + $default,
'custom' => [
'title' => ts('Profiles'),
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
'current' => FALSE,
],
] + $default,
'premium' => [
'title' => ts('Premiums'),
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
'current' => FALSE,
],
] + $default,
'widget' => [
'title' => ts('Widgets'),
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
'current' => FALSE,
],
] + $default,
'pcp' => [
'title' => ts('Personal Campaigns'),
'link' => NULL,
'valid' => FALSE,
'active' => FALSE,
'current' => FALSE,
],
] + $default,
];

$contribPageId = $form->getVar('_id');
// Call tabset hook to add/remove custom tabs
CRM_Utils_Hook::tabset('civicrm/admin/contribute', $tabs, ['contribution_page_id' => $contribPageId]);
$fullName = $form->getVar('_name');
$className = CRM_Utils_String::getClassName($fullName);
Expand Down

0 comments on commit c5295cd

Please sign in to comment.