Merge pull request #4772 from jitendrapurohit/CRM-15750
[civicrm-core.git] / CRM / Core / QuickForm / Action / Display.php
index 0501b2c19c2fb75e436bdf4060223c8b329332a9..e5b8c6ba4fda9f9dd51ec9b7b1b2d43e7617121c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
 class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action {
 
   /**
-   * the template to display the required "red" asterick
+   * The template to display the required "red" asterick
    * @var string
    */
   static $_requiredTemplate = NULL;
 
   /**
-   * the template to display error messages inline with the form element
+   * The template to display error messages inline with the form element
    * @var string
    */
   static $_errorTemplate = NULL;
 
   /**
-   * class constructor
+   * Class constructor
    *
    * @param object $stateMachine reference to state machine object
    *
@@ -62,7 +62,7 @@ class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action {
   /**
    * Processes the request.
    *
-   * @param  object    $page       CRM_Core_Form the current form-page
+   * @param  CRM_Core_Form    $page       CRM_Core_Form the current form-page
    * @param  string    $actionName Current action name, as one Action object can serve multiple actions
    *
    * @return void
@@ -101,12 +101,10 @@ class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action {
   }
 
   /**
-   * render the page using a custom templating
-   * system
+   * Render the page using a custom templating system
    *
-   * @param object $page the CRM_Core_Form page
+   * @param CRM_Core_Form $page the CRM_Core_Form page
    *
-   * @internal param bool $ret should we echo or return output
    *
    * @return void
    * @access public
@@ -119,8 +117,7 @@ class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action {
     // Deprecated - use snippet=6 instead of json=1
     $json = CRM_Utils_Request::retrieve('json', 'Boolean', CRM_Core_DAO::$_nullObject);
     if ($json) {
-      echo json_encode($form);
-      CRM_Utils_System::civiExit();
+      CRM_Utils_JSON::output($form);
     }
 
     $template->assign('form', $form);
@@ -189,9 +186,9 @@ class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action {
   }
 
   /**
-   * set the various rendering templates
+   * Set the various rendering templates
    *
-   * @param object  $page the CRM_Core_Form page
+   * @param CRM_Core_Form  $page the CRM_Core_Form page
    *
    * @return void
    * @access public
@@ -208,9 +205,7 @@ class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action {
   }
 
   /**
-   * initialize the various templates
-   *
-   * @param object  $page the CRM_Core_Form page
+   * Initialize the various templates
    *
    * @return void
    * @access public