summaryrefslogtreecommitdiff
path: root/modules/image_block/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-12-24 11:36:00 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-12-24 11:36:00 -0800
commita2a3741b5351afb064097238daf0d79e1526cd51 (patch)
tree7487e842d3953e17e80f37dbbe5b7974ac12563b /modules/image_block/helpers
parentcf6de01f1e51a8dca97347600a844a07b4f80f8b (diff)
Change the image block rest handler to expect the type (i.e. random) as a parameter not part of the path.
Diffstat (limited to 'modules/image_block/helpers')
-rw-r--r--modules/image_block/helpers/image_block_rest.php6
1 files changed, 3 insertions, 3 deletions
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) {