From 4a7ce9462a7eae0755f1f718ebb820eefcc4eb64 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 2 Nov 2020 17:08:20 -0800 Subject: [PATCH] oauth-client - Add menu item ("Admin: System Settings: OAuth") --- ext/oauth-client/CRM/OAuth/Upgrader.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ext/oauth-client/CRM/OAuth/Upgrader.php b/ext/oauth-client/CRM/OAuth/Upgrader.php index 6e75ca6f4b..acc937d6d6 100644 --- a/ext/oauth-client/CRM/OAuth/Upgrader.php +++ b/ext/oauth-client/CRM/OAuth/Upgrader.php @@ -9,6 +9,24 @@ class CRM_OAuth_Upgrader extends CRM_OAuth_Upgrader_Base { // By convention, functions that look like "function upgrade_NNNN()" are // upgrade tasks. They are executed in order (like Drupal's hook_update_N). + /** + * @see CRM_Utils_Hook::install() + */ + public function install() { + $domainId = CRM_Core_Config::domainID(); + civicrm_api3('Navigation', 'create', [ + 'sequential' => 1, + 'domain_id' => $domainId, + 'url' => "civicrm/admin/oauth", + 'permission' => "manage OAuth client", + 'label' => "OAuth", + 'permission_operator' => "OR", + 'has_separator' => 0, + 'is_active' => 1, + 'parent_id' => "System Settings", + ]); + } + /** * Example: Run an external SQL script when the module is installed. * -- 2.25.1