2 use CRM_AfformAdmin_ExtensionUtil
as E
;
5 * Collection of upgrade steps.
7 class CRM_AfformAdmin_Upgrader
extends CRM_AfformAdmin_Upgrader_Base
{
9 // By convention, functions that look like "function upgrade_NNNN()" are
10 // upgrade tasks. They are executed in order (like Drupal's hook_update_N).
13 * Setup navigation item on new installs.
15 * Note: this path is not in the menu.xml because routing is handled by afform
17 public function install() {
19 $existing = civicrm_api3('Navigation', 'getcount', [
20 'name' => 'afform_gui',
21 'domain_id' => CRM_Core_Config
::domainID(),
24 civicrm_api3('Navigation', 'create', [
25 'parent_id' => 'Customize Data and Screens',
26 'label' => ts('Forms'),
28 'name' => 'afform_gui',
29 'permission' => 'administer CiviCRM',
30 'url' => 'civicrm/admin/afform',
35 catch (Exception
$e) {
36 // Couldn't create menu item.
41 * Cleanup navigation upon removal
43 public function uninstall() {
44 civicrm_api3('Navigation', 'get', [
45 'name' => 'afform_gui',
47 'api.Navigation.delete' => [],