From 657fcb7f08c72727ac654678f49d2b8dce191384 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 12 May 2020 16:14:07 -0700 Subject: [PATCH] Define the defaultExternUrl setting ("standalone"/"router") This toggle allows a sysadmin to choose between the legacy `extern/foo.php` and newer built-in routes. --- CRM/Admin/Form/Setting/Url.php | 1 + settings/Core.setting.php | 21 +++++++++++++++++++++ templates/CRM/Admin/Form/Setting/Url.hlp | 10 ++++++++++ templates/CRM/Admin/Form/Setting/Url.tpl | 8 ++++++++ 4 files changed, 40 insertions(+) diff --git a/CRM/Admin/Form/Setting/Url.php b/CRM/Admin/Form/Setting/Url.php index 09b1dd1fc4..fa854247ea 100644 --- a/CRM/Admin/Form/Setting/Url.php +++ b/CRM/Admin/Form/Setting/Url.php @@ -21,6 +21,7 @@ class CRM_Admin_Form_Setting_Url extends CRM_Admin_Form_Setting { protected $_settings = [ 'disable_core_css' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, + 'defaultExternUrl' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'userFrameworkResourceURL' => CRM_Core_BAO_Setting::URL_PREFERENCES_NAME, 'imageUploadURL' => CRM_Core_BAO_Setting::URL_PREFERENCES_NAME, 'customCSSURL' => CRM_Core_BAO_Setting::URL_PREFERENCES_NAME, diff --git a/settings/Core.setting.php b/settings/Core.setting.php index 349f266bde..910182dde4 100644 --- a/settings/Core.setting.php +++ b/settings/Core.setting.php @@ -239,6 +239,27 @@ return [ 'description' => NULL, 'help_text' => NULL, ], + 'defaultExternUrl' => [ + 'group_name' => 'CiviCRM Preferences', + 'group' => 'core', + 'name' => 'defaultExternUrl', + 'type' => 'String', + 'quick_form_type' => 'Select', + 'html_type' => 'Select', + 'html_attributes' => [ + 'class' => 'crm-select2', + ], + 'default' => 'router', + 'add' => '5.27', + 'title' => ts('Extern URL Style'), + 'is_domain' => 1, + 'is_contact' => 0, + 'help_text' => NULL, + 'options' => [ + 'standalone' => ts('Prefer standalone scripts'), + 'router' => ts('Prefer normal router'), + ], + ], 'activity_assignee_notification' => [ 'group_name' => 'CiviCRM Preferences', 'group' => 'core', diff --git a/templates/CRM/Admin/Form/Setting/Url.hlp b/templates/CRM/Admin/Form/Setting/Url.hlp index a2d1b1a86b..e01986593a 100644 --- a/templates/CRM/Admin/Form/Setting/Url.hlp +++ b/templates/CRM/Admin/Form/Setting/Url.hlp @@ -70,6 +70,16 @@

{ts}You can modify the look and feel of CiviCRM by adding your own stylesheet. For small to medium sized modifications, use your css file to override some of the styles in civicrm.css. Or if you need to make drastic changes, you can choose to disable civicrm.css completely.{/ts}

{/htxt} +{htxt id='id-defaultExternUrl'} +

{ts}CiviCRM generates callback URLs for external services.{/ts}

+

{ts}Some callback URLs are being migrated to a different style. During the transition, you may indicate a preferred style, such as:{/ts}

+ +

{ts}This setting only affects the default URL produced by "civicrm-core". Extensions and add-ons may override specific URLs.{/ts}

+{/htxt} + {htxt id='id-url_vars'} {ts}URL Variables{/ts} diff --git a/templates/CRM/Admin/Form/Setting/Url.tpl b/templates/CRM/Admin/Form/Setting/Url.tpl index 3ecb7699b7..ab3cd178b9 100644 --- a/templates/CRM/Admin/Form/Setting/Url.tpl +++ b/templates/CRM/Admin/Form/Setting/Url.tpl @@ -77,6 +77,14 @@

{ts}{$verifySSL_description}{/ts}

+ + + +
+ {$form.defaultExternUrl.label} {help id='id-defaultExternUrl'} + + {$form.defaultExternUrl.html} +
{include file="CRM/common/formButtons.tpl" location="bottom"}
-- 2.25.1