Merge pull request #5101 from agh1/context-abbrev
[civicrm-core.git] / CRM / Contact / Form / Inline / OpenID.php
index 49920d8ccaac038b16988b3e944a598b5982749c..e59404ce3a65c9a9d06d3cd4e845e62a6f65b539 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
 class CRM_Contact_Form_Inline_OpenID extends CRM_Contact_Form_Inline {
 
   /**
-   * ims of the contact that is been viewed
+   * Ims of the contact that is been viewed.
    */
   private $_openids = array();
 
   /**
-   * No of openid blocks for inline edit
+   * No of openid blocks for inline edit.
    */
   private $_blockCount = 6;
 
   /**
-   * call preprocess
+   * Call preprocess.
    */
   public function preProcess() {
     parent::preProcess();
@@ -62,10 +62,9 @@ class CRM_Contact_Form_Inline_OpenID extends CRM_Contact_Form_Inline {
   }
 
   /**
-   * Build the form object elements for openID object
+   * Build the form object elements for openID object.
    *
    * @return void
-   * @access public
    */
   public function buildQuickForm() {
     parent::buildQuickForm();
@@ -97,15 +96,16 @@ class CRM_Contact_Form_Inline_OpenID extends CRM_Contact_Form_Inline {
   }
 
   /**
-   * global validation rules for the form
+   * Global validation rules for the form.
    *
-   * @param array $fields posted values of the form
-   * @param array $errors list of errors to be posted back to the form
+   * @param array $fields
+   *   Posted values of the form.
+   * @param array $errors
+   *   List of errors to be posted back to the form.
    *
-   * @return array $errors@static
-   * @access public
+   * @return array
    */
-  static function formRule($fields, $errors) {
+  public static function formRule($fields, $errors) {
     $hasData = $hasPrimary = $errors = array();
     if (!empty($fields['openid']) && is_array($fields['openid'])) {
       foreach ($fields['openid'] as $instance => $blockValues) {
@@ -116,7 +116,7 @@ class CRM_Contact_Form_Inline_OpenID extends CRM_Contact_Form_Inline {
           if (!empty($blockValues['is_primary'])) {
             $hasPrimary[] = $instance;
             if (!$primaryID && !empty($blockValues['openid'])) {
-                $primaryID = $blockValues['openid'];
+              $primaryID = $blockValues['openid'];
             }
           }
         }
@@ -127,17 +127,16 @@ class CRM_Contact_Form_Inline_OpenID extends CRM_Contact_Form_Inline {
       }
 
       if (count($hasPrimary) > 1) {
-        $errors["openid[".array_pop($hasPrimary)."][is_primary]"] = ts('Only one OpenID can be marked as primary.');
+        $errors["openid[" . array_pop($hasPrimary) . "][is_primary]"] = ts('Only one OpenID can be marked as primary.');
       }
     }
     return $errors;
   }
 
   /**
-   * set defaults for the form
+   * Set defaults for the form.
    *
    * @return array
-   * @access public
    */
   public function setDefaultValues() {
     $defaults = array();
@@ -155,10 +154,9 @@ class CRM_Contact_Form_Inline_OpenID extends CRM_Contact_Form_Inline {
   }
 
   /**
-   * process the form
+   * Process the form.
    *
    * @return void
-   * @access public
    */
   public function postProcess() {
     $params = $this->exportValues();
@@ -171,4 +169,5 @@ class CRM_Contact_Form_Inline_OpenID extends CRM_Contact_Form_Inline {
     $this->log();
     $this->response();
   }
+
 }