diff options
Diffstat (limited to 'core/controllers/photo.php')
-rw-r--r-- | core/controllers/photo.php | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/core/controllers/photo.php b/core/controllers/photo.php index 45db4b02..55ab6247 100644 --- a/core/controllers/photo.php +++ b/core/controllers/photo.php @@ -17,22 +17,19 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Photo_Controller extends Template_Controller { - public $template = "page.html"; +class Photo_Controller extends Item_Controller { + public function get($item) { + $template = new View("page.html"); - public function view($id) { - $item = ORM::factory("item")->where("id", $id)->find(); - if (empty($item->id)) { - return Kohana::show_404(); - } - - $this->template->content = new View("photo.html"); + /** @todo: this needs to be data-driven */ + $theme = new Theme("default", $template); - $this->template->set_global('item', $item); - $this->template->set_global('children', $item->children()); - $this->template->set_global('parents', $item->parents()); + $template->set_global('item', $item); + $template->set_global('children', $item->children()); + $template->set_global('parents', $item->parents()); + $template->set_global('theme', $theme); + $template->content = new View("photo.html"); - /** @todo: this needs to be data-driven */ - $this->template->set_global('theme', new Theme("default", $this->template)); + print $template->render(); } } |