diff options
author | Joe7 <jozsef.rnagy@site.hu> | 2011-01-02 18:59:23 +0100 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2011-01-03 11:38:13 -0800 |
commit | cfaa62370ecbdb3badf4ab68bbefa7cfedaea154 (patch) | |
tree | 7cc8dbb5c6c21ca6e693be391c18cc3116bb64b3 /modules/gallery/controllers/albums.php | |
parent | e6a5f39b9113fa9cfc526b873947e365793d4e3e (diff) |
Reimplemented Kohana 2.3's View::set_global() with array support.
Allows for cleaner code and fewer function calls.
Diffstat (limited to 'modules/gallery/controllers/albums.php')
-rw-r--r-- | modules/gallery/controllers/albums.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index c0368488..e69f6b6d 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -61,14 +61,15 @@ class Albums_Controller extends Items_Controller { } $template = new Theme_View("page.html", "collection", "album"); - $template->set_global("page", $page); - $template->set_global("page_title", null); - $template->set_global("max_pages", $max_pages); - $template->set_global("page_size", $page_size); - $template->set_global("item", $album); - $template->set_global("children", $album->viewable()->children($page_size, $offset)); - $template->set_global("children_count", $children_count); - $template->set_global("parents", $album->parents()->as_array()); // view calls empty() on this + $template->set_global(array("page" => $page, + "page_title" => null, + "max_pages" => $max_pages, + "page_size" => $page_size, + "item" => $album, + "children" => $album->viewable()->children($page_size, $offset), + "children_count" => $children_count, + "parents" => $album->parents()->as_array())); + // view calls empty() on this $template->content = new View("album.html"); $album->increment_view_count(); |