2008-11-05 07:42:52 +00:00
|
|
|
<?php defined("SYSPATH") or die("No direct script access.");
|
|
|
|
|
/**
|
|
|
|
|
* Gallery - a web based photo album viewer and editor
|
|
|
|
|
* Copyright (C) 2000-2008 Bharat Mediratta
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or (at
|
|
|
|
|
* your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
2008-11-19 00:12:25 +00:00
|
|
|
class Photos_Controller extends Items_Controller {
|
2008-11-11 06:18:45 +00:00
|
|
|
|
2008-11-16 07:14:12 +00:00
|
|
|
/**
|
2008-11-19 04:20:35 +00:00
|
|
|
* @see Rest_Controller::_show($resource)
|
2008-11-16 07:14:12 +00:00
|
|
|
*/
|
2008-11-19 04:20:35 +00:00
|
|
|
public function _show($item) {
|
2008-11-11 06:18:45 +00:00
|
|
|
// @todo: this needs to be data-driven
|
2008-11-27 16:19:07 +00:00
|
|
|
$template = new Theme_View("page.html", "photo", "default");
|
2008-11-06 10:22:34 +00:00
|
|
|
|
2008-11-09 19:20:23 +00:00
|
|
|
$template->set_global('item', $item);
|
|
|
|
|
$template->set_global('children', $item->children());
|
2008-11-27 05:59:37 +00:00
|
|
|
$template->set_global('children_count', $item->children_count());
|
2008-11-09 19:20:23 +00:00
|
|
|
$template->set_global('parents', $item->parents());
|
2008-11-27 16:19:07 +00:00
|
|
|
|
2008-11-09 19:20:23 +00:00
|
|
|
$template->content = new View("photo.html");
|
2008-11-05 07:42:52 +00:00
|
|
|
|
2008-11-16 19:12:01 +00:00
|
|
|
print $template;
|
2008-11-05 07:42:52 +00:00
|
|
|
}
|
2008-12-06 21:14:36 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @see Rest_Controller::_form_add($parameters)
|
|
|
|
|
*/
|
|
|
|
|
public function _form_add($parent_id) {
|
|
|
|
|
$parent = ORM::factory("item", $parent_id);
|
|
|
|
|
|
|
|
|
|
print photo::get_add_form($parent)->render();
|
|
|
|
|
}
|
2008-11-05 07:42:52 +00:00
|
|
|
}
|