From cfaa62370ecbdb3badf4ab68bbefa7cfedaea154 Mon Sep 17 00:00:00 2001 From: Joe7 Date: Sun, 2 Jan 2011 18:59:23 +0100 Subject: Reimplemented Kohana 2.3's View::set_global() with array support. Allows for cleaner code and fewer function calls. --- modules/gallery/libraries/MY_View.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'modules/gallery/libraries') diff --git a/modules/gallery/libraries/MY_View.php b/modules/gallery/libraries/MY_View.php index ded77792..2230203a 100644 --- a/modules/gallery/libraries/MY_View.php +++ b/modules/gallery/libraries/MY_View.php @@ -23,8 +23,14 @@ class View extends View_Core { /** * Reimplement Kohana 2.3's View::set_global() functionality. */ - public function set_global($key, $value) { - View::$global_data[$key] = $value; + public function set_global($key, $value = NULL) { + if (is_array($key)) { + foreach ($key as $key2 => $value) { + View::$global_data[$key2] = $value; + } + } else { + View::$global_data[$key] = $value; + } } public function is_set($key=null) { -- cgit v1.2.3