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


PHP erLhcoreClassModelChatConfig::getItems方法代碼示例

本文整理匯總了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();
開發者ID:sudogitguy,項目名稱:livehelperchat,代碼行數:31,代碼來源:listchatconfig.php

示例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];
開發者ID:mdb-webdev,項目名稱:livehelperchat,代碼行數:31,代碼來源:generate_translation_file.php


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