CRM-16478 Initial changes to remove custom error template path
[civicrm-core.git] / CRM / Utils / Address.php
index 3044c074455d394d3ddfd56a877ed3b4658666f0..08443b54298e090d319e76ef858c24b4e91f6bf9 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.                                    |
  |                                                                    |
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  * Address utilties
@@ -33,7 +33,7 @@
 class CRM_Utils_Address {
 
   /**
-   * Format an address string from address fields and a format string
+   * Format an address string from address fields and a format string.
    *
    * Format an address basing on the address fields provided.
    * Use Setting's address_format if there's no format specified.
@@ -54,9 +54,8 @@ class CRM_Utils_Address {
    * @return string
    *   formatted address string
    *
-   * @static
    */
-  static function format(
+  public static function format(
     $fields,
     $format = NULL,
     $microformat = FALSE,
@@ -67,13 +66,11 @@ class CRM_Utils_Address {
     static $config = NULL;
 
     if (!$format) {
-      $format =
-        CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'address_format');
+      $format = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'address_format');
     }
 
     if ($mailing) {
-      $format =
-        CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'mailing_format');
+      $format = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'mailing_format');
     }
 
     $formatted = $format;
@@ -146,7 +143,6 @@ class CRM_Utils_Address {
         'contact.birth_date' => CRM_Utils_Array::value('birth_date', $fields),
         'contact.gender' => CRM_Utils_Array::value('gender', $fields),
         'contact.is_opt_out' => CRM_Utils_Array::value('is_opt_out', $fields),
-        'contact.home_URL' => CRM_Utils_Array::value('home_URL', $fields),
         'contact.preferred_mail_format' => CRM_Utils_Array::value('preferred_mail_format', $fields),
         'contact.phone' => CRM_Utils_Array::value('phone', $fields),
         'contact.home_URL' => CRM_Utils_Array::value('home_URL', $fields),
@@ -255,8 +251,8 @@ class CRM_Utils_Address {
     else {
       // remove \n from each line and only add at the end
       // this hack solves formatting issue, when we convert nl2br
-      $lines          = array();
-      $count          = 1;
+      $lines = array();
+      $count = 1;
       $finalFormatted = NULL;
       $formattedArray = explode("\n", $formatted);
       $formattedArray = array_filter($formattedArray);
@@ -310,4 +306,5 @@ class CRM_Utils_Address {
     $newSequence = array_unique($newSequence);
     return $newSequence;
   }
+
 }