diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-11-26 21:50:45 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-26 21:50:45 +0000 |
commit | 974f9f778891bbefeb083b2d97b3dae206c96452 (patch) | |
tree | 721c3c78bddb09c26ec306ae13e4093667961a97 /modules/tag/controllers | |
parent | 4e8937ccefc95272442a9cd5ccb71aab01f113a1 (diff) |
Add a new "tag" page type.
Create the concept of "page types" which let us specify the kind of
page that we're rendering in high level terms. Currently there are
three page types: album, photo and tag.
The tag page type uses slightly different variables. It has a $tag
but no $item. Adjust all sidebar_block() functions to avoid printing
stuff that's dependent on the item if there is no item.
Simplify the tag code to stop trying to fake an item.
Update the theme slightly to use $item and $tag where appropriate
(notably, for making the <title> element).
Diffstat (limited to 'modules/tag/controllers')
-rw-r--r-- | modules/tag/controllers/tags.php | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php index 6011179a..db5f93bd 100644 --- a/modules/tag/controllers/tags.php +++ b/modules/tag/controllers/tags.php @@ -20,31 +20,40 @@ class Tags_Controller extends REST_Controller { protected $resource_type = "tag"; - /** - * @see Rest_Controller::_index() - */ + public function _show($tag) { + // @todo: these need to be pulled from the database + $theme_name = "default"; + $page_size = 9; + + $template = new View("page.html"); + + $page = $this->input->get("page", "1"); + $theme = new Theme($theme_name, $template); + + $template->set_global("page_type", "tag"); + $template->set_global('page_size', $page_size); + $template->set_global('tag', $tag); + $template->set_global('children', $tag->items($page_size, ($page-1) * $page_size)); + $template->set_global('children_count', $tag->count); + $template->set_global('theme', $theme); + $template->set_global('user', Session::instance()->get('user', null)); + $template->content = new View("tag.html"); + + print $template; + } + public function _index() { throw new Exception("@todo Tag_Controller::_index NOT IMPLEMENTED"); } - /** - * @see Rest_Controller::_form_add($parameters) - */ public function _form_add($parameters) { throw new Exception("@todo Tag_Controller::_form NOT IMPLEMENTED"); } - /** - * @see Rest_Controller::_form_edit($resource) - */ public function _form_edit($tag) { throw new Exception("@todo Tag_Controller::_form NOT IMPLEMENTED"); } - public function _show($tag) { - Albums_Controller::_show($tag); - } - public function _create($tag) { throw new Exception("@todo Tag_Controller::_create NOT IMPLEMENTED"); } |