Site/Module setup work and auto_format fixes

This commit is contained in:
Deon George
2012-01-02 12:35:47 +11:00
parent 407eed04c9
commit a464d73f9a
19 changed files with 138 additions and 26 deletions

View File

@@ -46,14 +46,17 @@ class Model_Setup extends ORMOSB {
if (! $mo->loaded())
throw new Kohana_Exception('Unknown module :name',array(':name'=>$key));
$mc = $this->module_config ? $this->module_config : array();
// If $value is NULL, we are a getter
if ($value === NULL)
return empty($this->module_config[$mo->id]) ? array() : $this->module_config[$mo->id];
return empty($mc[$mo->id]) ? array() : $mc[$mo->id];
// Store new value
$this->module_config[$mo->id] = $value;
$mc[$mo->id] = $value;
$this->module_config = $mc;
return $value;
return $this;
}
/**
@@ -73,7 +76,7 @@ class Model_Setup extends ORMOSB {
// Store new value
$sc[$key] = $value;
return $value;
return $this;
}
}
?>