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


PHP Context::getMessageAndClear方法代码示例

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


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

示例1: runShowArticle

 /**
  * Show an article
  *
  * @param \thebuggenie\core\framework\Request $request
  */
 public function runShowArticle(framework\Request $request)
 {
     if ($this->special) {
         $this->redirect('specialArticle');
     }
     $this->message = framework\Context::getMessageAndClear('publish_article_message');
     $this->error = framework\Context::getMessageAndClear('publish_article_error');
     $this->redirected_from = framework\Context::getMessageAndClear('publish_redirected_article');
     if ($this->article instanceof Article) {
         if (!$this->article->hasAccess()) {
             $this->error = framework\Context::getI18n()->__("You don't have access to read this article");
             $this->article = null;
         } else {
             $this->getUser()->markNotificationsRead('article', $this->article->getID());
             if (!$request->hasParameter('no_redirect') && $this->article->isRedirect()) {
                 if ($redirect_article = $this->article->getRedirectArticleName()) {
                     framework\Context::setMessage('publish_redirected_article', $this->article->getName());
                     $this->forward(framework\Context::getRouting()->generate('publish_article', array('article_name' => $redirect_article)));
                 }
             }
             try {
                 if ($request->hasParameter('revision')) {
                     $this->revision = $request['revision'];
                     $this->article->setRevision($this->revision);
                 }
             } catch (\Exception $e) {
                 $this->error = framework\Context::getI18n()->__('There was an error trying to show this revision');
             }
         }
     }
 }
开发者ID:shoreless-Limited,项目名称:thebuggenie,代码行数:36,代码来源:Actions.php

示例2: __

                    <div class="issue_info error" id="viewissue_error">
                        <?php 
        if ($error == 'transition_error') {
            ?>
                            <div class="header"><?php 
            echo __('There was an error trying to move this issue to the next step in the workflow');
            ?>
</div>
                            <div class="content" style="text-align: left;">
                                <?php 
            echo __('The following actions could not be performed because of missing or invalid values: %list', array('%list' => ''));
            ?>
<br>
                                <ul>
                                    <?php 
            foreach (\thebuggenie\core\framework\Context::getMessageAndClear('issue_workflow_errors') as $error_field) {
                ?>
                                        <li><?php 
                switch ($error_field) {
                    case \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_MAX_ASSIGNED_ISSUES:
                        echo __('Could not assign issue to the selected user because this users assigned issues limit is reached');
                        break;
                    case \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_PRIORITY_VALID:
                        echo __('Could not set priority');
                        break;
                    case \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_REPRODUCABILITY_VALID:
                        echo __('Could not set reproducability');
                        break;
                    case \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_RESOLUTION_VALID:
                        echo __('Could not set resolution');
                        break;
开发者ID:shoreless-Limited,项目名称:thebuggenie,代码行数:31,代码来源:viewissue.html.php

示例3: 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

示例4: runReleaseCenter

 public function runReleaseCenter(framework\Request $request)
 {
     $this->forward403if(framework\Context::getCurrentProject()->isArchived() || !$this->getUser()->canManageProjectReleases(framework\Context::getCurrentProject()));
     $this->build_error = framework\Context::getMessageAndClear('build_error');
 }
开发者ID:JonathanRH,项目名称:thebuggenie,代码行数:5,代码来源:Main.php

示例5: runScope

 public function runScope(framework\Request $request)
 {
     $this->scope = new entities\Scope($request['id']);
     $modules = tables\Modules::getTable()->getModulesForScope($this->scope->getID());
     $this->modules = $modules;
     $this->scope_save_error = framework\Context::getMessageAndClear('scope_save_error');
     if ($request->isPost()) {
         try {
             if ($request['scope_action'] == 'delete') {
                 if (!$this->scope->isDefault()) {
                     $this->scope->delete();
                     framework\Context::setMessage('scope_deleted', true);
                     $this->forward(make_url('configure_scopes'));
                 } else {
                     $this->scope_save_error = $this->getI18n()->__('You cannot delete the default scope');
                 }
             } else {
                 if (!$request['name']) {
                     throw new \Exception($this->getI18n()->__('Please specify a scope name'));
                 }
                 $this->scope->setName($request['name']);
                 $this->scope->setDescription($request['description']);
                 $this->scope->setCustomWorkflowsEnabled((bool) $request['custom_workflows_enabled']);
                 $this->scope->setMaxWorkflowsLimit((int) $request['workflow_limit']);
                 $this->scope->setUploadsEnabled((bool) $request['file_uploads_enabled']);
                 $this->scope->setMaxUploadLimit((int) $request['upload_limit']);
                 $this->scope->setMaxProjects((int) $request['project_limit']);
                 $this->scope->setMaxUsers((int) $request['user_limit']);
                 $this->scope->setMaxTeams((int) $request['team_limit']);
                 $this->scope->save();
                 $enabled_modules = $request['module_enabled'];
                 $prev_scope = framework\Context::getScope();
                 foreach ($enabled_modules as $module => $enabled) {
                     if (!framework\Context::getModule($module)->isCore() && !$enabled && array_key_exists($module, $modules)) {
                         $module = tables\Modules::getTable()->getModuleForScope($module, $this->scope->getID());
                         $module->uninstall($this->scope->getID());
                     } elseif (!framework\Context::getModule($module)->isCore() && $enabled && !array_key_exists($module, $modules)) {
                         framework\Context::setScope($this->scope);
                         entities\Module::installModule($module);
                         framework\Context::setScope($prev_scope);
                     }
                 }
                 framework\Context::setMessage('scope_saved', true);
                 $this->forward(make_url('configure_scopes'));
             }
         } catch (\Exception $e) {
             framework\Context::setMessage('scope_save_error', $e->getMessage());
         }
     }
 }
开发者ID:nrensen,项目名称:thebuggenie,代码行数:50,代码来源:Main.php

示例6: 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

示例7: runFindIssues

 /**
  * Performs the "find issues" action
  *
  * @param framework\Request $request
  */
 public function runFindIssues(framework\Request $request)
 {
     $this->resultcount = 0;
     if ($request['quicksearch'] == true) {
         if ($request->isAjaxCall()) {
             return $this->redirect('quicksearch');
         } else {
             $issues = $this->issues;
             $issue = array_shift($issues);
             if ($issue instanceof entities\Issue) {
                 return $this->forward($this->getRouting()->generate('viewissue', array('project_key' => $issue->getProject()->getKey(), 'issue_no' => $issue->getFormattedIssueNo())));
             }
         }
     }
     if ($this->search_object->hasQuickfoundIssues()) {
         $issues = $this->search_object->getQuickfoundIssues();
         $issue = array_shift($issues);
         if ($issue instanceof entities\Issue) {
             return $this->forward($this->getRouting()->generate('viewissue', array('project_key' => $issue->getProject()->getKey(), 'issue_no' => $issue->getFormattedIssueNo())));
         }
     }
     $this->search_error = framework\Context::getMessageAndClear('search_error');
     $this->search_message = framework\Context::getMessageAndClear('search_message');
     $this->appliedfilters = $this->filters;
     $this->templates = entities\SavedSearch::getTemplates();
 }
开发者ID:RTechSoft,项目名称:thebuggenie,代码行数:31,代码来源:Actions.php


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