Avoid CiviCRM running full drupal cache flush, as this results in CiviCRM clobbering...
[civicrm-core.git] / CRM / Admin / Form.php
index 3f9cbafaec8d65c1bbe372f315abd2616f9e7f13..315c7147cdfccd54ed822455de78bd0aa1f34937 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -46,26 +46,33 @@ class CRM_Admin_Form extends CRM_Core_Form {
   protected $_id;
 
   /**
-   * The default values for form fields
+   * The default values for form fields.
    *
    * @var int
    */
   protected $_values;
 
   /**
-   * The name of the BAO object for this form
+   * The name of the BAO object for this form.
    *
    * @var string
    */
   protected $_BAOName;
 
   /**
-   * Basic setup
+   * Explicitly declare the form context.
+   */
+  public function getDefaultContext() {
+    return 'create';
+  }
+
+  /**
+   * Basic setup.
    */
   public function preProcess() {
-    $this->_id      = $this->get('id');
+    $this->_id = $this->get('id');
     $this->_BAOName = $this->get('BAOName');
-    $this->_values  = array();
+    $this->_values = array();
     if (isset($this->_id)) {
       $params = array('id' => $this->_id);
       // this is needed if the form is outside the CRM name space
@@ -105,7 +112,7 @@ class CRM_Admin_Form extends CRM_Core_Form {
   }
 
   /**
-   * Add standard buttons
+   * Add standard buttons.
    *
    * @return void
    */
@@ -135,4 +142,5 @@ class CRM_Admin_Form extends CRM_Core_Form {
       );
     }
   }
+
 }