• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP sugarLangArrayMerge函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中sugarLangArrayMerge函数的典型用法代码示例。如果您正苦于以下问题:PHP sugarLangArrayMerge函数的具体用法?PHP sugarLangArrayMerge怎么用?PHP sugarLangArrayMerge使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: getDuplicateCheckIndexes

 /**
  * Returns an array with an element for each index
  *
  * @return array
  */
 public function getDuplicateCheckIndexes()
 {
     $super_language_pack = sugarLangArrayMerge(return_module_language($GLOBALS['current_language'], $this->_focus->module_dir), $GLOBALS['app_strings']);
     $index_array = array();
     foreach ($this->_getIndexVardefs() as $index) {
         if ($index['type'] == "index") {
             $labelsArray = array();
             foreach ($index['fields'] as $field) {
                 if ($field == 'deleted') {
                     continue;
                 }
                 $fieldDef = $this->_focus->getFieldDefinition($field);
                 if (isset($fieldDef['vname']) && isset($super_language_pack[$fieldDef['vname']])) {
                     $labelsArray[$fieldDef['name']] = $super_language_pack[$fieldDef['vname']];
                 } else {
                     $labelsArray[$fieldDef['name']] = $fieldDef['name'];
                 }
             }
             $index_array[$index['name']] = str_replace(":", "", implode(", ", $labelsArray));
         }
     }
     return $index_array;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:28,代码来源:ImportDuplicateCheck.php


示例2: getAppListStrings

 function getAppListStrings($language = 'en_us')
 {
     $language .= '.lang.php';
     if (!empty($this->appListStrings[$language]) && $language != 'en_us.lang.php') {
         return sugarLangArrayMerge($this->appListStrings['en_us.lang.php'], $this->appListStrings[$language]);
     }
     if (!empty($this->appListStrings['en_us.lang.php'])) {
         return $this->appListStrings['en_us.lang.php'];
     }
     $empty = array();
     return $empty;
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:12,代码来源:MBLanguage.php


示例3: refreshLanguage

 /**
  * Given a module, search all of the specified locations, and any others as specified
  * in order to refresh the cache file
  *
  * @param string $module the given module we want to load the vardefs for
  * @param string $lang the given language we wish to load
  * @param array $additional_search_paths an array which allows a consumer to pass in additional vardef locations to search
  */
 function refreshLanguage($module, $lang, $loaded_mod_strings = array(), $additional_search_paths = null)
 {
     // Some of the vardefs do not correctly define dictionary as global.  Declare it first.
     $lang_paths = array('modules/' . $module . '/language/' . $lang . '.lang.php', 'modules/' . $module . '/language/' . $lang . '.lang.override.php', 'custom/modules/' . $module . '/Ext/Language/' . $lang . '.lang.ext.php', 'custom/modules/' . $module . '/language/' . $lang . '.lang.php');
     #27023, if this module template language file was not attached , get the template from this module vardef cache file if exsits and load the template language files.
     static $createdModules;
     if (empty($createdModules[$module]) && isset($GLOBALS['beanList'][$module])) {
         $object = $GLOBALS['beanList'][$module];
         if ($object == 'aCase') {
             $object = 'Case';
         }
         if (!empty($GLOBALS["dictionary"]["{$object}"]["templates"])) {
             $templates = $GLOBALS["dictionary"]["{$object}"]["templates"];
             $loaded_mod_strings = LanguageManager::loadTemplateLanguage($module, $templates, $lang, $loaded_mod_strings);
             $createdModules[$module] = true;
         }
     }
     //end of fix #27023
     // Add in additional search paths if they were provided.
     if (!empty($additional_search_paths) && is_array($additional_search_paths)) {
         $lang_paths = array_merge($lang_paths, $additional_search_paths);
     }
     //search a predefined set of locations for the vardef files
     foreach ($lang_paths as $path) {
         if (file_exists($path)) {
             require $path;
             if (!empty($mod_strings)) {
                 if (function_exists('sugarArrayMergeRecursive')) {
                     $loaded_mod_strings = sugarArrayMergeRecursive($loaded_mod_strings, $mod_strings);
                 } else {
                     $loaded_mod_strings = sugarLangArrayMerge($loaded_mod_strings, $mod_strings);
                 }
             }
         }
     }
     //great! now that we have loaded all of our vardefs.
     //let's go save them to the cache file.
     if (!empty($loaded_mod_strings)) {
         LanguageManager::saveCache($module, $lang, $loaded_mod_strings);
     }
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:49,代码来源:LanguageManager.php


示例4: return_mod_list_strings_language

/** This function retrieves an application language file and returns the array of strings included in the $mod_list_strings var.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 * If you are using the current language, do not call this function unless you are loading it for the first time */
function return_mod_list_strings_language($language, $module)
{
    global $mod_list_strings;
    global $sugar_config;
    global $currentModule;
    $cache_key = "mod_list_str_lang." . $language . $module;
    // Check for cached value
    $cache_entry = sugar_cache_retrieve($cache_key);
    if (!empty($cache_entry)) {
        return $cache_entry;
    }
    $language_used = $language;
    $temp_mod_list_strings = $mod_list_strings;
    $default_language = $sugar_config['default_language'];
    if ($currentModule == $module && isset($mod_list_strings) && $mod_list_strings != null) {
        return $mod_list_strings;
    }
    // cn: bug 6351 - include en_us if file langpack not available
    // cn: bug 6048 - merge en_us with requested language
    include "modules/{$module}/language/en_us.lang.php";
    $en_mod_list_strings = array();
    if ($language_used != $default_language) {
        $en_mod_list_strings = $mod_list_strings;
    }
    if (file_exists("modules/{$module}/language/{$language}.lang.php")) {
        include "modules/{$module}/language/{$language}.lang.php";
    }
    if (file_exists("modules/{$module}/language/{$language}.lang.override.php")) {
        include "modules/{$module}/language/{$language}.lang.override.php";
    }
    if (file_exists("modules/{$module}/language/{$language}.lang.php.override")) {
        echo 'Please Change:<br>' . "modules/{$module}/language/{$language}.lang.php.override" . '<br>to<br>' . 'Please Change:<br>' . "modules/{$module}/language/{$language}.lang.override.php";
        include "modules/{$module}/language/{$language}.lang.php.override";
    }
    // cn: bug 6048 - merge en_us with requested language
    $mod_list_strings = sugarLangArrayMerge($en_mod_list_strings, $mod_list_strings);
    // if we still don't have a language pack, then log an error
    if (!isset($mod_list_strings)) {
        $GLOBALS['log']->fatal("Unable to load the application list language file for the selected language({$language}) or the default language({$default_language}) for module({$module})");
        return null;
    }
    $return_value = $mod_list_strings;
    $mod_list_strings = $temp_mod_list_strings;
    sugar_cache_put($cache_key, $return_value);
    return $return_value;
}
开发者ID:pikkoui,项目名称:suitecrm,代码行数:51,代码来源:utils.php


示例5: str_replace

        }
    }
}
if (isset($_POST['language'])) {
    $_SESSION['language'] = str_replace('-', '_', $_POST['language']);
}
$current_language = isset($_SESSION['language']) ? $_SESSION['language'] : $default_lang;
if (file_exists("install/language/{$current_language}.lang.php")) {
    require_once "install/language/{$current_language}.lang.php";
} else {
    require_once "install/language/{$default_lang}.lang.php";
}
if ($current_language != 'en_us') {
    $my_mod_strings = $mod_strings;
    include 'install/language/en_us.lang.php';
    $mod_strings = sugarLangArrayMerge($mod_strings, $my_mod_strings);
}
$app_list_strings = return_app_list_strings_language($current_language);
////	END INSTALLER LANGUAGE
///////////////////////////////////////////////////////////////////////////////
//get the url for the helper link
$help_url = get_help_button_url();
//if this license print, then redirect and exit,
if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'licensePrint') {
    include 'install/licensePrint.php';
    exit;
}
if (isset($_REQUEST['sugar_body_only']) && $_REQUEST['sugar_body_only'] == "1") {
    //if this is a system check, then just run the check and return,
    //this is an ajax call and there is no need for further processing
    if (isset($_REQUEST['uploadLogoFrame']) && $_REQUEST['uploadLogoFrame']) {
开发者ID:switcode,项目名称:SuiteCRM,代码行数:31,代码来源:install.php


示例6: save

 function save($key_name, $duplicate = false, $rename = false)
 {
     $header = file_get_contents('modules/ModuleBuilder/MB/header.php');
     $save_path = $this->path . '/language';
     mkdir_recursive($save_path);
     foreach ($this->strings as $lang => $values) {
         //Check if the module Label has changed.
         $renameLang = $rename || empty($values) || isset($values['LBL_MODULE_NAME']) && $this->label != $values['LBL_MODULE_NAME'];
         $mod_strings = return_module_language(str_replace('.lang.php', '', $lang), 'ModuleBuilder');
         $required = array('LBL_LIST_FORM_TITLE' => $this->label . " " . $mod_strings['LBL_LIST'], 'LBL_MODULE_NAME' => $this->label, 'LBL_MODULE_TITLE' => $this->label, 'LBL_HOMEPAGE_TITLE' => $mod_strings['LBL_HOMEPAGE_PREFIX'] . " " . $this->label, 'LNK_NEW_RECORD' => $mod_strings['LBL_CREATE'] . " " . $this->label, 'LNK_LIST' => $mod_strings['LBL_VIEW'] . " " . $this->label, 'LNK_IMPORT_' . strtoupper($this->key_name) => translate('LBL_IMPORT') . " " . $this->label, 'LBL_SEARCH_FORM_TITLE' => $mod_strings['LBL_SEARCH'] . " " . $this->label, 'LBL_HISTORY_SUBPANEL_TITLE' => $mod_strings['LBL_HISTORY'], 'LBL_ACTIVITIES_SUBPANEL_TITLE' => $mod_strings['LBL_ACTIVITIES'], 'LBL_' . strtoupper($this->key_name) . '_SUBPANEL_TITLE' => $this->label, 'LBL_NEW_FORM_TITLE' => $mod_strings['LBL_NEW'] . " " . $this->label);
         foreach ($required as $k => $v) {
             if (empty($values[$k]) || $renameLang) {
                 $values[$k] = $v;
             }
         }
         write_array_to_file('mod_strings', $values, $save_path . '/' . $lang, 'w', $header);
     }
     $app_save_path = $this->path . '/../../language/application';
     mkdir_recursive($app_save_path);
     $key_changed = $this->key_name != $key_name;
     foreach ($this->appListStrings as $lang => $values) {
         // Load previously created modules data
         $app_list_strings = array();
         $neededFile = $app_save_path . '/' . $lang;
         if (file_exists($neededFile)) {
             include $neededFile;
         }
         if (!$duplicate) {
             unset($values['moduleList'][$this->key_name]);
         }
         $values = sugarLangArrayMerge($values, $app_list_strings);
         $values['moduleList'][$key_name] = $this->label;
         $appFile = $header . "\n";
         require_once 'include/utils/array_utils.php';
         $this->getGlobalAppListStringsForMB($values);
         foreach ($values as $key => $array) {
             if ($duplicate) {
                 //keep the original when duplicating
                 $appFile .= override_value_to_string_recursive2('app_list_strings', $key, $array);
             }
             $okey = $key;
             if ($key_changed) {
                 $key = str_replace($this->key_name, $key_name, $key);
             }
             if ($key_changed) {
                 $key = str_replace(strtolower($this->key_name), strtolower($key_name), $key);
             }
             // if we aren't duplicating or the key has changed let's add it
             if (!$duplicate || $okey != $key) {
                 $appFile .= override_value_to_string_recursive2('app_list_strings', $key, $array);
             }
         }
         $fp = sugar_fopen($app_save_path . '/' . $lang, 'w');
         fwrite($fp, $appFile);
         fclose($fp);
     }
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:57,代码来源:MBLanguage.php


示例7: save

 function save($key_name, $duplicate = false, $rename = false)
 {
     $header = file_get_contents('modules/ModuleBuilder/MB/header.php');
     $save_path = $this->path . '/language';
     mkdir_recursive($save_path);
     foreach ($this->strings as $lang => $values) {
         //Check if the module Label or Singular Label has changed.
         $mod_strings = return_module_language(str_replace('.lang.php', '', $lang), 'ModuleBuilder');
         $required = array('LBL_LIST_FORM_TITLE' => $this->label . " " . $mod_strings['LBL_LIST'], 'LBL_MODULE_NAME' => $this->label, 'LBL_MODULE_TITLE' => $this->label, 'LBL_MODULE_NAME_SINGULAR' => $this->label_singular, 'LBL_HOMEPAGE_TITLE' => $mod_strings['LBL_HOMEPAGE_PREFIX'] . " " . $this->label, 'LNK_NEW_RECORD' => $mod_strings['LBL_CREATE'] . " " . $this->label_singular, 'LNK_LIST' => $mod_strings['LBL_VIEW'] . " " . $this->label, 'LNK_IMPORT_' . strtoupper($this->key_name) => translate('LBL_IMPORT') . " " . $this->label_singular, 'LBL_SEARCH_FORM_TITLE' => $mod_strings['LBL_SEARCH'] . " " . $this->label_singular, 'LBL_HISTORY_SUBPANEL_TITLE' => $mod_strings['LBL_HISTORY'], 'LBL_ACTIVITIES_SUBPANEL_TITLE' => $mod_strings['LBL_ACTIVITIES'], 'LBL_' . strtoupper($this->key_name) . '_SUBPANEL_TITLE' => $this->label, 'LBL_NEW_FORM_TITLE' => $mod_strings['LBL_NEW'] . " " . $this->label_singular, 'LNK_IMPORT_VCARD' => translate('LBL_IMPORT') . " " . $this->label_singular . ' vCard', 'LBL_IMPORT' => translate('LBL_IMPORT') . " " . $this->label, 'LBL_IMPORT_VCARDTEXT' => "Automatically create a new {$this->label_singular} record by importing a vCard from your file system.");
         foreach ($required as $k => $v) {
             $values[$k] = $v;
         }
         write_array_to_file('mod_strings', $values, $save_path . '/' . $lang, 'w', $header);
     }
     $app_save_path = $this->path . '/../../language/application';
     sugar_mkdir($app_save_path, null, true);
     $key_changed = $this->key_name != $key_name;
     foreach ($this->appListStrings as $lang => $values) {
         // Load previously created modules data
         $app_list_strings = array();
         $neededFile = $app_save_path . '/' . $lang;
         if (file_exists($neededFile)) {
             include $neededFile;
         }
         if (!$duplicate) {
             unset($values['moduleList'][$this->key_name]);
         }
         $values = sugarLangArrayMerge($values, $app_list_strings);
         $values['moduleList'][$key_name] = $this->label;
         $values['moduleListSingular'][$key_name] = $this->label_singular;
         $appFile = $header . "\n";
         require_once 'include/utils/array_utils.php';
         $this->getGlobalAppListStringsForMB($values);
         foreach ($values as $key => $array) {
             if ($duplicate) {
                 //keep the original when duplicating
                 $appFile .= override_value_to_string_recursive2('app_list_strings', $key, $array);
             }
             $okey = $key;
             if ($key_changed) {
                 $key = str_replace(strtolower($this->key_name), strtolower($key_name), $key);
             }
             // if we aren't duplicating or the key has changed let's add it
             if (!$duplicate || $okey != $key) {
                 if ($rename && isset($this->appListStrings[$lang][$key])) {
                     $arr = $this->appListStrings[$lang][$key];
                 } else {
                     $arr = $array;
                 }
                 $appFile .= override_value_to_string_recursive2('app_list_strings', $key, $arr);
             }
         }
         sugar_file_put_contents_atomic($app_save_path . '/' . $lang, $appFile);
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:55,代码来源:MBLanguage.php


示例8: getConnectorStrings

 /**
  * getConnectorStrings
  * This method returns the language Strings for a given connector instance
  *
  * @param String $source_id String value of the connector id to retrive language strings for
  * @param String $language optional String value for the language to use (defaults to $GLOBALS['current_language'])
  */
 public static function getConnectorStrings($source_id, $language = '')
 {
     global $locale;
     $dir = str_replace('_', '/', $source_id);
     $strings = array();
     $defaultLanguage = $GLOBALS['sugar_config']['default_language'] . '.lang.php';
     $files = array("modules/Connectors/connectors/sources/{$dir}/language/{$defaultLanguage}");
     if ($language != $defaultLanguage) {
         $currentLanguage = (empty($language) ? $locale->getAuthenticatedUserLanguage() : $language) . '.lang.php';
         $files[] = "modules/Connectors/connectors/sources/{$dir}/language/{$currentLanguage}";
     }
     foreach (SugarAutoLoader::existingCustom($files) as $file) {
         require $file;
         if (isset($connector_strings) && is_array($connector_strings)) {
             $strings = sugarLangArrayMerge($strings, $connector_strings);
         }
     }
     if (empty($strings)) {
         $GLOBALS['log']->error("Unable to locate language strings for source {$source_id}");
     }
     return $strings;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:29,代码来源:ConnectorUtils.php


示例9: refreshLanguage

 /**
  * Given a module, search all of the specified locations, and any others as specified
  * in order to refresh the cache file
  *
  * @param string $module the given module we want to load the vardefs for
  * @param string $lang the given language we wish to load
  * @param array $additional_search_paths an array which allows a consumer to pass in additional vardef locations to search
  */
 public static function refreshLanguage($module, $lang, $loaded_mod_strings = array(), $additional_search_paths = null)
 {
     // Some of the vardefs do not correctly define dictionary as global.  Declare it first.
     $lang_paths = self::getModuleLanguageFilePaths($module, $lang);
     $object = BeanFactory::getObjectName($module);
     if ($object && !empty($GLOBALS['dictionary'][$object]['templates'])) {
         $templates = $GLOBALS['dictionary'][$object]['templates'];
         $loaded_mod_strings = LanguageManager::loadTemplateLanguage($module, $templates, $lang, $loaded_mod_strings);
     }
     // Add in additional search paths if they were provided.
     if (!empty($additional_search_paths) && is_array($additional_search_paths)) {
         $lang_paths = array_merge($lang_paths, $additional_search_paths);
     }
     //search a predefined set of locations for the vardef files
     foreach (SugarAutoLoader::existing($lang_paths) as $path) {
         require $path;
         if (!empty($mod_strings)) {
             if (function_exists('sugarArrayMergeRecursive')) {
                 $loaded_mod_strings = sugarArrayMergeRecursive($loaded_mod_strings, $mod_strings);
             } else {
                 $loaded_mod_strings = sugarLangArrayMerge($loaded_mod_strings, $mod_strings);
             }
         }
     }
     //great! now that we have loaded all of our vardefs.
     //let's go save them to the cache file.
     if (!empty($loaded_mod_strings)) {
         LanguageManager::saveCache($module, $lang, $loaded_mod_strings);
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:38,代码来源:LanguageManager.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP sugar_cache_clear函数代码示例发布时间:2022-05-23
下一篇:
PHP sugarArrayMergeRecursive函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap