本文整理汇总了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()))));
}
示例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
}