CRM-10693 - Ajax - Fetch more accurate page title
authorColeman Watts <coleman@civicrm.org>
Mon, 18 Nov 2013 19:12:36 +0000 (11:12 -0800)
committerColeman Watts <coleman@civicrm.org>
Mon, 18 Nov 2013 19:12:36 +0000 (11:12 -0800)
CRM/Core/Config.php
CRM/Core/Controller.php
CRM/Core/QuickForm/Action/Display.php
CRM/Utils/System.php

index 377cec0afeb013ce2ae0dc7d1b2cca129dccdf78..ee12caba087bb1a71aecc402b900ac427e319478 100644 (file)
@@ -167,7 +167,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
    * @param $loadFromDB boolean  whether to load from the database
    * @param $force      boolean  whether to force a reconstruction
    *
-   * @return object
+   * @return CRM_Core_Config
    * @static
    */
   static function &singleton($loadFromDB = TRUE, $force = FALSE) {
index 7bf8d8c7c64a356de074fa5ca1d85f2cdf62f14f..21a4ac461b3686fa30c2a2e9eee793b5096a610c 100644 (file)
@@ -53,7 +53,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
    *
    * @var string
    */
-  public $_title;
+  protected $_title;
 
   /**
    * The key associated with this controller
index 7302b26d2470b35f2992cf660ee15a9a9ad807ad..ad9cc918733c179fb936365fbd14e4580f6ae7dd 100644 (file)
@@ -159,7 +159,7 @@ class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action {
     if ($controller->_QFResponseType == 'json') {
       $response = array(
         'content' => $html,
-        'title' => $controller->_title,
+        'title' => CRM_Utils_System::$title,
       );
       if (!empty($form['errors'])) {
         $response['status'] = 'form_error';
index 3883d6a744f89acb3da02fb23987d70564508924..06ff598a79a92147de33a65e334aee9f345566ee 100644 (file)
@@ -41,6 +41,11 @@ class CRM_Utils_System {
 
   static $_callbacks = NULL;
 
+  /**
+   * @var string Page title
+   */
+  static $title = '';
+
   /**
    * Compose a new url string from the current url string
    * Used by all the framework components, specifically,
@@ -293,6 +298,7 @@ class CRM_Utils_System {
    * @static
    */
   static function setTitle($title, $pageTitle = NULL) {
+    self::$title = $title;
     $config = CRM_Core_Config::singleton();
     return $config->userSystem->setTitle($title, $pageTitle);
   }