summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/items.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-11-25 13:40:47 -0800
committerBharat Mediratta <bharat@menalto.com>2009-11-25 13:40:47 -0800
commitf50dbd992d6973caeaaa3139ddf5f908dd84ec79 (patch)
treecbdb343de89306a4ed823dc5aa104a802f846dc4 /modules/gallery/controllers/items.php
parent2e420522ece22942a9b3b6ee413ca0e1dfa76148 (diff)
parentdc67cf64813361b34c366123f37d88ef6988fcc8 (diff)
Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev
Conflicts: modules/gallery/controllers/rest.php
Diffstat (limited to 'modules/gallery/controllers/items.php')
-rw-r--r--modules/gallery/controllers/items.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/gallery/controllers/items.php b/modules/gallery/controllers/items.php
index 7f60f2b7..ec3681a3 100644
--- a/modules/gallery/controllers/items.php
+++ b/modules/gallery/controllers/items.php
@@ -17,14 +17,16 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class Items_Controller extends REST_Controller {
- protected $resource_type = "item";
-
- public function _show($item) {
+class Items_Controller extends Controller {
+ public function __call($function, $args) {
+ $item = ORM::factory("item", (int)$function);
+ if (!$item->loaded) {
+ return Kohana::show_404();
+ }
// Redirect to the more specific resource type, since it will render
// differently. We could also just delegate here, but it feels more appropriate
// to have a single canonical resource mapping.
access::required("view", $item);
- return url::redirect($item->abs_url());
+ return $this->_show($item);
}
}