From 36b820aecf5c80a32cb1bf8bb20318d496e71fb1 Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Sat, 25 May 2013 17:51:37 -0700 Subject: [PATCH] CRM-10692 - commit andrew hunt patch. rework in next commit ---------------------------------------- * CRM-10692: unable to override /CRM/Core/Utils.php from extension http://issues.civicrm.org/jira/browse/CRM-10692 --- CRM/Admin/Form/Setting/UF.php | 4 ++++ CRM/Core/Config/Variables.php | 5 +++++ CRM/Utils/System/WordPress.php | 3 +++ templates/CRM/Admin/Form/Setting/UF.tpl | 8 ++++++++ 4 files changed, 20 insertions(+) diff --git a/CRM/Admin/Form/Setting/UF.php b/CRM/Admin/Form/Setting/UF.php index b038ba2765..3b85de3ccd 100644 --- a/CRM/Admin/Form/Setting/UF.php +++ b/CRM/Admin/Form/Setting/UF.php @@ -68,6 +68,10 @@ class CRM_Admin_Form_Setting_UF extends CRM_Admin_Form_Setting { $tablePrefixes .= "\n);"; $this->assign('tablePrefixes', $tablePrefixes); } + + if ($uf == 'WordPress') { + $this->addElement('text', 'wpBasePage', ts('WordPress Base Page')); + } parent::buildQuickForm(); } diff --git a/CRM/Core/Config/Variables.php b/CRM/Core/Config/Variables.php index f92f643c08..66bf8e13d1 100644 --- a/CRM/Core/Config/Variables.php +++ b/CRM/Core/Config/Variables.php @@ -452,6 +452,11 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults { * Path to wkhtmltopdf if available */ public $wkhtmltopdfPath = FALSE; + + /** + * Allow second-degree relations permission to edit contacts + */ + public $wpBasePage = NULL; /** * Provide addressSequence diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 6f08bfe92e..3a840ddeb0 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -308,6 +308,9 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { elseif (defined('CIVICRM_UF_WP_BASEPAGE')) { $base .= CIVICRM_UF_WP_BASEPAGE; } + elseif (isset($config->wpBasePage)) { + $base .= $config->wpBasePage; + } if (isset($path)) { if (isset($query)) { diff --git a/templates/CRM/Admin/Form/Setting/UF.tpl b/templates/CRM/Admin/Form/Setting/UF.tpl index 70c395b18a..8433689c2d 100644 --- a/templates/CRM/Admin/Form/Setting/UF.tpl +++ b/templates/CRM/Admin/Form/Setting/UF.tpl @@ -33,6 +33,14 @@ {$form.userFrameworkUsersTableName.label} {$form.userFrameworkUsersTableName.html} + {if $form.wpBasePage} + + {$form.wpBasePage.label} + {$config->userFrameworkBaseURL}{$form.wpBasePage.html} +

{ts 1=$config->userFrameworkBaseURL}By default, CiviCRM will generate front-facing pages using the home page at %1 as its base. If you want to use a different template for CiviCRM pages, set the path here.{/ts}

+ + + {/if}
{include file="CRM/common/formButtons.tpl" location="bottom"}
-- 2.25.1