• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP AppContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中AppContext的典型用法代码示例。如果您正苦于以下问题:PHP AppContext类的具体用法?PHP AppContext怎么用?PHP AppContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: build_view

    public function build_view(HTTPRequestCustom $request)
    {
        $authorized_categories = FaqService::get_authorized_categories(Category::ROOT_CATEGORY);
        $mode = $request->get_getstring('sort', FaqUrlBuilder::DEFAULT_SORT_MODE);
        $field = $request->get_getstring('field', FaqUrlBuilder::DEFAULT_SORT_FIELD);
        $sort_mode = $mode == 'asc' ? 'ASC' : 'DESC';
        switch ($field) {
            case 'question':
                $sort_field = FaqQuestion::SORT_ALPHABETIC;
                break;
            default:
                $sort_field = FaqQuestion::SORT_DATE;
                break;
        }
        $result = PersistenceContext::get_querier()->select('SELECT *
		FROM ' . FaqSetup::$faq_table . ' faq
		LEFT JOIN ' . DB_TABLE_MEMBER . ' member ON member.user_id = faq.author_user_id
		WHERE approved = 0
		AND faq.id_category IN :authorized_categories
		' . (!FaqAuthorizationsService::check_authorizations()->moderation() ? ' AND faq.author_user_id = :user_id' : '') . '
		ORDER BY ' . $sort_field . ' ' . $sort_mode, array('authorized_categories' => $authorized_categories, 'user_id' => AppContext::get_current_user()->get_id()));
        $this->tpl->put_all(array('C_QUESTIONS' => $result->get_rows_count() > 0, 'C_PENDING' => true, 'C_MORE_THAN_ONE_QUESTION' => $result->get_rows_count() > 1, 'C_DISPLAY_TYPE_ANSWERS_HIDDEN' => FaqConfig::load()->is_display_type_answers_hidden(), 'QUESTIONS_NUMBER' => $result->get_rows_count()));
        while ($row = $result->fetch()) {
            $faq_question = new FaqQuestion();
            $faq_question->set_properties($row);
            $this->tpl->assign_block_vars('questions', $faq_question->get_array_tpl_vars());
        }
        $result->dispose();
        $this->build_sorting_form($field, $mode);
    }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:30,代码来源:FaqDisplayPendingFaqQuestionsController.class.php


示例2: execute

 public function execute(HTTPRequestCustom $request)
 {
     $id = $request->get_getint('id', 0);
     if (!empty($id)) {
         try {
             $this->weblink = WebService::get_weblink('WHERE web.id = :id', array('id' => $id));
         } catch (RowNotFoundException $e) {
             $error_controller = PHPBoostErrors::unexisting_page();
             DispatchManager::redirect($error_controller);
         }
     }
     if ($this->weblink !== null && !DownloadAuthorizationsService::check_authorizations($this->weblink->get_id_category())->read()) {
         $error_controller = PHPBoostErrors::user_not_authorized();
         DispatchManager::redirect($error_controller);
     } else {
         if ($this->weblink !== null && $this->weblink->is_visible()) {
             $this->weblink->set_number_views($this->weblink->get_number_views() + 1);
             WebService::update_number_views($this->weblink);
             WebCache::invalidate();
             AppContext::get_response()->redirect($this->weblink->get_url()->absolute());
         } else {
             $error_controller = PHPBoostErrors::unexisting_page();
             DispatchManager::redirect($error_controller);
         }
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:26,代码来源:WebVisitWebLinkController.class.php


示例3: execute

 public function execute(HTTPRequestCustom $request)
 {
     $module_id = $request->get_getstring('module_id', '');
     if (empty($module_id)) {
         AppContext::get_response()->redirect(Environment::get_home_page());
     }
     $this->init();
     $module_category_id = $request->get_getint('module_category_id', 0);
     $feed_name = $request->get_getstring('feed_name', Feed::DEFAULT_FEED_NAME);
     $feed = new ATOM($module_id, $feed_name, $module_category_id);
     if ($feed !== null && $feed->is_in_cache()) {
         $this->tpl->put('SYNDICATION', $feed->read());
     } else {
         $eps = AppContext::get_extension_provider_service();
         if ($eps->provider_exists($module_id, FeedProvider::EXTENSION_POINT)) {
             $provider = $eps->get_provider($module_id);
             $feeds = $provider->feeds();
             $data = $feeds->get_feed_data_struct($module_category_id, $feed_name);
             if ($data === null) {
                 AppContext::get_response()->set_header('content-type', 'text/html');
                 DispatchManager::redirect(PHPBoostErrors::unexisting_element());
             } else {
                 $feed->load_data($data);
                 $feed->cache();
                 $this->tpl->put('SYNDICATION', $feed->export());
             }
         } else {
             DispatchManager::redirect(PHPBoostErrors::module_not_installed());
         }
     }
     return $this->build_response($this->tpl);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:32,代码来源:DisplayAtomSyndicationController.class.php


示例4: display_active_image

 /**
  * @desc This function required object Notation containing the module_name, id_in_module, user_id, note and notation_scale.
  * @param object $notation Notation
  */
 public static function display_active_image(Notation $notation)
 {
     $note_post = AppContext::get_request()->get_int('note', 0);
     $id_post = AppContext::get_request()->get_int('id', 0);
     if (!empty($note_post) && !empty($id_post)) {
         $notation->set_id_in_module($id_post);
         $notation->set_note($note_post);
         self::register_notation($notation);
     } else {
         $template = new FileTemplate('framework/content/notation/notation.tpl');
         $average_notes = $notation->get_average_notes();
         $int = intval($average_notes);
         $decimal = floatval('0.' . substr($average_notes, strpos($average_notes, '.') + 1));
         for ($i = 1; $i <= $notation->get_notation_scale(); $i++) {
             $star_full = false;
             $star_half = false;
             $star_empty = false;
             if ($int >= $i || $int + 1 == $i && $decimal >= 0.75) {
                 $star_full = true;
             } else {
                 if ($int + 1 == $i && $decimal > 0.25 && $decimal < 0.75) {
                     $star_half = true;
                 } else {
                     $star_empty = true;
                 }
             }
             $template->assign_block_vars('star', array('I' => $i, 'STAR_EMPTY' => $star_empty, 'STAR_HALF' => $star_half, 'STAR_FULL' => $star_full));
         }
         $count_notes = $notation->get_number_notes();
         $template->put_all(array('C_JS_NOT_ALREADY_INCLUDED' => !self::$js_already_included, 'C_NOTES' => $count_notes > 0 ? true : false, 'C_MORE_1_NOTES' => $count_notes > 1 ? true : false, 'CURRENT_URL' => REWRITED_SCRIPT, 'ID_IN_MODULE' => $notation->get_id_in_module(), 'NOTATION_SCALE' => $notation->get_notation_scale(), 'NUMBER_NOTES' => $count_notes, 'AVERAGE_NOTES' => $average_notes, 'ALREADY_NOTE' => $notation->user_already_noted(), 'L_NO_NOTE' => LangLoader::get_message('no_note', 'common'), 'L_AUTH_ERROR' => LangLoader::get_message('error.auth', 'status-messages-common'), 'L_ALREADY_NOTE' => self::$lang['already_vote'], 'L_NOTES' => LangLoader::get_message('notes', 'common'), 'L_NOTE' => LangLoader::get_message('note', 'common'), 'L_VALID_NOTE' => LangLoader::get_message('add_note', 'common')));
         self::$js_already_included = true;
         return $template->render();
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:38,代码来源:NotationService.class.php


示例5: clear_caches

 private function clear_caches()
 {
     $cache_service = AppContext::get_cache_service();
     $cache_service->clear_phpboost_cache();
     $cache_service->clear_syndication_cache();
     CLIOutput::writeln('Caches cleared');
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:CLIRestoreDBCommand.class.php


示例6: build_table

    private function build_table()
    {
        $table_model = new SQLHTMLTableModel(DownloadSetup::$download_table, 'table', array(new HTMLTableColumn(LangLoader::get_message('form.name', 'common'), 'name'), new HTMLTableColumn(LangLoader::get_message('category', 'categories-common'), 'id_category'), new HTMLTableColumn(LangLoader::get_message('author', 'common'), 'display_name'), new HTMLTableColumn(LangLoader::get_message('form.date.creation', 'common'), 'creation_date'), new HTMLTableColumn(LangLoader::get_message('status', 'common'), 'approbation_type'), new HTMLTableColumn('')), new HTMLTableSortingRule('creation_date', HTMLTableSortingRule::DESC));
        $table = new HTMLTable($table_model);
        $table_model->set_caption($this->lang['download.management']);
        $results = array();
        $result = $table_model->get_sql_results('download
			LEFT JOIN ' . DB_TABLE_COMMENTS_TOPIC . ' com ON com.id_in_module = download.id AND com.module_id = \'download\'
			LEFT JOIN ' . DB_TABLE_AVERAGE_NOTES . ' notes ON notes.id_in_module = download.id AND notes.module_name = \'download\'
			LEFT JOIN ' . DB_TABLE_NOTE . ' note ON note.id_in_module = download.id AND note.module_name = \'download\' AND note.user_id = ' . AppContext::get_current_user()->get_id() . '
			LEFT JOIN ' . DB_TABLE_MEMBER . ' member ON member.user_id = download.author_user_id', array('*', 'download.id'));
        foreach ($result as $row) {
            $downloadfile = new DownloadFile();
            $downloadfile->set_properties($row);
            $category = $downloadfile->get_category();
            $user = $downloadfile->get_author_user();
            $edit_link = new LinkHTMLElement(DownloadUrlBuilder::edit($downloadfile->get_id()), '', array('title' => LangLoader::get_message('edit', 'common')), 'fa fa-edit');
            $delete_link = new LinkHTMLElement(DownloadUrlBuilder::delete($downloadfile->get_id()), '', array('title' => LangLoader::get_message('delete', 'common'), 'data-confirmation' => 'delete-element'), 'fa fa-delete');
            $user_group_color = User::get_group_color($user->get_groups(), $user->get_level(), true);
            $author = $user->get_id() !== User::VISITOR_LEVEL ? new LinkHTMLElement(UserUrlBuilder::profile($user->get_id()), $user->get_display_name(), !empty($user_group_color) ? array('style' => 'color: ' . $user_group_color) : array(), UserService::get_level_class($user->get_level())) : $user->get_display_name();
            $results[] = new HTMLTableRow(array(new HTMLTableRowCell(new LinkHTMLElement(DownloadUrlBuilder::display($category->get_id(), $category->get_rewrited_name(), $downloadfile->get_id(), $downloadfile->get_rewrited_name()), $downloadfile->get_name()), 'left'), new HTMLTableRowCell(new LinkHTMLElement(DownloadUrlBuilder::display_category($category->get_id(), $category->get_rewrited_name()), $category->get_name())), new HTMLTableRowCell($author), new HTMLTableRowCell($downloadfile->get_creation_date()->format(Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE)), new HTMLTableRowCell($downloadfile->get_status()), new HTMLTableRowCell($edit_link->display() . $delete_link->display())));
        }
        $table->set_rows($table_model->get_number_of_matching_rows(), $results);
        $this->view->put('table', $table->display());
    }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:25,代码来源:AdminDownloadManageController.class.php


示例7: __construct

 public function __construct(Exception $exception)
 {
     $this->exception = $exception;
     $this->type = get_class($this->exception);
     $this->message = str_replace("\n", "<br />", $this->exception->getMessage());
     $this->ob_content = AppContext::get_response()->get_previous_ob_content();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:HTTPFatalExceptionPrinter.class.php


示例8: execute

 function execute(HTTPRequestCustom $request)
 {
     session_start();
     $data = PersistenceContext::get_querier()->select_single_row(PREFIX . 'member', array('user_id'), 'WHERE login=:user_login', array('user_login' => $_SESSION['wpimport']['default_author']));
     $_SESSION['wpimport']['wppath'] = substr($_SESSION['wpimport']['wppath'], -1) != '/' ? $_SESSION['wpimport']['wppath'] . '/' : $_SESSION['wpimport']['wppath'];
     $_SESSION['wpimport']['phpboostpath'] = substr($_SESSION['wpimport']['phpboostpath'], -1) != '/' ? $_SESSION['wpimport']['phpboostpath'] . '/' : $_SESSION['wpimport']['phpboostpath'];
     define('WP_PATH', $_SESSION['wpimport']['wppath']);
     define('PBOOST_PATH', $_SESSION['wpimport']['phpboostpath']);
     define('IMPORTER_LIST', $_SESSION['wpimport']['importer']);
     define('PHPBOOST_CAT_IMAGE', $_SESSION['wpimport']['default_cat_image']);
     define('FILESYSTEM_IMPORT_LOCATION', $_SESSION['wpimport']['import_location']);
     define('DEFAULT_AUTHOR_ID', $data['user_id']);
     ini_set('max_execution_time', 0);
     if (function_exists('xdebug_disable')) {
         xdebug_disable();
     }
     ob_start();
     echo 'Start import : ' . date('H:i:s') . PHP_EOL;
     echo '-----' . PHP_EOL . PHP_EOL;
     $success = (require_once __DIR__ . '/../WP2PhpBoost/wp2phpboost.php');
     echo 'Clean cache...' . PHP_EOL;
     AppContext::get_cache_service()->clear_cache();
     echo PHP_EOL . PHP_EOL;
     echo '-----' . PHP_EOL;
     echo 'End import : ' . date('H:i:s');
     $logs = ob_get_clean();
     return new JSONResponse(array('success' => $success, 'logs' => utf8_decode($logs)));
 }
开发者ID:ppelisset,项目名称:WPImport,代码行数:28,代码来源:WPImportAjaxController.class.php


示例9: get_search_request

 public function get_search_request($args)
 {
     $search = $args['search'];
     $weight = isset($args['weight']) && is_numeric($args['weight']) ? $args['weight'] : 1;
     require_once PATH_TO_ROOT . '/pages/pages_defines.php';
     $categories = PagesCategoriesCache::load()->get_categories();
     $unauth_cats = '';
     if (!AppContext::get_current_user()->check_auth(PagesConfig::load()->get_authorizations(), READ_PAGE)) {
         $unauth_cats .= '0,';
     }
     foreach ($categories as $id => $cat) {
         if (!AppContext::get_current_user()->check_auth($cat['auth'], READ_PAGE)) {
             $unauth_cats .= $id . ',';
         }
     }
     $unauth_cats = !empty($unauth_cats) ? " AND p.id_cat NOT IN (" . trim($unauth_cats, ',') . ")" : '';
     $results = array();
     $result = PersistenceContext::get_querier()->select("SELECT " . $args['id_search'] . " AS `id_search`,\r\n\t\tp.id AS `id_content`,\r\n\t\tp.title AS `title`,\r\n\t\t( 2 * FT_SEARCH_RELEVANCE(p.title, '" . $args['search'] . "') + FT_SEARCH_RELEVANCE(p.contents, '" . $args['search'] . "') ) / 3 * " . $weight . " AS `relevance`,\r\n\t\tCONCAT('" . PATH_TO_ROOT . "/pages/pages.php?title=',p.encoded_title) AS `link`,\r\n\t\tp.auth AS `auth`\r\n\t\tFROM " . PREFIX . "pages p\r\n\t\tWHERE ( FT_SEARCH(title, '" . $args['search'] . "') OR FT_SEARCH(contents, '" . $args['search'] . "') )" . $unauth_cats . "\r\n\t\tLIMIT 100 OFFSET 0");
     while ($row = $result->fetch()) {
         if (!empty($row['auth'])) {
             $auth = unserialize($row['auth']);
             if (!AppContext::get_current_user()->check_auth($auth, READ_PAGE)) {
                 unset($row['auth']);
                 array_push($results, $row);
             }
         } else {
             unset($row['auth']);
             array_push($results, $row);
         }
     }
     $result->dispose();
     return $results;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:33,代码来源:PagesSearchable.class.php


示例10: get_right_controller_regarding_authorizations

 public final function get_right_controller_regarding_authorizations()
 {
     if (!AppContext::get_current_user()->is_admin()) {
         return new UserLoginController(UserLoginController::ADMIN_LOGIN, substr(REWRITED_SCRIPT, strlen(GeneralConfig::load()->get_site_path())));
     }
     return $this;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:AdminController.class.php


示例11: build_form

 public function build_form()
 {
     $form = new HTMLForm(__CLASS__);
     // Fieldset to configure path
     $fieldsetPath = new FormFieldsetHTML('wpimport-path', $this->lang['wpimport.fieldset-path']);
     $form->add_fieldset($fieldsetPath);
     $fieldsetPath->add_field(new FormFieldTextEditor('phpboostpath', $this->lang['wpimport.phpboostpath'], realpath(__DIR__ . '/../../')));
     $fieldsetPath->add_field(new FormFieldTextEditor('wppath', $this->lang['wpimport.wppath'], realpath(__DIR__ . '/../../../'), array(), array(new FormFieldConstraintWordPressPath($this->lang['constraint.wp-path']))));
     // Fieldset to configure which data are import
     $fieldsetImporter = new FormFieldsetHTML('wpimport-importer', $this->lang['wpimport.fieldset-importer']);
     $form->add_fieldset($fieldsetImporter);
     $importers = $this->listImporters();
     foreach ($importers as $importer) {
         $fieldsetImporter->add_field(new FormFieldCheckbox('importer_' . $importer['name'], $importer['name'], FormFieldCheckbox::UNCHECKED, array('description' => $this->lang['wpimport.description'] . ': ' . utf8_decode($importer['description']) . '<br />' . $this->lang['wpimport.version'] . ': ' . $importer['version'])));
     }
     // Fieldset to confgure options
     $fieldsetOptions = new FormFieldsetHTML('wpimport-options', $this->lang['wpimport.fieldset-options']);
     $form->add_fieldset($fieldsetOptions);
     // Default Author
     $fieldsetOptions->add_field(new FormFieldAjaxUserAutoComplete('default_author', $this->lang['wpimport.default_author'], AppContext::get_current_user()->get_login(), array('description' => $this->lang['wpimport.default_author.decription']), array(new FormFieldConstraintUserExist($this->lang['wpimport.default_author.error_user_exist']))));
     // Default Image
     $fieldsetOptions->add_field(new FormFieldUploadFile('default_cat_image', $this->lang['wpimport.default_cat_image'], $this->getDefaultConfiguration()['PHPBOOST_CAT_IMAGE'], array('description' => $this->lang['wpimport.default_cat_image.description'])));
     $fieldsetOptions->add_field(new FormFieldTextEditor('import_location', $this->lang['wpimport.import_location'], $this->getDefaultConfiguration()['FILESYSTEM_IMPORT_LOCATION'], array('description' => $this->lang['wpimport.import_location.description'])));
     $this->submit_button = new FormButtonSubmit($this->lang['wpimport.submit_configuration'], 'submit_configuration');
     $form->add_button($this->submit_button);
     $form->add_button(new FormButtonReset($this->lang['wpimport.reset']));
     $this->form = $form;
 }
开发者ID:ppelisset,项目名称:WPImport,代码行数:28,代码来源:WPImportController.class.php


示例12: check_authorizations

 private function check_authorizations()
 {
     $article = $this->get_article();
     $not_authorized = !ArticlesAuthorizationsService::check_authorizations($article->get_id_category())->write() && (!ArticlesAuthorizationsService::check_authorizations($article->get_id_category())->moderation() && $article->get_author_user()->get_id() != AppContext::get_current_user()->get_id());
     switch ($article->get_publishing_state()) {
         case Article::PUBLISHED_NOW:
             if (!ArticlesAuthorizationsService::check_authorizations()->read() && $not_authorized) {
                 $error_controller = PHPBoostErrors::user_not_authorized();
                 DispatchManager::redirect($error_controller);
             }
             break;
         case Article::NOT_PUBLISHED:
             if ($not_authorized) {
                 $error_controller = PHPBoostErrors::user_not_authorized();
                 DispatchManager::redirect($error_controller);
             }
             break;
         case Article::PUBLISHED_DATE:
             if (!$article->is_published() && $not_authorized) {
                 $error_controller = PHPBoostErrors::user_not_authorized();
                 DispatchManager::redirect($error_controller);
             }
             break;
         default:
             $error_controller = PHPBoostErrors::unexisting_page();
             DispatchManager::redirect($error_controller);
             break;
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:29,代码来源:ArticlesPrintArticlesController.class.php


示例13: save

 private function save(HTTPRequestCustom $request)
 {
     $installed_modules = ModulesManager::get_installed_modules_map();
     foreach ($installed_modules as $module) {
         if ($request->get_string('delete-' . $module->get_id(), '')) {
             AppContext::get_response()->redirect(AdminModulesUrlBuilder::delete_module($module->get_id()));
         }
     }
     if ($request->get_bool('update', false)) {
         $errors = array();
         foreach ($installed_modules as $module) {
             $module_id = $module->get_id();
             $activated = $request->get_bool('activated-' . $module_id, false);
             $error = ModulesManager::update_module($module_id, $activated);
             if (!empty($error)) {
                 $errors[$module->get_configuration()->get_name()] = $error;
             }
         }
         if (empty($errors)) {
             AppContext::get_response()->redirect(AdminModulesUrlBuilder::list_installed_modules());
         } else {
             foreach ($errors as $module_name => $error) {
                 $this->view->assign_block_vars('errors', array('MSG' => MessageHelper::display($module_name . ' : ' . $error, MessageHelper::WARNING, 10)));
             }
         }
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:27,代码来源:AdminModulesManagementController.class.php


示例14: get_content

 public function get_content()
 {
     $tpl = new FileTemplate('newsletter/newsletter_mini.tpl');
     $tpl->add_lang(LangLoader::get('common', 'newsletter'));
     $tpl->put('USER_MAIL', AppContext::get_current_user()->get_email());
     return $tpl;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:NewsletterModuleMiniMenu.class.php


示例15: get_module_map

 private function get_module_map($auth_mode)
 {
     $lang = LangLoader::get('common', 'bugtracker');
     $config = BugtrackerConfig::load();
     $current_user = AppContext::get_current_user();
     $link = new SitemapLink($lang['module_title'], BugtrackerUrlBuilder::home(), Sitemap::FREQ_DEFAULT, Sitemap::PRIORITY_MAX);
     $module_map = new ModuleMap($link, 'bugtracker');
     if ($auth_mode == Sitemap::AUTH_PUBLIC) {
         $this_auth = Authorizations::check_auth(RANK_TYPE, User::VISITOR_LEVEL, $config->get_authorizations(), BugtrackerAuthorizationsService::READ_AUTHORIZATIONS);
     } else {
         if ($auth_mode == Sitemap::AUTH_USER) {
             if ($current_user->get_level() == User::ADMIN_LEVEL) {
                 $this_auth = true;
             } else {
                 $this_auth = Authorizations::check_auth(RANK_TYPE, $current_user->get_level(), $config->get_authorizations(), BugtrackerAuthorizationsService::READ_AUTHORIZATIONS);
             }
         }
     }
     if ($this_auth) {
         $module_map->add(new SitemapLink($lang['titles.unsolved'], BugtrackerUrlBuilder::unsolved()));
         $module_map->add(new SitemapLink($lang['titles.solved'], BugtrackerUrlBuilder::solved()));
         if ($config->is_roadmap_enabled() && $config->get_versions()) {
             $module_map->add(new SitemapLink($lang['titles.roadmap'], BugtrackerUrlBuilder::roadmap()));
         }
         $module_map->add(new SitemapLink($lang['titles.stats'], BugtrackerUrlBuilder::stats()));
     }
     return $module_map;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:28,代码来源:BugtrackerSitemapExtensionPoint.class.php


示例16: execute

 public function execute(HTTPRequestCustom $request)
 {
     $this->load_lang();
     $this->load_config();
     $theme = $request->get_value('theme', 'all');
     if ($theme !== 'all' && !ThemesManager::get_theme_existed($theme)) {
         AppContext::get_response()->redirect(AdminCustomizeUrlBuilder::customize_interface());
     }
     $this->build_form($theme);
     $tpl = new StringTemplate('# INCLUDE MSG # # INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         $header_logo = $this->form->get_value('header_logo', null);
         if ($header_logo !== null) {
             $file_type = new FileType(new File($header_logo->get_name()));
             if ($file_type->is_picture()) {
                 $this->save($header_logo, $theme);
                 AppContext::get_response()->redirect(AdminCustomizeUrlBuilder::customize_interface());
             } else {
                 $tpl->put('MSG', MessageHelper::display(LangLoader::get_message('process.error', 'status-messages-common'), MessageHelper::ERROR, 4));
             }
         } elseif ($this->form->get_value('use_default_logo')) {
             $this->delete_pictures_saved($theme);
             AppContext::get_response()->redirect(AdminCustomizeUrlBuilder::customize_interface());
         } else {
             $tpl->put('MSG', MessageHelper::display(LangLoader::get_message('process.error', 'status-messages-common'), MessageHelper::ERROR, 4));
         }
     }
     $tpl->put('FORM', $this->form->display());
     return new AdminCustomizationDisplayResponse($tpl, $this->lang['customization.interface']);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:AdminCustomizeInterfaceController.class.php


示例17: try_execute

 private function try_execute()
 {
     $this->load_env();
     $this->object_id = AppContext::get_request()->get_getint('menu_config_id');
     $menu_config = MenuConfigurationDAO::instance()->find_by_id($this->object_id);
     $this->view->put_all(array('NAME' => $menu_config->get_name(), 'MATCH_REGEX' => $menu_config->get_match_regex(), 'U_CONFIGURE' => MenuUrlBuilder::menu_configuration_configure($menu_config->get_id())->rel(), 'U_LIST' => MenuUrlBuilder::menu_configuration_list()->rel()));
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:MenuControllerConfigurationEdit.class.php


示例18: init

 private function init()
 {
     $this->user = AppContext::get_current_user();
     $this->tpl = new FileTemplate('user/UserHomeProfileController.tpl');
     $this->lang = LangLoader::get('user-common');
     $this->tpl->add_lang($this->lang);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:UserHomeProfileController.class.php


示例19: build_view

    private function build_view($group_id)
    {
        if (!empty($group_id)) {
            $group = $this->groups_cache->get_group($group_id);
            $this->view->put_all(array('C_ADMIN' => AppContext::get_current_user()->check_level(User::ADMIN_LEVEL), 'U_ADMIN_GROUPS' => TPL_PATH_TO_ROOT . '/admin/admin_groups.php?id=' . $group_id, 'GROUP_NAME' => $group['name']));
        } else {
            $this->view->put_all(array('GROUP_NAME' => $this->lang['groups']));
        }
        $user_accounts_config = UserAccountsConfig::load();
        $number_member = 0;
        foreach ($this->get_members_group($group_id) as $user_id) {
            if (!empty($user_id)) {
                $user = PersistenceContext::get_querier()->select('SELECT 
					member.display_name, member.level, member.groups, member.warning_percentage, member.delay_banned, ext_field.user_avatar
					FROM ' . DB_TABLE_MEMBER . ' member
					LEFT JOIN ' . DB_TABLE_MEMBER_EXTENDED_FIELDS . ' ext_field ON ext_field.user_id = member.user_id
					WHERE member.user_id = :user_id
				', array('user_id' => $user_id))->fetch();
                if (!empty($user)) {
                    //Avatar
                    $user_avatar = !empty($user['user_avatar']) ? Url::to_rel($user['user_avatar']) : ($user_accounts_config->is_default_avatar_enabled() ? Url::to_rel('/templates/' . AppContext::get_current_user()->get_theme() . '/images/' . $user_accounts_config->get_default_avatar_name()) : '');
                    $group_color = User::get_group_color($user['groups'], $user['level']);
                    $this->view->assign_block_vars('members_list', array('C_AVATAR' => $user['user_avatar'] || $user_accounts_config->is_default_avatar_enabled(), 'C_GROUP_COLOR' => !empty($group_color), 'PSEUDO' => $user['display_name'], 'LEVEL' => $user['warning_percentage'] < '100' || time() - $user['delay_banned'] < 0 ? UserService::get_level_lang($user['level']) : $this->lang['banned'], 'LEVEL_CLASS' => UserService::get_level_class($user['level']), 'GROUP_COLOR' => $group_color, 'U_PROFILE' => UserUrlBuilder::profile($user_id)->rel(), 'U_AVATAR' => $user_avatar));
                    $number_member++;
                }
            }
        }
        $this->view->put_all(array('C_NOT_MEMBERS' => $number_member == 0, 'SELECT_GROUP' => $this->build_form($group_id)->display()));
    }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:29,代码来源:UserExploreGroupsController.class.php


示例20: execute

 public function execute(HTTPRequestCustom $request)
 {
     AppContext::get_session()->no_session_location();
     AppContext::get_response()->set_status_code(404);
     AdminError404Service::register_404();
     return parent::execute($request);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:UserError404Controller.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AppController类代码示例发布时间:2022-05-23
下一篇:
PHP AppConfig类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap