CRM-10692 - commit andrew hunt patch. rework in next commit
authorDonald A. Lobo <lobo@civicrm.org>
Sun, 26 May 2013 00:51:37 +0000 (17:51 -0700)
committerDonald A. Lobo <lobo@civicrm.org>
Sun, 26 May 2013 00:51:37 +0000 (17:51 -0700)
----------------------------------------
* 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
CRM/Core/Config/Variables.php
CRM/Utils/System/WordPress.php
templates/CRM/Admin/Form/Setting/UF.tpl

index b038ba2765141486239a8d80e861bbcc5b9e9593..3b85de3ccdea4b0b588704f504de40f02b241058 100644 (file)
@@ -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();
   }
index f92f643c08572604341d38537f7ffb7af299d819..66bf8e13d1cdb9454dea06cf0ddc5fb5447aa5d7 100644 (file)
@@ -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
index 6f08bfe92ecabd994e1f3500c461b78c6ff4933d..3a840ddeb0b90fd4aa9a6b8b17e338cf2cb8eae0 100644 (file)
@@ -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)) {
index 70c395b18adedf11f514ee64c8c33407aeb26c3a..8433689c2dab248a987db9d84558a5e18742c1d8 100644 (file)
             <td class="label">{$form.userFrameworkUsersTableName.label}</td>
             <td>{$form.userFrameworkUsersTableName.html}</td>
         </tr>
+        {if $form.wpBasePage}
+         <tr class="crm-uf-form-block-wpBasePage">
+            <td class="label">{$form.wpBasePage.label}</td>
+            <td>{$config->userFrameworkBaseURL}{$form.wpBasePage.html}
+            <p class="description">{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}</p>
+            </td>
+        </tr>
+        {/if}
         </table>
             <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
 <div class="spacer"></div>