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


PHP Pages::paginateByProject方法代码示例

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


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

示例1: index

 /**
  * List of pages
  *
  */
 function index()
 {
     $per_page = 20;
     $page = (int) $this->request->get('page');
     if ($page < 1) {
         $page = 1;
     }
     // if
     $pagination = null;
     if ($this->active_category->isLoaded()) {
         $this->addBreadcrumb($this->active_category->getName());
         $pages = Pages::findByCategory($this->active_category, STATE_VISIBLE, $this->logged_user->getVisibility());
     } else {
         $this->addBreadcrumb(lang('Recently Modified'));
         list($pages, $pagination) = Pages::paginateByProject($this->active_project, $page, $per_page, STATE_VISIBLE, $this->logged_user->getVisibility());
     }
     // if
     $this->smarty->assign(array('pages' => $pages, 'pagination' => $pagination, 'categories' => Categories::findByModuleSection($this->active_project, PAGES_MODULE, 'pages'), 'pagination_url' => assemble_url('mobile_access_view_pages', array('project_id' => $this->active_project->getId())), 'page_back_url' => assemble_url('mobile_access_view_project', array('project_id' => $this->active_project->getId()))));
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:23,代码来源:MobileAccessProjectPagesController.class.php

示例2: index

 /**
  * Render pages associtate with a specific project, pages homepage
  *
  * @param void
  * @return null
  */
 function index()
 {
     if ($this->request->isApiCall()) {
         if ($this->active_category->isLoaded()) {
             $this->serveData(Pages::findByCategory($this->active_category, STATE_VISIBLE, $this->logged_user->getVisibility()), 'pages');
         } else {
             $this->serveData(Categories::findByModuleSection($this->active_project, PAGES_MODULE, 'pages'), 'categories');
         }
         // if
     } else {
         //BOF:mod 20121108
         $category_is_selected = false;
         $selected_category_id = $_GET['category_id'];
         if ($selected_category_id === '0' || $selected_category_id > 0) {
             $category_is_selected = true;
         }
         //EOF:mod 20121108
         $per_page = 30;
         $page = (int) $this->request->get('page');
         if ($page < 1) {
             $page = 1;
         }
         // if
         //BOF:mod 20121108
         /*
         //EOF:mod 20121108
                 if($this->active_category->isLoaded()) {
                 //BOF:mod 20121108
         */
         if ($category_is_selected) {
             //EOF:mod 20121108
             $this->setTemplate(array('module' => PAGES_MODULE, 'controller' => 'pages', 'template' => 'category'));
             //BOF:mod 20121108
             /*
             //EOF:mod 20121108
                       $this->wireframe->addPageAction(lang('Reorder Pages'), assemble_url('project_pages_reorder', array('project_id' => $this->active_project->getId(), 'category_id' => $this->active_category->getId())), null, array('id' => 'reorder_pages_button'));
                       
                       $this->smarty->assign('pages', Pages::findByCategory($this->active_category, STATE_VISIBLE, $this->logged_user->getVisibility()));
             //BOF:mod 20121108
             */
             $this->wireframe->addPageAction(lang('Reorder Pages'), assemble_url('project_pages_reorder', array('project_id' => $this->active_project->getId())), null, array('id' => 'reorder_pages_button'));
             $this->smarty->assign('pages', Pages::findByCategoryNew($this->active_project->getId(), $selected_category_id, STATE_VISIBLE, $this->logged_user->getVisibility()));
             //EOF:mod 20121108
         } else {
             list($pages, $pagination) = Pages::paginateByProject($this->active_project, $page, $per_page, STATE_VISIBLE, $this->logged_user->getVisibility());
             $grouped_pages = group_by_date($pages, $this->logged_user, 'getUpdatedOn', true);
             $this->smarty->assign(array('grouped_pages' => $grouped_pages, 'pagination' => $pagination));
         }
         // if
         //BOF:mod 20121108
         $departments = Pages::getItemsByDepartment($this->active_project->getId(), new Discussion());
         //EOF:mod 20121108
         $this->smarty->assign(array('departments' => $departments, 'selected_category_id' => $selected_category_id, 'categories_url' => assemble_url('project_manage_milestone_categories', array('project_id' => $this->active_project->getId())), 'can_manage_categories' => $this->logged_user->isProjectLeader($this->active_project) || $this->logged_user->isProjectManager()));
     }
     // if
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:62,代码来源:PagesController.class.php


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