diff options
author | Nathan Kinkade <nath@nkinka.de> | 2011-09-28 20:39:05 +0000 |
---|---|---|
committer | Nathan Kinkade <nath@nkinka.de> | 2011-09-28 20:39:05 +0000 |
commit | 47456c0de8a408bca9b5a02a0fbc835ff1c01a68 (patch) | |
tree | dca2ead5e7159b28aa323465a363f81813f75acd /modules/gallery/helpers | |
parent | d8dffba94277c2179a59eb72d6927a5bdb879648 (diff) | |
parent | dfbfe090168ee4ed44e2c8208e79d3fe40f90437 (diff) |
Manually fixed a merge conflict after pulling.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/item.php | 18 |
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 |