本文整理汇总了PHP中TBGContext::hasMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP TBGContext::hasMessage方法的具体用法?PHP TBGContext::hasMessage怎么用?PHP TBGContext::hasMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBGContext
的用法示例。
在下文中一共展示了TBGContext::hasMessage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runConfigureModule
/**
* Configure a module
*
* @param TBGRequest $request The request object
*/
public function runConfigureModule(TBGRequest $request)
{
$this->forward403unless($this->access_level == TBGSettings::ACCESS_FULL);
try {
$module = TBGContext::getModule($request->getParameter('config_module'));
if (!$module->isEnabled()) {
throw new Exception('disabled');
} elseif (!$module->hasConfigSettings()) {
throw new Exception('module not configurable');
} else {
if ($request->isMethod(TBGRequest::POST) && $this->access_level == TBGSettings::ACCESS_FULL) {
try {
$module->postConfigSettings($request);
if (!TBGContext::hasMessage('module_message')) {
TBGContext::setMessage('module_message', TBGContext::getI18n()->__('Settings saved successfully'));
}
} catch (Exception $e) {
TBGContext::setMessage('module_error', $e->getMessage());
}
$this->forward(TBGContext::getRouting()->generate('configure_module', array('config_module' => $request->getParameter('config_module'))));
}
$this->module = $module;
}
} catch (Exception $e) {
TBGLogging::log('Trying to configure module ' . $request->getParameter('config_module') . " which isn't configurable", 'main', TBGLogging::LEVEL_FATAL);
TBGContext::setMessage('module_error', TBGContext::getI18n()->__('The module "%module_name%" is not configurable', array('%module_name%' => $request->getParameter('config_module'))));
$this->forward(TBGContext::getRouting()->generate('configure_modules'));
}
$this->module_message = TBGContext::getMessageAndClear('module_message');
$this->module_error = TBGContext::getMessageAndClear('module_error');
$this->module_error_details = TBGContext::getMessageAndClear('module_error_details');
}
示例2: listenViewIssuePostError
public function listenViewIssuePostError(TBGEvent $event)
{
if (TBGContext::hasMessage('comment_error')) {
$this->comment_error = true;
$this->error = TBGContext::getMessageAndClear('comment_error');
$this->comment_error_title = TBGContext::getMessageAndClear('comment_error_title');
$this->comment_error_body = TBGContext::getMessageAndClear('comment_error_body');
}
}
示例3: include_component
<div id="login_backdrop">
<div class="backdrop_box login_page login_popup" id="login_popup">
<div id="backdrop_detail_content" class="backdrop_detail_content rounded_top login_content">
<?php
include_component('main/login', compact('section', 'error'));
?>
</div>
</div>
</div>
<script type="text/javascript">
<?php
if (TBGContext::hasMessage('login_message')) {
?>
TBG.Main.Helpers.Message.success('<?php
echo TBGContext::getMessageAndClear('login_message');
?>
');
<?php
} elseif (TBGContext::hasMessage('login_message_err')) {
?>
TBG.Main.Helpers.Message.error('<?php
echo TBGContext::getMessageAndClear('login_message_err');
?>
');
<?php
}
?>
document.observe('dom:loaded', function() {
$('tbg3_username').focus();
});
</script>
示例4: componentLogin
public function componentLogin()
{
$this->selected_tab = isset($this->section) ? $this->section : 'login';
$this->options = $this->getParameterHolder();
if (TBGContext::hasMessage('login_referer')) {
$this->referer = htmlentities(TBGContext::getMessage('login_referer'), ENT_COMPAT, TBGContext::getI18n()->getCharset());
} elseif (array_key_exists('HTTP_REFERER', $_SERVER)) {
$this->referer = htmlentities($_SERVER['HTTP_REFERER'], ENT_COMPAT, TBGContext::getI18n()->getCharset());
} else {
$this->referer = TBGContext::getRouting()->generate('dashboard');
}
try {
$this->loginintro = null;
$this->registrationintro = null;
$this->loginintro = TBGArticlesTable::getTable()->getArticleByName('LoginIntro');
$this->registrationintro = TBGArticlesTable::getTable()->getArticleByName('RegistrationIntro');
} catch (Exception $e) {
}
if (TBGSettings::isLoginRequired()) {
TBGContext::getResponse()->deleteCookie('tbg3_username');
TBGContext::getResponse()->deleteCookie('tbg3_password');
$this->error = TBGContext::geti18n()->__('You need to log in to access this site');
} elseif (!TBGContext::getUser()->isAuthenticated()) {
$this->error = TBGContext::geti18n()->__('Please log in');
} else {
//$this->error = TBGContext::geti18n()->__('Please log in');
}
}
示例5: make_url
?>
<?php
}
?>
<form accept-charset="<?php
echo TBGContext::getI18n()->getCharset();
?>
" action="<?php
echo make_url('login');
?>
" method="post" id="login_form" onsubmit="TBG.Main.Login.login('<?php
echo make_url('login');
?>
'); return false;">
<?php
if (!TBGContext::hasMessage('login_force_redirect') || TBGContext::getMessage('login_force_redirect') !== true) {
?>
<input type="hidden" id="tbg3_referer" name="tbg3_referer" value="<?php
echo $referer;
?>
" />
<?php
} else {
?>
<input type="hidden" id="return_to" name="return_to" value="<?php
echo $referer;
?>
" />
<?php
}
?>
示例6: __
<input type="submit" id="login_button" class="button button-silver" value="<?php
echo __('Authenticate');
?>
">
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript">
<?php
if (TBGContext::hasMessage('elevated_login_message')) {
?>
TBG.Main.Helpers.Message.success('<?php
echo TBGContext::getMessageAndClear('elevated_login_message');
?>
');
<?php
} elseif (TBGContext::hasMessage('elevated_login_message_err')) {
?>
TBG.Main.Helpers.Message.error('<?php
echo TBGContext::getMessageAndClear('elevated_login_message_err');
?>
');
<?php
}
?>
document.observe('dom:loaded', function() {
$('tbg3_password').focus();
});
</script>