From a2a3741b5351afb064097238daf0d79e1526cd51 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 24 Dec 2009 11:36:00 -0800 Subject: Change the image block rest handler to expect the type (i.e. random) as a parameter not part of the path. --- modules/image_block/helpers/image_block_rest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/image_block') diff --git a/modules/image_block/helpers/image_block_rest.php b/modules/image_block/helpers/image_block_rest.php index 363eabee..45f849b1 100644 --- a/modules/image_block/helpers/image_block_rest.php +++ b/modules/image_block/helpers/image_block_rest.php @@ -19,8 +19,8 @@ */ class image_block_rest_Core { static function get($request) { - $path = implode("/", $request->arguments); - switch ($path) { + $type = empty($request->type) ? "random" : $request->type; + switch ($type) { case "random": $random = ((float)mt_rand()) / (float)mt_getrandmax(); @@ -42,7 +42,7 @@ class image_block_rest_Core { } break; default: - return rest::fail("Unsupported block type: '{$path}'"); + return rest::fail("Unsupported image block type: '{$type}'"); } if ($items->count() > 0) { -- cgit v1.2.3