当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Core_BAO_Setting::fixAndStoreDirAndURL方法代码示例

本文整理汇总了PHP中CRM_Core_BAO_Setting::fixAndStoreDirAndURL方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_Setting::fixAndStoreDirAndURL方法的具体用法?PHP CRM_Core_BAO_Setting::fixAndStoreDirAndURL怎么用?PHP CRM_Core_BAO_Setting::fixAndStoreDirAndURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Core_BAO_Setting的用法示例。


在下文中一共展示了CRM_Core_BAO_Setting::fixAndStoreDirAndURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add

 /**
  * Function to add civicrm settings
  *
  * @params array $params associated array of civicrm variables
  *
  * @return null
  * @static
  */
 static function add(&$params)
 {
     self::fixParams($params);
     // also set a template url so js files can use this
     // CRM-6194
     $params['civiRelativeURL'] = CRM_Utils_System::url('CIVI_BASE_TEMPLATE');
     $params['civiRelativeURL'] = str_replace('CIVI_BASE_TEMPLATE', '', $params['civiRelativeURL']);
     $domain = new CRM_Core_DAO_Domain();
     $domain->id = CRM_Core_Config::domainID();
     $domain->find(TRUE);
     if ($domain->config_backend) {
         $values = unserialize($domain->config_backend);
         self::formatParams($params, $values);
     }
     // CRM-6151
     if (isset($params['localeCustomStrings']) && is_array($params['localeCustomStrings'])) {
         $domain->locale_custom_strings = serialize($params['localeCustomStrings']);
     }
     // unset any of the variables we read from file that should not be stored in the database
     // the username and certpath are stored flat with _test and _live
     // check CRM-1470
     $skipVars = self::skipVars();
     foreach ($skipVars as $var) {
         unset($params[$var]);
     }
     CRM_Core_BAO_Setting::fixAndStoreDirAndURL($params);
     // also skip all Dir Params, we dont need to store those in the DB!
     foreach ($params as $name => $val) {
         if (substr($name, -3) == 'Dir') {
             unset($params[$name]);
         }
     }
     //keep user preferred language upto date, CRM-7746
     $session = CRM_Core_Session::singleton();
     $lcMessages = CRM_Utils_Array::value('lcMessages', $params);
     if ($lcMessages && $session->get('userID')) {
         $languageLimit = CRM_Utils_Array::value('languageLimit', $params);
         if (is_array($languageLimit) && !in_array($lcMessages, array_keys($languageLimit))) {
             $lcMessages = $session->get('lcMessages');
         }
         $ufm = new CRM_Core_DAO_UFMatch();
         $ufm->contact_id = $session->get('userID');
         if ($lcMessages && $ufm->find(TRUE)) {
             $ufm->language = $lcMessages;
             $ufm->save();
             $session->set('lcMessages', $lcMessages);
             $params['lcMessages'] = $lcMessages;
         }
     }
     $domain->config_backend = serialize($params);
     $domain->save();
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:60,代码来源:ConfigSetting.php


注:本文中的CRM_Core_BAO_Setting::fixAndStoreDirAndURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。