Add weight to premium config (tab on contribution page edit)
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 20 Nov 2023 22:33:40 +0000 (11:33 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 20 Nov 2023 22:33:40 +0000 (11:33 +1300)
CRM/Contribute/Page/Premium.php

index 72cc941defd1358a74afb134b09cf882e04f12fd..98c50a73d62e73fad1e83ee5c5094bf2d682ca26 100644 (file)
@@ -54,12 +54,14 @@ class CRM_Contribute_Page_Premium extends CRM_Core_Page_Basic {
           'url' => 'civicrm/admin/contribute/addProductToPage',
           'qs' => 'action=update&id=%%id%%&pid=%%pid%%&reset=1',
           'title' => ts('Edit Premium'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::UPDATE),
         ],
         CRM_Core_Action::PREVIEW => [
           'name' => ts('Preview'),
           'url' => 'civicrm/admin/contribute/addProductToPage',
           'qs' => 'action=preview&id=%%id%%&pid=%%pid%%',
           'title' => ts('Preview Premium'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::PREVIEW),
         ],
         CRM_Core_Action::DELETE => [
           'name' => ts('Remove'),
@@ -67,6 +69,7 @@ class CRM_Contribute_Page_Premium extends CRM_Core_Page_Basic {
           'qs' => 'action=delete&id=%%id%%&pid=%%pid%%',
           'extra' => 'onclick = "if (confirm(\'' . $deleteExtra . '\') ) this.href+=\'&amp;confirmed=1\'; else return false;"',
           'title' => ts('Disable Premium'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::DELETE),
         ],
       ];
     }
@@ -142,7 +145,7 @@ class CRM_Contribute_Page_Premium extends CRM_Core_Page_Basic {
 
         $action = array_sum(array_keys($this->links()));
 
-        $premiums[$premiumsProductDao->product_id]['action'] = CRM_Core_Action::formLink(self::links(), $action,
+        $premiums[$premiumsProductDao->product_id]['action'] = CRM_Core_Action::formLink($this->links(), $action,
           ['id' => $pageID, 'pid' => $premiumsProductDao->id],
           ts('more'),
           FALSE,