Afform - Rename 'Forms' menu item to 'Form Builder'
authorColeman Watts <coleman@civicrm.org>
Mon, 1 Feb 2021 19:43:33 +0000 (14:43 -0500)
committerColeman Watts <coleman@civicrm.org>
Mon, 1 Feb 2021 22:50:47 +0000 (17:50 -0500)
ext/afform/admin/CRM/AfformAdmin/Page/Base.php
ext/afform/admin/CRM/AfformAdmin/Upgrader.php
ext/afform/admin/ang/afAdmin/afAdminList.html

index 31338e5eaf532a1aac99be5dc2c3562365276799..fc22b35b94d052489cf3fa4e57e5ee1007d96510 100644 (file)
@@ -16,7 +16,7 @@ class CRM_AfformAdmin_Page_Base extends CRM_Core_Page {
 
   public function run() {
     $breadCrumb = [
-      'title' => ts('Forms'),
+      'title' => ts('Form Builder'),
       'url' => CRM_Utils_System::url('civicrm/admin/afform', NULL, FALSE, '/'),
     ];
     CRM_Utils_System::appendBreadCrumb([$breadCrumb]);
index f129852e728985421be1e0c99f80ac81572894b4..5a402f727a49f4747410da1d84279b7e76254598 100644 (file)
@@ -23,12 +23,13 @@ class CRM_AfformAdmin_Upgrader extends CRM_AfformAdmin_Upgrader_Base {
       if (!$existing) {
         civicrm_api3('Navigation', 'create', [
           'parent_id' => 'Customize Data and Screens',
-          'label' => E::ts('Forms'),
+          'label' => E::ts('Form Builder'),
           'weight' => 1,
-          'name' => 'afform_gui',
+          'name' => 'afform_admin',
           'permission' => 'administer CiviCRM',
           'url' => 'civicrm/admin/afform',
           'is_active' => 1,
+          'icon' => 'crm-i fa-list-alt'
         ]);
       }
     }
@@ -48,4 +49,21 @@ class CRM_AfformAdmin_Upgrader extends CRM_AfformAdmin_Upgrader_Base {
     ]);
   }
 
+  /**
+   * Update menu item
+   *
+   * @return TRUE on success
+   * @throws Exception
+   */
+   public function upgrade_0001() {
+     $this->ctx->log->info('Applying update 0001');
+     \Civi\Api4\Navigation::update(FALSE)
+       ->addValue('icon', 'crm-i fa-list-alt')
+       ->addValue('label', E::ts('Form Builder'))
+       ->addValue('name', 'afform_admin')
+       ->addWhere('name', '=', 'afform_gui')
+       ->execute();
+     return TRUE;
+   }
+
 }
index 430f0309858267267fd399216e79740c4ac40fd1..02dd53f96b352de3d7c85677f787557c8a299a18 100644 (file)
@@ -1,5 +1,5 @@
 <div id="bootstrap-theme" class="afadmin-list">
-  <h1 crm-page-title>{{:: ts('Configurable Forms') }}</h1>
+  <h1 crm-page-title>{{:: ts('Form Builder') }}</h1>
 
   <ul class="nav nav-tabs">
     <li role="presentation" ng-repeat="tab in $ctrl.tabs" ng-class="{active: tab.name === $ctrl.tab}">