本文整理汇总了PHP中C::Val方法的典型用法代码示例。如果您正苦于以下问题:PHP C::Val方法的具体用法?PHP C::Val怎么用?PHP C::Val使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C
的用法示例。
在下文中一共展示了C::Val方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _addTopic
/**
* Adds new topic
*
* @param $oTopic
*
* @return bool|ModuleTopic_EntityTopic
*/
protected function _addTopic($oTopic)
{
if (!E::IsAdminOrModerator()) {
$xUserRatingOut = C::Val('plugin.sandbox.user_rating_out', false);
if ($xUserRatingOut === false || E::User()->getUserRating() < $xUserRatingOut) {
$oTopic->setTopicStatus(TOPIC_STATUS_SANDBOX);
}
}
return parent::_addTopic($oTopic);
}
示例2: PrepareRegExp
protected function PrepareRegExp($sRegExp)
{
$sRegExpPrim = str_replace('[[:>:]]|[[:<:]]', '[[:space:]]+', $sRegExp);
$sRegExpPrim = str_replace('|[[:<:]]', '[[:alnum:]]+[[:space:]]+', $sRegExpPrim);
$sRegExpPrim = str_replace('[[:>:]]|', '[[:space:]]+[[:alnum:]]+', $sRegExpPrim);
$aRegExp = array('phrase' => $sRegExpPrim, 'words' => $sRegExp);
if (strpos($sRegExp, '[[:>:]]|[[:<:]]')) {
$aWords = explode('[[:>:]]|[[:<:]]', $sRegExp, C::Get('module.search.rate.limit'));
foreach ($aWords as $iIndex => $sWord) {
if (substr($sWord, 0, 7) !== '[[:<:]]') {
$aWords[$iIndex] = '[[:<:]]' . $sWord;
}
if (substr($sWord, -7) !== '[[:>:]]') {
$aWords[$iIndex] .= '[[:>:]]';
}
}
} else {
$aWords = array();
}
$aRates = array('phrase' => (count($aWords) + 1) * C::Val('module.search.rate.phrase', 1), 'words' => C::Val('module.search.rate.words', 1), 'title' => C::Val('module.search.rate.title', 1));
return array('regexp' => $aRegExp, 'words' => $aWords, 'rates' => $aRates);
}
示例3: Exec
/**
* Запуск обработки
*/
public function Exec()
{
$iLimit = C::Val('widgets.tags.params.limit', 70);
// * Получаем список тегов
$aTags = E::ModuleTopic()->GetOpenTopicTags($iLimit);
// * Расчитываем логарифмическое облако тегов
if ($aTags) {
E::ModuleTools()->MakeCloud($aTags);
// * Устанавливаем шаблон вывода
E::ModuleViewer()->Assign('aTags', $aTags);
}
// * Теги пользователя
if ($oUserCurrent = E::ModuleUser()->GetUserCurrent()) {
$aTags = E::ModuleTopic()->GetOpenTopicTags($iLimit, $oUserCurrent->getId());
// * Расчитываем логарифмическое облако тегов
if ($aTags) {
E::ModuleTools()->MakeCloud($aTags);
// * Устанавливаем шаблон вывода
E::ModuleViewer()->Assign('aTagsUser', $aTags);
}
}
}
示例4: _initRender
/**
* Initialization of render before Fetch() or Display()
*
* @param bool $bForce
*/
protected function _initRender($bForce = false)
{
if ($this->bInitRender && !$bForce) {
return;
}
$nTimer = microtime(true);
E::ModuleHook()->Run('render_init_start', array('bLocal' => $this->bLocal));
// If skin not initialized (or it was changed) then init one
if ($this->sViewSkin != $this->GetConfigSkin()) {
$this->_initSkin();
} else {
// Level could be changed after skin initialization
Config::SetLevel(Config::LEVEL_SKIN_CUSTOM);
}
// init templator if not yet
$this->_initTemplator();
// Loads localized texts
$aLang = E::ModuleLang()->GetLangMsg();
// Old skin compatibility
$aLang['registration_password_notice'] = E::ModuleLang()->Get('registration_password_notice', array('min' => C::Val('module.security.password_len', 3)));
$this->Assign('aLang', $aLang);
//$this->Assign('oLang', E::ModuleLang()->Dictionary());
if (!$this->bLocal && !$this->GetResponseAjax()) {
// Initialization of assets (JS-, CSS-files)
$this->InitAssetFiles();
}
$oSkin = E::ModuleSkin()->GetSkin($this->sViewSkin);
if (!$oSkin || !$oSkin->GetCompatible() || $oSkin->SkinCompatible('1.1', '<')) {
// Для старых скинов загружаем объект доступа к конфигурации
$this->Assign('oConfig', Config::getInstance());
}
E::ModuleHook()->Run('render_init_done', array('bLocal' => $this->bLocal));
$this->bInitRender = true;
self::$_preprocessTime += microtime(true) - $nTimer;
}
示例5: _defineImageSize
/**
* @param string $sImageType
* @param string|int $xSize
*
* @return array
*/
protected function _defineImageSize($sImageType, $xSize)
{
$sSize = C::Val('module.uploader.images.' . $sImageType . '.size.' . $xSize, $xSize);
return F::File_ImgModAttr($sSize);
}