本文整理汇总了PHP中E::Module方法的典型用法代码示例。如果您正苦于以下问题:PHP E::Module方法的具体用法?PHP E::Module怎么用?PHP E::Module使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类E
的用法示例。
在下文中一共展示了E::Module方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SubmitComment
protected function SubmitComment()
{
/**
* Проверям авторизован ли пользователь
*/
if (!E::ModuleUser()->IsAuthorization()) {
E::ModuleMessage()->AddErrorSingle(E::ModuleLang()->Get('need_authorization'), E::ModuleLang()->Get('error'));
return;
}
$xResult = E::Module('PluginMagicrules\\Rule')->CheckRuleAction('create_comment', $this->oUserCurrent);
if (true === $xResult) {
$xResult = E::Module('PluginMagicrules\\Rule')->CheckRuleCreateAction('comment', $this->oUserCurrent);
}
if (true === $xResult) {
return parent::SubmitComment();
} else {
if (is_string($xResult)) {
E::ModuleMessage()->AddErrorSingle($xResult, E::ModuleLang()->Get('attention'));
return;
} else {
E::ModuleMessage()->AddErrorSingle(E::ModuleLang()->Get('plugin.magicrules.check_rule_action_error'), E::ModuleLang()->Get('attention'));
return;
}
}
}
示例2: AddVote
public function AddVote(ModuleVote_EntityVote $oVote)
{
$bResult = parent::AddVote($oVote);
if ($bResult) {
E::Module('PluginMagicrules\\Rule')->CheckForCreateBlockVote($oVote);
}
return $bResult;
}
示例3: EventAdd
protected function EventAdd()
{
$xResult = E::Module('PluginMagicrules\\Rule')->CheckRuleAction('create_topic', $this->oUserCurrent);
if ($xResult === true) {
return parent::EventAdd();
} else {
if (is_string($xResult)) {
E::ModuleMessage()->AddErrorSingle($xResult, E::ModuleLang()->Get('attention'));
return Router::Action('error');
} else {
E::ModuleMessage()->AddErrorSingle(E::ModuleLang()->Get('plugin.magicrules.check_rule_action_error'), E::ModuleLang()->Get('attention'));
return Router::Action('error');
}
}
}
示例4: EventWallAdd
/**
* Добавление записи на стену
*/
public function EventWallAdd()
{
// * Устанавливаем формат Ajax ответа
E::ModuleViewer()->SetResponseAjax('json');
// * Пользователь авторизован?
if (!E::IsUser()) {
return parent::EventNotFound();
}
$xResult = E::Module('PluginMagicrules\\Rule')->CheckRuleAction('create_wall', E::User());
if ($xResult === true) {
return parent::EventWallAdd();
} else {
E::ModuleMessage()->AddErrorSingle(E::ModuleLang()->Get('plugin.magicrules.check_rule_action_error'), E::ModuleLang()->Get('attention'));
return Router::Action('error');
}
}
示例5: EventVoteUser
/**
* @return string|void
*/
protected function EventVoteUser()
{
// * Пользователь авторизован?
if (!E::IsUser()) {
E::ModuleMessage()->AddErrorSingle(E::ModuleLang()->Get('need_authorization'), E::ModuleLang()->Get('error'));
return;
}
$xResult = E::Module('PluginMagicrules\\Rule')->CheckRuleAction('vote_user', E::User(), array('vote_value' => (int) $this->getPost('value')));
if (true === $xResult) {
return parent::EventVoteUser();
} else {
if (is_string($xResult)) {
E::ModuleMessage()->AddErrorSingle($xResult, E::ModuleLang()->Get('attention'));
return Router::Action('error');
} else {
E::ModuleMessage()->AddErrorSingle(E::ModuleLang()->Get('plugin.magicrules.check_rule_action_error'), E::ModuleLang()->Get('attention'));
return Router::Action('error');
}
}
}
示例6: MakeCacheKey
/**
* @return bool|string
*/
public function MakeCacheKey()
{
$aStack = debug_backtrace(false);
$sCaller = '';
$sFile = false;
foreach ($aStack as $aItem) {
if ($sFile) {
if (!empty($aItem['class']) && !empty($aItem['type']) && !empty($aItem['function'])) {
$sCaller = $sFile . '|' . $aItem['class'] . $aItem['type'] . $aItem['function'];
break;
}
}
if (!empty($aItem['file']) && !empty($aItem['function']) && $aItem['function'] === __FUNCTION__) {
$sFile = $aItem['file'];
}
}
if ($sCaller) {
$sActivePlugins = E::GetActivePluginsHash();
return E::Module('Cache')->Key($sActivePlugins . '|' . $sCaller, func_get_args());
}
return false;
}
示例7: _initHooks
protected function _initHooks()
{
$this->oModuleHook = E::Module('Hook');
$this->oModuleHook->AddObserver($this->sHookPrefix, array($this, 'HookObserver'));
}