Merge pull request #4997 from monishdeb/CRM-15536
[civicrm-core.git] / CRM / Core / BAO / Preferences.php
index 8c238944ff762295bf44fdf596e1a618fd37c76e..a7020ea7ce6bdd35ee411a2fc2f9c784cda96cd7 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        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -41,7 +41,7 @@ class CRM_Core_BAO_Preferences {
   /**
    * @param array $params
    */
-  static function fixAndStoreDirAndURL(&$params) {
+  public static function fixAndStoreDirAndURL(&$params) {
     $sql = "
 SELECT v.name as valueName, g.name as optionName
 FROM   civicrm_option_value v,
@@ -54,7 +54,7 @@ AND    v.is_active = 1
 
     $dirParams = array();
     $urlParams = array();
-    $dao       = CRM_Core_DAO::executeQuery($sql);
+    $dao = CRM_Core_DAO::executeQuery($sql);
     while ($dao->fetch()) {
       if (!isset($params[$dao->valueName])) {
         continue;
@@ -81,7 +81,7 @@ AND    v.is_active = 1
    * @param array $params
    * @param string $type
    */
-  static function storeDirectoryOrURLPreferences(&$params, $type = 'directory') {
+  public static function storeDirectoryOrURLPreferences(&$params, $type = 'directory') {
     $optionName = ($type == 'directory') ? 'directory_preferences' : 'url_preferences';
 
     $sql = "
@@ -102,7 +102,8 @@ AND    v.name = %3
       else {
         $value = CRM_Utils_System::relativeURL($value);
       }
-      $sqlParams = array(1 => array($value, 'String'),
+      $sqlParams = array(
+        1 => array($value, 'String'),
         2 => array($optionName, 'String'),
         3 => array($name, 'String'),
       );
@@ -114,7 +115,7 @@ AND    v.name = %3
    * @param array $params
    * @param bool $setInConfig
    */
-  static function retrieveDirectoryAndURLPreferences(&$params, $setInConfig = FALSE) {
+  public static function retrieveDirectoryAndURLPreferences(&$params, $setInConfig = FALSE) {
     if ($setInConfig) {
       $config = CRM_Core_Config::singleton();
     }
@@ -129,7 +130,6 @@ AND    v.option_group_id = g.id
 AND    v.is_active = 1
 ";
 
-
     $dao = CRM_Core_DAO::executeQuery($sql);
     while ($dao->fetch()) {
       if (!$dao->value) {
@@ -148,5 +148,5 @@ AND    v.is_active = 1
       }
     }
   }
-}
 
+}