diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-27 16:19:07 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-27 16:19:07 +0000 |
commit | bac4ff2046a9413ad53caca47842b63d3e5a5385 (patch) | |
tree | 8446d706cd06ed3f56fdc4e47a5f15899bed6654 /core/controllers | |
parent | 723eb2f611727cb7a1d8b64e1a7814de94be9cc9 (diff) |
1) Create a Theme_View class that combines the functionality of the Theme class with the View class.
2) Only define the form.html.php::DrawForm method once if there are multiple forms on the page (i.e. comments and add tags)
Diffstat (limited to 'core/controllers')
-rw-r--r-- | core/controllers/albums.php | 6 | ||||
-rw-r--r-- | core/controllers/photos.php | 8 |
2 files changed, 3 insertions, 11 deletions
diff --git a/core/controllers/albums.php b/core/controllers/albums.php index c2935c09..50317979 100644 --- a/core/controllers/albums.php +++ b/core/controllers/albums.php @@ -27,19 +27,15 @@ class Albums_Controller extends Items_Controller { $theme_name = "default"; $page_size = 9; - $template = new View("page.html"); + $template = new Theme_View("page.html", "album", $theme_name); $page = $this->input->get("page", "1"); - $theme = new Theme($theme_name, $template); - $template->set_global("page_type", "album"); $template->set_global('page_size', $page_size); $template->set_global('item', $item); $template->set_global('children', $item->children($page_size, ($page - 1) * $page_size)); $template->set_global('children_count', $item->children_count()); $template->set_global('parents', $item->parents()); - $template->set_global('theme', $theme); - $template->set_global('user', Session::instance()->get('user', null)); $template->content = new View("album.html"); print $template; diff --git a/core/controllers/photos.php b/core/controllers/photos.php index 2e0c63f5..143c3bb8 100644 --- a/core/controllers/photos.php +++ b/core/controllers/photos.php @@ -23,18 +23,14 @@ class Photos_Controller extends Items_Controller { * @see Rest_Controller::_show($resource) */ public function _show($item) { - $template = new View("page.html"); - // @todo: this needs to be data-driven - $theme = new Theme("default", $template); + $template = new Theme_View("page.html", "photo", "default"); - $template->set_global("page_type", "photo"); $template->set_global('item', $item); $template->set_global('children', $item->children()); $template->set_global('children_count', $item->children_count()); $template->set_global('parents', $item->parents()); - $template->set_global('theme', $theme); - $template->set_global('user', Session::instance()->get('user', null)); + $template->content = new View("photo.html"); print $template; |