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


PHP Utils::escape方法代码示例

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


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

示例1: display

 public function display()
 {
     if ($this->user->g_search == '0') {
         throw new Error(__('No search permission'), 403);
     }
     // Figure out what to do :-)
     if ($this->request->get('action') || $this->request->get('search_id')) {
         $search = $this->model->get_search_results();
         // We have results to display
         if (isset($search['is_result'])) {
             $this->feather->template->setPageInfo(array('title' => array(Utils::escape($this->config['o_board_title']), __('Search results')), 'active_page' => 'search'));
             $this->model->display_search_results($search, $this->feather);
             $this->feather->template->setPageInfo(array('search' => $search));
             $this->feather->template->addTemplate('search/header.php', 1);
             if ($search['show_as'] == 'posts') {
                 $this->feather->template->addTemplate('search/posts.php', 5);
             } else {
                 $this->feather->template->addTemplate('search/topics.php', 5);
             }
             $this->feather->template->addTemplate('search/footer.php', 10)->display();
         } else {
             Url::redirect($this->feather->urlFor('search'), __('No hits'));
         }
     } else {
         $this->feather->template->setPageInfo(array('title' => array(Utils::escape($this->config['o_board_title']), __('Search')), 'active_page' => 'search', 'focus_element' => array('search', 'keywords'), 'is_indexed' => true, 'forums' => $this->model->get_list_forums()))->addTemplate('search/form.php')->display();
     }
 }
开发者ID:bohwaz,项目名称:featherbb,代码行数:27,代码来源:Search.php

示例2: display

 public function display($req, $res, $args)
 {
     Container::get('hooks')->fire('controller.search.display');
     if (User::get()->g_search == '0') {
         throw new Error(__('No search permission'), 403);
     }
     // Figure out what to do :-)
     if (Input::query('action') || Input::query('search_id')) {
         $search = $this->model->get_search_results();
         // We have results to display
         if (!is_object($search) && isset($search['is_result'])) {
             View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Search results')), 'active_page' => 'search', 'search' => $search, 'footer' => $search));
             $display = $this->model->display_search_results($search);
             View::setPageInfo(array('display' => $display));
             View::addTemplate('search/header.php', 1);
             if ($search['show_as'] == 'posts') {
                 View::addTemplate('search/posts.php', 5);
             } else {
                 View::addTemplate('search/topics.php', 5);
             }
             View::addTemplate('search/footer.php', 10)->display();
         } else {
             return Router::redirect(Router::pathFor('search'), __('No hits'));
         }
     } else {
         View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Search')), 'active_page' => 'search', 'focus_element' => array('search', 'keywords'), 'is_indexed' => true, 'forums' => $this->model->get_list_forums()))->addTemplate('search/form.php')->display();
     }
 }
开发者ID:featherbb,项目名称:featherbb,代码行数:28,代码来源:Search.php

示例3: display

 public function display($req, $res, $args)
 {
     Container::get('hooks')->fire('controller.admin.statistics.display');
     AdminUtils::generateAdminMenu('index');
     $total = $this->model->get_total_size();
     return View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Server statistics')), 'active_page' => 'admin', 'admin_console' => true, 'server_load' => $this->model->get_server_load(), 'num_online' => $this->model->get_num_online(), 'total_size' => $total['size'], 'total_records' => $total['records'], 'php_accelerator' => $this->model->get_php_accelerator()))->addTemplate('admin/statistics.php')->display();
 }
开发者ID:featherbb,项目名称:featherbb,代码行数:7,代码来源:Statistics.php

示例4: display

 public function display($req, $res, $args)
 {
     Container::get('hooks')->fire('controller.admin.maintenance.display');
     $action = '';
     if (Input::post('action')) {
         $action = Input::post('action');
     } elseif (Input::query('action')) {
         $action = Input::query('action');
     }
     if ($action == 'rebuild') {
         $this->model->rebuild();
         View::setPageInfo(array('page_title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Rebuilding search index')), 'query_str' => $this->model->get_query_str()))->addTemplate('admin/maintenance/rebuild.php')->display();
     }
     if ($action == 'prune') {
         $prune_from = Utils::trim(Input::post('prune_from'));
         $prune_sticky = intval(Input::post('prune_sticky'));
         AdminUtils::generateAdminMenu('maintenance');
         if (Input::post('prune_comply')) {
             $this->model->prune_comply($prune_from, $prune_sticky);
         }
         View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Prune')), 'active_page' => 'admin', 'admin_console' => true, 'prune_sticky' => $prune_sticky, 'prune_from' => $prune_from, 'prune' => $this->model->get_info_prune($prune_sticky, $prune_from)))->addTemplate('admin/maintenance/prune.php')->display();
     }
     AdminUtils::generateAdminMenu('maintenance');
     View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Maintenance')), 'active_page' => 'admin', 'admin_console' => true, 'first_id' => $this->model->get_first_id(), 'categories' => $this->model->get_categories()))->addTemplate('admin/maintenance/admin_maintenance.php')->display();
 }
开发者ID:featherbb,项目名称:featherbb,代码行数:25,代码来源:Maintenance.php

示例5: display

 public function display($req, $res, $args)
 {
     Container::get('hooks')->fire('controller.userlist.display');
     if (User::get()->g_view_users == '0') {
         throw new Error(__('No permission'), 403);
     }
     // Determine if we are allowed to view post counts
     $show_post_count = ForumSettings::get('o_show_post_count') == '1' || User::get()->is_admmod ? true : false;
     $username = Input::query('username') && User::get()->g_search_users == '1' ? Utils::trim(Input::query('username')) : '';
     $show_group = Input::query('show_group') ? intval(Input::query('show_group')) : -1;
     $sort_by = Input::query('sort_by') && (in_array(Input::query('sort_by'), array('username', 'registered')) || Input::query('sort_by') == 'num_posts' && $show_post_count) ? Input::query('sort_by') : 'username';
     $sort_dir = Input::query('sort_dir') && Input::query('sort_dir') == 'DESC' ? 'DESC' : 'ASC';
     $num_users = $this->model->fetch_user_count($username, $show_group);
     // Determine the user offset (based on $page)
     $num_pages = ceil($num_users / 50);
     $p = !Input::query('p') || $page <= 1 || $page > $num_pages ? 1 : intval($page);
     $start_from = 50 * ($p - 1);
     if (User::get()->g_search_users == '1') {
         $focus_element = array('userlist', 'username');
     } else {
         $focus_element = array();
     }
     // Generate paging links
     $paging_links = '<span class="pages-label">' . __('Pages') . ' </span>' . Url::paginate_old($num_pages, $p, '?username=' . urlencode($username) . '&amp;show_group=' . $show_group . '&amp;sort_by=' . $sort_by . '&amp;sort_dir=' . $sort_dir);
     View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('User list')), 'active_page' => 'userlist', 'page_number' => $p, 'paging_links' => $paging_links, 'focus_element' => $focus_element, 'is_indexed' => true, 'username' => $username, 'show_group' => $show_group, 'sort_by' => $sort_by, 'sort_dir' => $sort_dir, 'show_post_count' => $show_post_count, 'dropdown_menu' => $this->model->generate_dropdown_menu($show_group), 'userlist_data' => $this->model->print_users($username, $start_from, $sort_by, $sort_dir, $show_group)))->addTemplate('userlist.php')->display();
 }
开发者ID:featherbb,项目名称:featherbb,代码行数:26,代码来源:Userlist.php

示例6: display

 public function display()
 {
     if ($this->feather->request->isPost()) {
         $this->model->update_options();
     }
     AdminUtils::generateAdminMenu('options');
     $this->feather->template->setPageInfo(array('title' => array(Utils::escape($this->config['o_board_title']), __('Admin'), __('Options')), 'active_page' => 'admin', 'admin_console' => true, 'languages' => $this->model->get_langs(), 'styles' => $this->model->get_styles(), 'times' => $this->model->get_times()))->addTemplate('admin/options.php')->display();
 }
开发者ID:bohwaz,项目名称:featherbb,代码行数:8,代码来源:Options.php

示例7: edit

 public function edit($id)
 {
     if ($this->request->post('add_edit_ban')) {
         $this->model->insert_ban();
     }
     AdminUtils::generateAdminMenu('bans');
     $this->feather->template->setPageInfo(array('admin_console' => true, 'focus_element' => array('bans2', 'ban_user'), 'title' => array(Utils::escape($this->config['o_board_title']), __('Admin'), __('Bans')), 'ban' => $this->model->edit_ban_info($id)))->addTemplate('admin/bans/add_ban.php')->display();
 }
开发者ID:bohwaz,项目名称:featherbb,代码行数:8,代码来源:Bans.php

示例8: rules

 public function rules()
 {
     Container::get('hooks')->fire('controller.index.rules');
     if (ForumSettings::get('o_rules') == '0' || User::get()->is_guest && User::get()->g_read_board == '0' && ForumSettings::get('o_regs_allow') == '0') {
         throw new Error(__('Bad request'), 404);
     }
     View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Forum rules')), 'active_page' => 'rules'))->addTemplate('misc/rules.php')->display();
 }
开发者ID:featherbb,项目名称:featherbb,代码行数:8,代码来源:Index.php

示例9: display

 public function display($req, $res, $args)
 {
     Container::get('hooks')->fire('controller.admin.options.display');
     if (Request::isPost()) {
         return $this->model->update_options();
     }
     AdminUtils::generateAdminMenu('options');
     View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Options')), 'active_page' => 'admin', 'admin_console' => true, 'languages' => $this->model->get_langs(), 'styles' => $this->model->get_styles(), 'times' => $this->model->get_times()))->addTemplate('admin/options.php')->display();
 }
开发者ID:featherbb,项目名称:featherbb,代码行数:9,代码来源:Options.php

示例10: edit

 public function edit($req, $res, $args)
 {
     Container::get('hooks')->fire('controller.admin.bans.edit');
     if (Input::post('add_edit_ban')) {
         return $this->model->insert_ban();
     }
     AdminUtils::generateAdminMenu('bans');
     View::setPageInfo(array('admin_console' => true, 'focus_element' => array('bans2', 'ban_user'), 'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Bans')), 'ban' => $this->model->edit_ban_info($args['id'])))->addTemplate('admin/bans/add_ban.php')->display();
 }
开发者ID:featherbb,项目名称:featherbb,代码行数:9,代码来源:Bans.php

示例11: display

 public function display()
 {
     // Update permissions
     if ($this->feather->request->isPost()) {
         $this->model->update_permissions();
     }
     AdminUtils::generateAdminMenu('permissions');
     $this->feather->template->setPageInfo(array('title' => array(Utils::escape($this->config['o_board_title']), __('Admin'), __('Permissions')), 'active_page' => 'admin', 'admin_console' => true))->addTemplate('admin/permissions.php')->display();
 }
开发者ID:bohwaz,项目名称:featherbb,代码行数:9,代码来源:Permissions.php

示例12: index

 public function index($req, $res, $args)
 {
     Container::get('hooks')->fire('controller.admin.plugins.index');
     View::addAsset('js', 'style/imports/common.js', array('type' => 'text/javascript'));
     $availablePlugins = Lister::getPlugins();
     $activePlugins = Container::get('cache')->isCached('activePlugins') ? Container::get('cache')->retrieve('activePlugins') : array();
     $officialPlugins = Lister::getOfficialPlugins();
     AdminUtils::generateAdminMenu('plugins');
     View::setPageInfo(array('admin_console' => true, 'active_page' => 'admin', 'availablePlugins' => $availablePlugins, 'activePlugins' => $activePlugins, 'officialPlugins' => $officialPlugins, 'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Extension'))))->addTemplate('admin/plugins.php')->display();
 }
开发者ID:featherbb,项目名称:featherbb,代码行数:10,代码来源:Plugins.php

示例13: getName

 public function getName($items)
 {
     // Split name
     $classNamespace = explode('\\', get_class($this));
     $className = end($classNamespace);
     // Prettify and return name of child class
     preg_match_all('%[A-Z]*[a-z]+%m', $className, $result, PREG_PATTERN_ORDER);
     $items[] = Utils::escape(implode(' ', $result[0]));
     return $items;
 }
开发者ID:featherbb,项目名称:featherbb,代码行数:10,代码来源:Plugin.php

示例14: display

 public function display($req, $res, $args)
 {
     Container::get('hooks')->fire('controller.admin.permissions.display');
     // Update permissions
     if (Request::isPost()) {
         return $this->model->update_permissions();
     }
     AdminUtils::generateAdminMenu('permissions');
     return View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Permissions')), 'active_page' => 'admin', 'admin_console' => true))->addTemplate('admin/permissions.php')->display();
 }
开发者ID:featherbb,项目名称:featherbb,代码行数:10,代码来源:Permissions.php

示例15: addedit

 public function addedit($id = '')
 {
     $groups = $this->model->fetch_groups();
     // Add/edit a group (stage 2)
     if ($this->request->post('add_edit_group')) {
         $this->model->add_edit_group($groups, $this->feather);
     } elseif ($this->request->post('add_group') || isset($id)) {
         AdminUtils::generateAdminMenu('groups');
         $group = $this->model->info_add_group($groups, $id);
         $this->feather->template->setPageInfo(array('title' => array(Utils::escape($this->config['o_board_title']), __('Admin'), __('User groups')), 'active_page' => 'admin', 'admin_console' => true, 'focus_element' => array('groups2', 'req_title'), 'required_fields' => array('req_title' => __('Group title label')), 'group' => $group, 'groups' => $groups, 'id' => $id, 'group_list' => $this->model->get_group_list($groups, $group)))->addTemplate('admin/groups/add_edit_group.php')->display();
     }
 }
开发者ID:bohwaz,项目名称:featherbb,代码行数:12,代码来源:Groups.php


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