Hacked in some public variables

Very hacky, switched variables to public and added a catch in the __get method to assign to the right place for the variables that modules are using (instead of having to update all of the modules in the wild)
This commit is contained in:
Joshua Sherman 2013-12-28 16:22:22 -05:00
parent a4bf33cce2
commit a050c7d031

View file

@ -167,7 +167,7 @@ class Module extends Object
* @access protected * @access protected
* @var string, 'index' by default * @var string, 'index' by default
*/ */
protected $template = 'index'; public $template = 'index';
/** /**
* Return * Return
@ -180,7 +180,8 @@ class Module extends Object
* @access protected * @access protected
* @var array * @var array
*/ */
protected $return = array(); protected $return_data = array();
public $return = array();
/** /**
* Constructor * Constructor
@ -242,7 +243,14 @@ class Module extends Object
*/ */
public function __set($name, $value) public function __set($name, $value)
{ {
$this->return[$name] = $value; if ($name == 'method')
{
$this->method = $value;
}
else
{
$this->return_data[$name] = $value;
}
} }
/** /**
@ -308,6 +316,11 @@ class Module extends Object
if ($this->validate !== false) if ($this->validate !== false)
{ {
if (is_array($this->method))
{
$this->method = $this->method[0];
}
switch (strtoupper($this->method)) switch (strtoupper($this->method))
{ {
case 'GET': $global = &$_GET; break; case 'GET': $global = &$_GET; break;