summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorNathan Kinkade <nath@nkinka.de>2011-09-28 20:39:05 +0000
committerNathan Kinkade <nath@nkinka.de>2011-09-28 20:39:05 +0000
commit47456c0de8a408bca9b5a02a0fbc835ff1c01a68 (patch)
treedca2ead5e7159b28aa323465a363f81813f75acd /modules/gallery/helpers
parentd8dffba94277c2179a59eb72d6927a5bdb879648 (diff)
parentdfbfe090168ee4ed44e2c8208e79d3fe40f90437 (diff)
Manually fixed a merge conflict after pulling.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/item.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php
index 7e779544..0bb45e49 100644
--- a/modules/gallery/helpers/item.php
+++ b/modules/gallery/helpers/item.php
@@ -402,4 +402,22 @@ class item_Core {
return $position;
}
+
+ /**
+ * Set the display context callback for any future item renders.
+ */
+ static function set_display_context_callback() {
+ $args = func_get_args();
+ Cache::instance()->set("display_context_" . $sid = Session::instance()->id(), $args);
+ }
+
+ /**
+ * Call the display context callback for the given item
+ */
+ static function get_display_context($item) {
+ $args = Cache::instance()->get("display_context_" . $sid = Session::instance()->id());
+ $callback = $args[0];
+ $args[0] = $item;
+ return call_user_func_array($callback, $args);
+ }
} \ No newline at end of file