本文整理汇总了PHP中erLhcoreClassModelChatConfig::getItems方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassModelChatConfig::getItems方法的具体用法?PHP erLhcoreClassModelChatConfig::getItems怎么用?PHP erLhcoreClassModelChatConfig::getItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassModelChatConfig
的用法示例。
在下文中一共展示了erLhcoreClassModelChatConfig::getItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhchat/listchatconfig.tpl.php');
if ($currentUser->hasAccessTo('lhchat', 'administrateconfig')) {
if (isset($_POST['UpdateConfig'])) {
foreach (erLhcoreClassModelChatConfig::getItems() as $item) {
$ConfigData = erLhcoreClassModelChatConfig::fetch($item->identifier);
switch ($ConfigData->type) {
case erLhcoreClassModelChatConfig::SITE_ACCESS_PARAM_ON:
$data = array();
foreach (erConfigClassLhConfig::getInstance()->getSetting('site', 'available_site_access') as $siteaccess) {
$data[$siteaccess] = $_POST[$item->identifier . 'Value' . $siteaccess];
}
$ConfigData->value = serialize($data);
break;
case erLhcoreClassModelChatConfig::SITE_ACCESS_PARAM_OFF:
$ConfigData->value = isset($_POST[$item->identifier . 'ValueParam']) ? $_POST[$item->identifier . 'ValueParam'] : 0;
break;
default:
break;
}
$ConfigData->saveThis();
}
// Cleanup cache to recompile templates etc.
$CacheManager = erConfigClassLhCacheConfig::getInstance();
$CacheManager->expireCache();
$tpl->set('updated', 'done');
}
}
$tpl->set('currentUser', $currentUser);
$Result['content'] = $tpl->fetch();
示例2: array
<?php
// php cron.php -s site_admin -c cron/util/generate_translation_file
$arrayTranslationsProcess = array();
$items = erLhcoreClassModelChatConfig::getItems(array('limit' => 500, 'filter' => array('hidden' => 0)));
foreach ($items as $item) {
$arrayTranslationsProcess['listchatconfig'][] = $item->explain;
}
$filesToCheck = ezcBaseFile::findRecursive('.', array('@\\.php$@'), array('@/./albums|./ezcomponents|./doc|./translations|./var|./extension|./cache|./bin|./Zend|./setttings|./pos/@'));
$locale = 'en_EN';
foreach ($filesToCheck as $filePath) {
$contentFile = file_get_contents($filePath);
$Matches = array();
preg_match_all('/<\\?php echo erTranslationClassLhTranslation::getInstance\\(\\)->getTranslation\\(\'(.*?)\',\'(.*?)\'\\)(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $section) {
if (!isset($arrayTranslationsProcess[$section])) {
$arrayTranslationsProcess[$section] = array();
}
if (!in_array($Matches[2][$key], $arrayTranslationsProcess[$section])) {
$arrayTranslationsProcess[$section][] = $Matches[2][$key];
}
$contentFile = str_replace($Matches[0][$key], '', $contentFile);
}
$Matches = array();
preg_match_all('/erTranslationClassLhTranslation::getInstance\\(\\)->getTranslation\\(\'(.*?)\',\'(.*?)\'\\)/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $section) {
if (!isset($arrayTranslationsProcess[$section])) {
$arrayTranslationsProcess[$section] = array();
}
if (!in_array($Matches[2][$key], $arrayTranslationsProcess[$section])) {
$arrayTranslationsProcess[$section][] = $Matches[2][$key];