mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
Add $this->request to module and template instances
This commit is contained in:
parent
a196706d7f
commit
96330593fd
2 changed files with 7 additions and 3 deletions
|
|
@ -32,6 +32,7 @@ class ModuleObject extends BaseObject
|
||||||
|
|
||||||
// Variables for convenience
|
// Variables for convenience
|
||||||
public $user;
|
public $user;
|
||||||
|
public $request;
|
||||||
|
|
||||||
// Other variables for compatibility
|
// Other variables for compatibility
|
||||||
public $ajaxRequestMethod = array('XMLRPC', 'JSON');
|
public $ajaxRequestMethod = array('XMLRPC', 'JSON');
|
||||||
|
|
@ -89,6 +90,7 @@ class ModuleObject extends BaseObject
|
||||||
{
|
{
|
||||||
$obj->user = Rhymix\Framework\Session::getMemberInfo();
|
$obj->user = Rhymix\Framework\Session::getMemberInfo();
|
||||||
}
|
}
|
||||||
|
$obj->request = \Context::getCurrentRequest();
|
||||||
|
|
||||||
// Return the instance.
|
// Return the instance.
|
||||||
return $GLOBALS['_module_instances_'][$class_name] = $obj;
|
return $GLOBALS['_module_instances_'][$class_name] = $obj;
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,10 @@ namespace Rhymix\Framework;
|
||||||
class Template
|
class Template
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Properties for user
|
* Properties for convenience
|
||||||
*/
|
*/
|
||||||
public $user;
|
public $user;
|
||||||
|
public $request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Properties for configuration
|
* Properties for configuration
|
||||||
|
|
@ -81,8 +82,9 @@ class Template
|
||||||
// Initialize configuration.
|
// Initialize configuration.
|
||||||
$this->_initConfig();
|
$this->_initConfig();
|
||||||
|
|
||||||
// Set user information.
|
// Set user and current request information.
|
||||||
$this->user = Session::getMemberInfo() ?: new Helpers\SessionHelper();
|
$this->user = Session::getMemberInfo() ?: new Helpers\SessionHelper();
|
||||||
|
$this->request = \Context::getCurrentRequest();
|
||||||
|
|
||||||
// Populate static properties for optimization.
|
// Populate static properties for optimization.
|
||||||
if (self::$_mtime === null)
|
if (self::$_mtime === null)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue