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


PHP CMS::page_navigator方法代码示例

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


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

示例1: initialize

 /**
  * @param array $config
  */
 static function initialize($config = array())
 {
     foreach ($config as $key => $value) {
         self::${$key} = $value;
     }
     CMS::$page_navigator = new ReflectionMethod('CMS_PageNavigator', 'run');
 }
开发者ID:techart,项目名称:tao,代码行数:10,代码来源:PageNavigator.php

示例2: page

 /**
  * @param int $pagenum
  *
  * @return WebKit_Views_TemplateView
  */
 public function page($pagenum)
 {
     $pagenum = (int) $pagenum;
     if ($pagenum < 1) {
         $page_num = 1;
     }
     $count = $this->count_all();
     $numpages = $count / $this->perpage;
     if (floor($numpages) != $numpages) {
         $numpages = floor($numpages) + 1;
     }
     if ($numpages < 1 || $pagenum > $numpages) {
         $numpages = 1;
     }
     if ($pagenum < 1 || $pagenum > $numpages) {
         return $this->page_not_found();
     }
     $rows = $this->select_all(($pagenum - 1) * $this->perpage, $this->perpage);
     return $this->render_list($this->template_list, array('pagenum' => $pagenum, 'numpages' => $numpages, 'count' => $count, 'rows' => $rows, 'page_navigator' => CMS::page_navigator($pagenum, $numpages, $this->page_url('%'))));
 }
开发者ID:techart,项目名称:tao,代码行数:25,代码来源:PageView.php

示例3: page_navigator

 protected function page_navigator($page_num, $num_pages, $tpl)
 {
     return CMS::page_navigator($page_num, $num_pages, $tpl);
 }
开发者ID:techart,项目名称:tao,代码行数:4,代码来源:AdminTable.php

示例4: action_list

 protected function action_list()
 {
     $fform = $this->create_filters_form();
     $this->on_before_list();
     $rows = $this->get_rows();
     $form = false;
     if ($this->access_massupdate()) {
         $form = $this->massupdate_form($rows);
         if ($form) {
             if ($this->env->request->method_code == Net_HTTP::POST) {
                 if ($form->process($this->env->request)) {
                     foreach (explode(',', $form['ids']) as $id) {
                         $id = trim($id);
                         if ($id != '') {
                             $item = $this->load($id);
                             if ($this->access_edit($item)) {
                                 foreach ($this->massupdate_fields as $field => $data) {
                                     $name = "{$field}{$id}";
                                     $type = CMS_Fields::type($data);
                                     $obj = new ArrayObject();
                                     $type->assign_to_object($form, $obj, $name, $data);
                                     $item->{$field} = $obj[$name];
                                 }
                                 $this->update($item);
                             }
                         }
                     }
                     Events::call('admin.change');
                 }
                 return $this->redirect_to($this->action_url('list', $this->page));
             }
         }
     }
     $page_navigator = false;
     if ($this->numpages > 1) {
         $page_navigator = CMS::page_navigator($this->page, $this->numpages, array($this, 'list_url'));
     }
     $filters_buttons = array();
     foreach ($this->filters_buttons() as $caption => $url) {
         $url = trim($url);
         if ($caption[0] != '*') {
             if ($m = Core_Regexps::match_with_results('{^(\\w+)=(.+)$}', $url)) {
                 $name = trim($m[1]);
                 $value = trim($m[2]);
                 if (isset($_GET[$name]) && $_GET[$name] == $value) {
                     $caption = "*{$caption}";
                 }
             }
             if ($m = Core_Regexps::match_with_results('{\\{(.+)\\}}', $url)) {
                 $cond = trim($m[1]);
                 if ($cond != '' && $cond[0] == '!') {
                     $cond = substr($cond, 1);
                     if (!isset($_GET[$cond])) {
                         $caption = "*{$caption}";
                     }
                 }
             }
         }
         $url = preg_replace('{\\{.+\\}}', '', $url);
         if ($url == '' || $url[0] != '/' && !Core_Regexps::match('{^http:}', $url)) {
             $url = $this->action_url('list', 1, $url);
         }
         $filters_buttons[$caption] = $url;
     }
     $filters_form_fields = $this->prepare_filter_forms();
     if ($this->add_in_list && $this->access_add()) {
         $this->create_form($this->action_url('add', $this->page), 'add');
         $item = $this->new_object();
         $this->item_to_form($item);
     }
     return $this->render_list(array('title' => $this->title_list(), 'form' => $this->add_in_list ? $this->form : null, 'form_fields' => $this->add_in_list ? $this->filtered_form_fields : null, 'submit_text' => $this->submit_add(), 'count' => $this->count, 'rows' => $rows, 'list_fields' => $this->list_fields(), 'list_style' => $this->list_style(), 'message_norows' => $this->message_norows(), 'can_add' => $this->access_add(), 'add_url' => $this->action_url('add', $this->page), 'add_button_caption' => $this->button_add(), 'massupdate_form' => $form, 'massupdate_fields' => $this->massupdate_fields, 'massupdate_submit_text' => $this->submit_massupdate(), 'page_navigator' => $page_navigator, 'filters_buttons' => $filters_buttons, 'filters_form' => $fform, 'filters_form_fields' => $filters_form_fields, 'sort' => $this->sort, 'sort_direction' => $this->sort_direction));
 }
开发者ID:techart,项目名称:tao,代码行数:72,代码来源:Table.php


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