From 9864ab4b2708ec54c39092a21828403cbbd25e2e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 8 Jan 2010 14:56:08 -0800 Subject: Move the random image functionality into the gallery REST helper since choosing a random image is essentially a function on an item collection. Also implemented a bunch of other query filters for item collections. Created item::random_query() as a way of generating a reasonable starting point for random queries. --- modules/image_block/helpers/image_block_block.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/image_block/helpers/image_block_block.php') diff --git a/modules/image_block/helpers/image_block_block.php b/modules/image_block/helpers/image_block_block.php index 5f2bbcb7..f28e775f 100644 --- a/modules/image_block/helpers/image_block_block.php +++ b/modules/image_block/helpers/image_block_block.php @@ -30,7 +30,7 @@ class image_block_block_Core { $block->css_id = "g-image-block"; $block->title = t("Random image"); $block->content = new View("image_block_block.html"); - $block->content->items = item::random(array(array("type", "!=", "album"))); + $block->content->items = item::random_query(array(array("type", "!=", "album")))->find_all(1); if ($block->content->items->count() == 0) { $block = ""; -- cgit v1.2.3