當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Utils_System::absoluteURL方法代碼示例

本文整理匯總了PHP中CRM_Utils_System::absoluteURL方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Utils_System::absoluteURL方法的具體用法?PHP CRM_Utils_System::absoluteURL怎麽用?PHP CRM_Utils_System::absoluteURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Utils_System的用法示例。


在下文中一共展示了CRM_Utils_System::absoluteURL方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: retrieveDirectoryAndURLPreferences

 /**
  * @param array $params
  * @param bool $setInConfig
  */
 public static function retrieveDirectoryAndURLPreferences(&$params, $setInConfig = FALSE)
 {
     if (CRM_Core_Config::isUpgradeMode()) {
         $isJoomla = defined('CIVICRM_UF') && CIVICRM_UF == 'Joomla' ? TRUE : FALSE;
         // hack to set the resource base url so that js/ css etc is loaded correctly
         if ($isJoomla) {
             $params['userFrameworkResourceURL'] = CRM_Utils_File::addTrailingSlash(CIVICRM_UF_BASEURL, '/') . str_replace('administrator', '', CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', 'userFrameworkResourceURL', 'value', 'name'));
         }
         if (self::isUpgradeFromPreFourOneAlpha1()) {
             return;
         }
     }
     if ($setInConfig) {
         $config = CRM_Core_Config::singleton();
     }
     $sql = "\nSELECT name, group_name, value\nFROM   civicrm_setting\nWHERE  ( group_name = %1\nOR       group_name = %2 )\nAND domain_id = %3\n";
     $sqlParams = array(1 => array(self::DIRECTORY_PREFERENCES_NAME, 'String'), 2 => array(self::URL_PREFERENCES_NAME, 'String'), 3 => array(CRM_Core_Config::domainID(), 'Integer'));
     $dao = CRM_Core_DAO::executeQuery($sql, $sqlParams, TRUE, NULL, FALSE, TRUE, TRUE);
     if (is_a($dao, 'DB_Error')) {
         echo "Fatal DB error, exiting, seems like your schema does not have civicrm_setting table\n";
         exit;
     }
     while ($dao->fetch()) {
         $value = self::getOverride($dao->group_name, $dao->name, NULL);
         if ($value === NULL && $dao->value) {
             $value = unserialize($dao->value);
             if ($dao->group_name == self::DIRECTORY_PREFERENCES_NAME) {
                 $value = CRM_Utils_File::absoluteDirectory($value);
             } else {
                 // CRM-7622: we need to remove the language part
                 $value = CRM_Utils_System::absoluteURL($value, TRUE);
             }
         }
         // CRM-10931, If DB doesn't have any value, carry on with any default value thats already available
         if (!isset($value) && !empty($params[$dao->name])) {
             $value = $params[$dao->name];
         }
         $params[$dao->name] = $value;
         if ($setInConfig) {
             $config->{$dao->name} = $value;
         }
     }
 }
開發者ID:kidaa30,項目名稱:yes,代碼行數:47,代碼來源:Setting.php

示例2: retrieveDirectoryAndURLPreferences

 static function retrieveDirectoryAndURLPreferences(&$params, $setInConfig = false)
 {
     if ($setInConfig) {
         $config =& CRM_Core_Config::singleton();
     }
     $sql = "\nSELECT v.name as valueName, v.value, g.name as optionName\nFROM   civicrm_option_value v,\n       civicrm_option_group g\nWHERE  ( g.name = 'directory_preferences'\nOR       g.name = 'url_preferences' )\nAND    v.option_group_id = g.id\nAND    v.is_active = 1\n";
     require_once 'CRM/Utils/File.php';
     $dao = CRM_Core_DAO::executeQuery($sql);
     while ($dao->fetch()) {
         if (!$dao->value) {
             continue;
         }
         if ($dao->optionName == 'directory_preferences') {
             $value = CRM_Utils_File::absoluteDirectory($dao->value);
         } else {
             $value = CRM_Utils_System::absoluteURL($dao->value);
         }
         $params[$dao->valueName] = $value;
         if ($setInConfig) {
             $config->{$dao->valueName} = $value;
         }
     }
 }
開發者ID:hampelm,項目名稱:Ginsberg-CiviDemo,代碼行數:23,代碼來源:Preferences.php


注:本文中的CRM_Utils_System::absoluteURL方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。