Conditions | 5 |
Paths | 5 |
Total Lines | 23 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function paginatedItems() |
||
14 | { |
||
15 | if (!$this->owner->getRequest()->param('URL') || !ShortList::isBrowser()) { |
||
16 | return false; |
||
17 | } |
||
18 | |||
19 | $items = false; |
||
20 | $list = DataObject::get_one('ShortList', $filter = array('URL' => $this->owner->getRequest()->param('URL'))); |
||
21 | |||
22 | if ($list) { |
||
23 | $items = $list->ShortListItems(); |
||
24 | } |
||
25 | |||
26 | $this->owner->list = new PaginatedList($items, $this->owner->getRequest()); |
||
27 | $this->owner->list->setPageLength(Config::inst()->get('ShortList', 'PaginationCount')); |
||
28 | $this->owner->list->setPaginationGetVar('page'); |
||
29 | |||
30 | if ($this->owner->currentPage) { |
||
31 | $this->owner->list->setCurrentPage($this->owner->currentPage); |
||
32 | } |
||
33 | |||
34 | return $this->owner->list; |
||
35 | } |
||
36 | |||
55 |