Merge pull request #4971 from kurund/batch-16
[civicrm-core.git] / CRM / PCP / Form / PCPAccount.php
index f7ee0559e14a537281831a9a0dbe561259a8a6a5..9c4447f06c297c17114b7acfc1b169e49e30cee5 100644 (file)
@@ -40,8 +40,7 @@
 class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
 
   /**
-   *Variable defined for Contribution Page Id
-   *
+   * Variable defined for Contribution Page Id
    */
 
   public $_pageId = NULL;
@@ -52,7 +51,6 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
    * Are we in single form mode or wizard mode?
    *
    * @var boolean
-   * @access protected
    */
   public $_single;
 
@@ -60,18 +58,17 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
    * The default values for the form
    *
    * @var array
-   * @protected
    */
   protected $_defaults;
 
 
   public function preProcess() {
-    $session          = CRM_Core_Session::singleton();
-    $config           = CRM_Core_Config::singleton();
-    $this->_action    = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE);
-    $this->_pageId    = CRM_Utils_Request::retrieve('pageId', 'Positive', $this);
+    $session = CRM_Core_Session::singleton();
+    $config = CRM_Core_Config::singleton();
+    $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE);
+    $this->_pageId = CRM_Utils_Request::retrieve('pageId', 'Positive', $this);
     $this->_component = CRM_Utils_Request::retrieve('component', 'String', $this);
-    $this->_id        = CRM_Utils_Request::retrieve('id', 'Positive', $this);
+    $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
 
     if (!$this->_pageId && $config->userFramework == 'Joomla' && $config->userFrameworkFrontend) {
       $this->_pageId = $this->_id;
@@ -119,7 +116,7 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
   /**
    * @return array
    */
-  function setDefaultValues() {
+  public function setDefaultValues() {
     $this->_defaults = array();
     if ($this->_contactID) {
       foreach ($this->_fields as $name => $dontcare) {
@@ -145,7 +142,6 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
    * Build the form object
    *
    * @return void
-   * @access public
    */
   public function buildQuickForm() {
     $id = CRM_PCP_BAO_PCP::getSupporterProfileId($this->_pageId, $this->_component);
@@ -189,7 +185,6 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
       }
     }
 
-
     if ($this->_component == 'contribute') {
       $this->assign('campaignName', CRM_Contribute_PseudoConstant::contributionPage($this->_pageId));
     }
@@ -199,7 +194,8 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
 
     if ($this->_single) {
       $button = array(
-        array('type' => 'next',
+        array(
+          'type' => 'next',
           'name' => ts('Save'),
           'spacing' => '         ',
           'isDefault' => TRUE,
@@ -213,7 +209,7 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
     else {
       $button[] = array(
         'type' => 'next',
-        'name' => ts('Continue >>'),
+        'name' => ts('Continue'),
         'spacing' => '         ',
         'isDefault' => TRUE,
       );
@@ -225,16 +221,17 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
   /**
    * Global form rule
    *
-   * @param array $fields the input form values
-   * @param array $files the uploaded files if any
+   * @param array $fields
+   *   The input form values.
+   * @param array $files
+   *   The uploaded files if any.
    * @param $self
    *
    *
-   * @return true if no errors, else array of errors
-   * @access public
-   * @static
+   * @return bool|array
+   *   true if no errors, else array of errors
    */
-  static function formRule($fields, $files, $self) {
+  public static function formRule($fields, $files, $self) {
     $errors = array();
     foreach ($fields as $key => $value) {
       if (strpos($key, 'email-') !== FALSE && !empty($value)) {
@@ -250,7 +247,6 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
   /**
    * Process the form submission
    *
-   * @access public
    *
    * @return void
    */
@@ -295,4 +291,3 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
     CRM_Contribute_BAO_Contribution_Utils::createCMSUser($params, $contactID, 'email');
   }
 }
-