summaryrefslogtreecommitdiff
path: root/core/libraries/Theme.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-11-07 07:33:43 +0000
committerBharat Mediratta <bharat@menalto.com>2008-11-07 07:33:43 +0000
commit76436c0029f5be153f805a1be03e17ea26309906 (patch)
tree2ac99106d2600c5de8518621a22cda8702598ff2 /core/libraries/Theme.php
parent50a9848f383c988b720c99945fbb91f371e02fa0 (diff)
Add automatic pagination. All you have to do is add <?= $theme->pager
?> to your theme file and you get a well formed pager. Themes can customize this any way they want. A version that matches the mockup is provided in the default theme.
Diffstat (limited to 'core/libraries/Theme.php')
-rw-r--r--core/libraries/Theme.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/core/libraries/Theme.php b/core/libraries/Theme.php
index 101cbb42..0f195d08 100644
--- a/core/libraries/Theme.php
+++ b/core/libraries/Theme.php
@@ -38,8 +38,18 @@ class Theme_Core {
return new $view_class($page_name);
}
+ public function pager() {
+ $this->pagination = new Pagination();
+ $this->pagination->initialize(
+ array('query_string' => 'page',
+ 'total_items' => $this->template->item->children_count(),
+ 'items_per_page' => $this->template->page_size,
+ 'style' => 'classic'));
+ return $this->pagination->render();
+ }
+
public function blocks() {
- /** @todo: this needs to be made data-driven */
+ /** @todo: make this data driven */
$blocks = array(
'carousel' => carousel::block($this),
'tags' => tags::block($this),