diff --git a/CRM/Admin/Page/MessageTemplates.php b/CRM/Admin/Page/MessageTemplates.php index 3363ac410fbc..36d52d56b43e 100644 --- a/CRM/Admin/Page/MessageTemplates.php +++ b/CRM/Admin/Page/MessageTemplates.php @@ -274,6 +274,11 @@ public function browse() { $this->assign('canEditSystemTemplates', CRM_Core_Permission::check('edit system workflow message templates')); $this->assign('canEditMessageTemplates', CRM_Core_Permission::check('edit message templates')); $this->assign('canEditUserDrivenMessageTemplates', CRM_Core_Permission::check('edit user-driven message templates')); + Civi::resources() + ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header') + ->addSetting([ + 'tabSettings' => ['active' => $_GET['selectedChild'] ?? NULL], + ]); } } diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 8c49fee8a533..6d67ce875fe0 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -2693,6 +2693,7 @@ public function setSelectedChild($default = NULL) { if (!empty($selectedChild)) { $this->set('selectedChild', $selectedChild); $this->assign('selectedChild', $selectedChild); + Civi::resources()->addSetting(['tabSettings' => ['active' => $selectedChild]]); } } diff --git a/templates/CRM/Admin/Page/MessageTemplates.tpl b/templates/CRM/Admin/Page/MessageTemplates.tpl index b60355dede5c..0adf34c5b185 100644 --- a/templates/CRM/Admin/Page/MessageTemplates.tpl +++ b/templates/CRM/Admin/Page/MessageTemplates.tpl @@ -157,7 +157,6 @@ {/foreach} -{include file="CRM/common/TabHeader.tpl"} {elseif $action ne 1 and $action ne 2 and $action ne 4 and $action ne 8}
{* crm-content-block ends here *} -{include file="CRM/common/TabSelected.tpl" defaultTab="settings"} diff --git a/templates/CRM/common/TabSelected.tpl b/templates/CRM/common/TabSelected.tpl index 2b32581b8528..573d5ae7c2b1 100644 --- a/templates/CRM/common/TabSelected.tpl +++ b/templates/CRM/common/TabSelected.tpl @@ -1,3 +1,4 @@ +{* DEPRECATED script, should be refactored out and removed *}