예제 #1
0
 public function __construct(Pagination $pagination, ViewInterface $paginationView)
 {
     $this->view = $paginationView;
     $this->pagination = $pagination;
     $list = $pagination->getItemListObject();
     $this->routeCollectionFunction = function ($page) use($list) {
         $qs = Core::make('helper/url');
         $url = $qs->setVariable($list->getQueryPaginationPageParameter(), $page);
         return $url;
     };
 }
예제 #2
0
 public function getJSONObject()
 {
     $obj = new stdClass();
     $obj->items = array();
     foreach ($this->getItems() as $item) {
         $obj->items[] = $item;
     }
     foreach ($this->getColumns() as $column) {
         $obj->columns[] = $column;
     }
     $html = '';
     if ($this->pagination->haveToPaginate()) {
         $view = new TwitterBootstrap3View();
         $result = $this;
         $html = $view->render($this->pagination, function ($page) use($result) {
             $list = $result->getItemListObject();
             $uh = \Core::make("helper/url");
             $args = array($list->getQueryPaginationPageParameter() => $page, $list->getQuerySortColumnParameter() => $list->getActiveSortColumn(), $list->getQuerySortDirectionParameter() => $list->getActiveSortDirection());
             return $uh->setVariable($args, false, $result->getBaseURL());
         }, array('prev_message' => tc('Pagination', '&larr; Previous'), 'next_message' => tc('Pagination', 'Next &rarr;'), 'active_suffix' => '<span class="sr-only">' . tc('Pagination', '(current)') . '</span>'));
     }
     $obj->paginationTemplate = $html;
     $obj->fields = $this->fields;
     $obj->filters = $this->filters;
     $obj->query = $this->query;
     $obj->bulkMenus = $this->getSearchResultBulkMenus();
     $obj->baseUrl = (string) $this->getBaseURL();
     $obj->breadcrumb = $this->getBreadcrumb();
     return $obj;
 }
예제 #3
0
 public function getJSONObject()
 {
     $obj = new stdClass();
     $obj->items = array();
     foreach ($this->getItems() as $item) {
         $obj->items[] = $item;
     }
     foreach ($this->getColumns() as $column) {
         $obj->columns[] = $column;
     }
     $html = '';
     if ($this->pagination->haveToPaginate()) {
         $view = new TwitterBootstrap3View();
         $result = $this;
         $html = $view->render($this->pagination, function ($page) use($result) {
             $list = $result->getItemListObject();
             return $result->getBaseURL() . '?' . $list->getQueryPaginationPageParameter() . '=' . $page;
         });
     }
     $obj->paginationTemplate = $html;
     $obj->fields = $this->fields;
     return $obj;
 }
예제 #4
0
파일: Result.php 프로젝트: ceko/concrete5-1
 public function getJSONObject()
 {
     $obj = new stdClass();
     $obj->items = array();
     foreach ($this->getItems() as $item) {
         $obj->items[] = $item;
     }
     foreach ($this->getColumns() as $column) {
         $obj->columns[] = $column;
     }
     $html = '';
     if ($this->pagination->haveToPaginate()) {
         $view = new TwitterBootstrap3View();
         $result = $this;
         $html = $view->render($this->pagination, function ($page) use($result) {
             $list = $result->getItemListObject();
             return $result->getBaseURL() . '?' . $list->getQueryPaginationPageParameter() . '=' . $page;
         }, array('prev_message' => tc('Pagination', '&larr; Previous'), 'next_message' => tc('Pagination', 'Next &rarr;'), 'active_suffix' => '<span class="sr-only">' . tc('Pagination', '(current)') . '</span>'));
     }
     $obj->paginationTemplate = $html;
     $obj->fields = $this->fields;
     return $obj;
 }