| @@ 63-68 (lines=6) @@ | ||
| 60 | } |
|
| 61 | // sort |
|
| 62 | $pages = $pages->sortByDate(); |
|
| 63 | if ($page->getVariable('sortby')) { |
|
| 64 | $sortMethod = sprintf('sortBy%s', ucfirst($page->getVariable('sortby'))); |
|
| 65 | if (method_exists($pages, $sortMethod)) { |
|
| 66 | $pages = $pages->$sortMethod(); |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||
| 70 | // build pagination |
|
| 71 | $pagesTotal = count($pages); |
|
| @@ 47-52 (lines=6) @@ | ||
| 44 | $pages = new PagesCollection($section, $pagesAsArray); |
|
| 45 | // sort |
|
| 46 | $pages = $pages->sortByDate(); |
|
| 47 | if ($page->getVariable('sortby')) { |
|
| 48 | $sortMethod = sprintf('sortBy%s', ucfirst($page->getVariable('sortby'))); |
|
| 49 | if (method_exists($pages, $sortMethod)) { |
|
| 50 | $pages = $pages->$sortMethod(); |
|
| 51 | } |
|
| 52 | } |
|
| 53 | // add navigation links |
|
| 54 | $this->addNavigationLinks($pages); |
|
| 55 | // create page for each section |
|