本文整理汇总了PHP中ModuleBuilder::getModuleAliases方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleBuilder::getModuleAliases方法的具体用法?PHP ModuleBuilder::getModuleAliases怎么用?PHP ModuleBuilder::getModuleAliases使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleBuilder
的用法示例。
在下文中一共展示了ModuleBuilder::getModuleAliases方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetModuleAliases
/**
* Testing ModuleBuilder::getModuleAliases
*
* @dataProvider getModuleAliasesData
* @group 46152
*/
public function testGetModuleAliases($module, $needAliases)
{
$aliases = ModuleBuilder::getModuleAliases($module);
foreach ($needAliases as $needAlias) {
$this->assertContains($needAlias, $aliases);
}
}
示例2: action_SaveLabel
function action_SaveLabel()
{
if (!empty($_REQUEST['view_module']) && !empty($_REQUEST['labelValue'])) {
$_REQUEST["label_" . $_REQUEST['label']] = $_REQUEST['labelValue'];
require_once 'modules/ModuleBuilder/parsers/parser.label.php';
$req = $_REQUEST;
foreach (ModuleBuilder::getModuleAliases($_REQUEST['view_module']) as $key) {
$req['view_module'] = $key;
$parser = new ParserLabel($req['view_module'], isset($req['view_package']) ? $req['view_package'] : null);
$parser->handleSave($req, $GLOBALS['current_language']);
}
}
$this->view = 'modulefields';
}
示例3: saveIdLabel
/**
* Save label for id field
*
* @param string $idLabelName
* @param DynamicField $df
*/
protected function saveIdLabel($idLabelName, $df)
{
if ($df instanceof DynamicField) {
$module = $df->module;
} elseif ($df instanceof MBModule) {
$module = $df->name;
} else {
Log::fatal('Unsupported DynamicField type');
}
$viewPackage = isset($df->package) ? $df->package : null;
$idLabelValue = string_format($GLOBALS['mod_strings']['LBL_RELATED_FIELD_ID_NAME_LABEL'], array($this->label_value, $GLOBALS['app_list_strings']['moduleListSingular'][$this->ext2]));
$idFieldLabelArr = array("label_{$idLabelName}" => $idLabelValue);
foreach (ModuleBuilder::getModuleAliases($module) as $moduleName) {
if ($df instanceof DynamicField) {
$parser = new ParserLabel($moduleName, $viewPackage);
$parser->handleSave($idFieldLabelArr, $GLOBALS['current_language']);
} elseif ($df instanceof MBModule) {
$df->setLabel($GLOBALS['current_language'], $idLabelName, $idLabelValue);
$df->save();
}
}
}
示例4: action_SaveLabel
public function action_SaveLabel()
{
if (!empty($_REQUEST['view_module']) && !empty($_REQUEST['labelValue'])) {
$_REQUEST["label_" . $_REQUEST['label']] = $_REQUEST['labelValue'];
// Since the following loop will change aspects of the $_REQUEST
// array read it into a copy to preserve state on $_REQUEST
$req = $_REQUEST;
foreach (ModuleBuilder::getModuleAliases($_REQUEST['view_module']) as $key) {
$req['view_module'] = $key;
$parser = new ParserLabel($req['view_module'], isset($req['view_package']) ? $req['view_package'] : null);
$parser->handleSave($req, $GLOBALS['current_language']);
// Clear the language cache to make sure the view picks up the latest
$cache_key = LanguageManager::getLanguageCacheKey($req['view_module'], $GLOBALS['current_language']);
sugar_cache_clear($cache_key);
}
MetaDataManager::refreshSectionCache(MetaDataManager::MM_LABELS);
MetaDataManager::refreshSectionCache(MetaDataManager::MM_ORDEREDLABELS);
}
$this->view = 'modulefields';
}