summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-11-25 14:50:29 -0800
committerBharat Mediratta <bharat@menalto.com>2009-11-25 14:50:29 -0800
commit7eacc465d53d08ced85114b0a4ddc26b3fed848e (patch)
tree30ff516ea27f58ef291d4824e470d317e241885c /modules
parent8b7ef660650e3711442972aabcd545959ee9bc94 (diff)
Fix set_global() to be more elegant and preserve local trumping
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/libraries/MY_View.php20
1 files changed, 3 insertions, 17 deletions
diff --git a/modules/gallery/libraries/MY_View.php b/modules/gallery/libraries/MY_View.php
index d1ec6684..45aae188 100644
--- a/modules/gallery/libraries/MY_View.php
+++ b/modules/gallery/libraries/MY_View.php
@@ -25,21 +25,6 @@ class View extends View_Core {
*/
public function set_global($key, $value) {
View::$global_data[$key] = $value;
- $this->$key = $value;
- }
-
- public function __isset($key) {
- if (array_key_exists($key, View::$global_data)) {
- return true;
- }
- return parent::__isset($key);
- }
-
- public function &__get($key) {
- if (array_key_exists($key, View::$global_data)) {
- return View::$global_data[$key];
- }
- return parent::__get($key);
}
/**
@@ -58,9 +43,10 @@ class View extends View_Core {
*
* @see View_Core::render
*/
- public function render($print=false, $renderer=false) {
+ public function render($print=false, $renderer=false, $modifier=false) {
try {
- return parent::render($print, $renderer);
+ $this->kohana_local_data = array_merge(View::$global_data, $this->kohana_local_data);
+ return parent::render($print, $renderer, $modifier);
} catch (Exception $e) {
Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
return "";