summaryrefslogtreecommitdiff
path: root/lib/action.php
diff options
context:
space:
mode:
authorEvan Prodromou <git@evanprodromou.name>2009-01-13 23:48:05 -0500
committerEvan Prodromou <git@evanprodromou.name>2009-01-13 23:48:05 -0500
commit0093b035c12bf21c88f57e4f0931b0abce214f43 (patch)
treed267714dbf4adeb6bfda538cd8595544daf3f171 /lib/action.php
parent93e249de2a28775e3a40e63324371fec359fb93b (diff)
Modify public stream to use new UI framework
I modified public.php to use the new UI framework. Since the Action class isn't functional yet, I don't know if it works. I took some of the functionality, like the public tabs nav and the feeds list, and made them widgets. I also moved the navigation from common_navigation() to a method of Action.
Diffstat (limited to 'lib/action.php')
-rw-r--r--lib/action.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/action.php b/lib/action.php
index 59cc173e7..95178c65e 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -553,4 +553,38 @@ class Action extends HTMLOutputter // lawsuit
common_element('a', $attrs, $text);
common_element_end('li');
}
+
+ // Does a little before-after block for next/prev page
+
+ function pagination($have_before, $have_after, $page, $action, $args=null)
+ {
+ if ($have_before || $have_after) {
+ $this->elementStart('div', array('id' => 'pagination'));
+ $this->elementStart('ul', array('id' => 'nav_pagination'));
+ }
+
+ if ($have_before) {
+ $pargs = array('page' => $page-1);
+ $newargs = ($args) ? array_merge($args,$pargs) : $pargs;
+
+ $this->elementStart('li', 'before');
+ $this->element('a', array('href' => common_local_url($action, $newargs), 'rel' => 'prev'),
+ _('« After'));
+ $this->elementEnd('li');
+ }
+
+ if ($have_after) {
+ $pargs = array('page' => $page+1);
+ $newargs = ($args) ? array_merge($args,$pargs) : $pargs;
+ $this->elementStart('li', 'after');
+ $this->element('a', array('href' => common_local_url($action, $newargs), 'rel' => 'next'),
+ _('Before »'));
+ $this->elementEnd('li');
+ }
+
+ if ($have_before || $have_after) {
+ $this->elementEnd('ul');
+ $this->elementEnd('div');
+ }
+ }
}