当前位置: 首页>>代码示例>>PHP>>正文


PHP Context::hasMessage方法代码示例

本文整理汇总了PHP中thebuggenie\core\framework\Context::hasMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::hasMessage方法的具体用法?PHP Context::hasMessage怎么用?PHP Context::hasMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在thebuggenie\core\framework\Context的用法示例。


在下文中一共展示了Context::hasMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: make_url

    ?>
    <?php 
}
?>
    <form accept-charset="<?php 
echo \thebuggenie\core\framework\Context::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 (!\thebuggenie\core\framework\Context::hasMessage('login_force_redirect') || \thebuggenie\core\framework\Context::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 
}
?>
开发者ID:founderio,项目名称:thebuggenie,代码行数:31,代码来源:_login.inc.php

示例2: include_component

        <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">
    require(['domReady', 'thebuggenie/tbg', 'jquery'], function (domReady, TBG, jquery) {
        domReady(function () {
        <?php 
if (\thebuggenie\core\framework\Context::hasMessage('login_message')) {
    ?>
            TBG.Main.Helpers.Message.success('<?php 
    echo \thebuggenie\core\framework\Context::getMessageAndClear('login_message');
    ?>
');
        <?php 
} elseif (\thebuggenie\core\framework\Context::hasMessage('login_message_err')) {
    ?>
            TBG.Main.Helpers.Message.error('<?php 
    echo \thebuggenie\core\framework\Context::getMessageAndClear('login_message_err');
    ?>
');
        <?php 
}
?>
            jquery('#tbg3_username').focus();
        });
    });
</script>
开发者ID:pkdevboxy,项目名称:thebuggenie,代码行数:31,代码来源:login.html.php

示例3: runConfigureModule

 /**
  * Configure a module
  *
  * @param framework\Request $request The request object
  */
 public function runConfigureModule(framework\Request $request)
 {
     $this->forward403unless($this->access_level == framework\Settings::ACCESS_FULL);
     try {
         $module = framework\Context::getModule($request['config_module']);
         if (!$module->isEnabled()) {
             throw new \Exception('disabled');
         } elseif (!$module->hasConfigSettings()) {
             throw new \Exception('module not configurable');
         } else {
             if ($request->isPost() && $this->access_level == framework\Settings::ACCESS_FULL) {
                 try {
                     $module->postConfigSettings($request);
                     if (!framework\Context::hasMessage('module_message')) {
                         framework\Context::setMessage('module_message', framework\Context::getI18n()->__('Settings saved successfully'));
                     }
                 } catch (\Exception $e) {
                     framework\Context::setMessage('module_error', $e->getMessage());
                 }
                 $this->forward(framework\Context::getRouting()->generate('configure_module', array('config_module' => $request['config_module'])));
             }
             $this->module = $module;
         }
     } catch (\Exception $e) {
         framework\Logging::log('Trying to configure module ' . $request['config_module'] . " which isn't configurable", 'main', framework\Logging::LEVEL_FATAL);
         framework\Context::setMessage('module_error', framework\Context::getI18n()->__('The module "%module_name" is not configurable', array('%module_name' => $request['config_module'])));
         $this->forward(framework\Context::getRouting()->generate('configure_modules'));
     }
     $this->module_message = framework\Context::getMessageAndClear('module_message');
     $this->module_error = framework\Context::getMessageAndClear('module_error');
     $this->module_error_details = framework\Context::getMessageAndClear('module_error_details');
 }
开发者ID:nrensen,项目名称:thebuggenie,代码行数:37,代码来源:Main.php

示例4: componentLogin

 public function componentLogin()
 {
     $this->selected_tab = isset($this->section) ? $this->section : 'login';
     $this->options = $this->getParameterHolder();
     if (framework\Context::hasMessage('login_referer')) {
         $this->referer = htmlentities(framework\Context::getMessage('login_referer'), ENT_COMPAT, framework\Context::getI18n()->getCharset());
     } elseif (array_key_exists('HTTP_REFERER', $_SERVER)) {
         $this->referer = htmlentities($_SERVER['HTTP_REFERER'], ENT_COMPAT, framework\Context::getI18n()->getCharset());
     } else {
         $this->referer = framework\Context::getRouting()->generate('dashboard');
     }
     try {
         $this->loginintro = null;
         $this->registrationintro = null;
         $this->loginintro = \thebuggenie\modules\publish\entities\tables\Articles::getTable()->getArticleByName('LoginIntro');
         $this->registrationintro = \thebuggenie\modules\publish\entities\tables\Articles::getTable()->getArticleByName('RegistrationIntro');
     } catch (\Exception $e) {
     }
     if (framework\Settings::isLoginRequired()) {
         framework\Context::getResponse()->deleteCookie('tbg3_username');
         framework\Context::getResponse()->deleteCookie('tbg3_password');
         $this->error = framework\Context::geti18n()->__('You need to log in to access this site');
     } elseif (!framework\Context::getUser()->isAuthenticated()) {
         $this->error = framework\Context::geti18n()->__('Please log in');
     } else {
         //$this->error = framework\Context::geti18n()->__('Please log in');
     }
 }
开发者ID:founderio,项目名称:thebuggenie,代码行数:28,代码来源:Components.php

示例5: listenViewIssuePostError

 public function listenViewIssuePostError(\thebuggenie\core\framework\Event $event)
 {
     if (framework\Context::hasMessage('comment_error')) {
         $this->comment_error = true;
         $this->error = framework\Context::getMessageAndClear('comment_error');
         $this->comment_error_body = framework\Context::getMessageAndClear('comment_error_body');
     }
 }
开发者ID:nrensen,项目名称:thebuggenie,代码行数:8,代码来源:Main.php


注:本文中的thebuggenie\core\framework\Context::hasMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。