1: <?php
2: /**
3: *
4: * @package Legacy
5: * @version $Id: Legacy_HttpContext.class.php,v 1.4 2008/09/25 15:12:00 kilica Exp $
6: * @copyright Copyright 2005-2007 XOOPS Cube Project <https://github.com/xoopscube/legacy>
7: * @license https://github.com/xoopscube/legacy/blob/master/docs/GPL_V2.txt GNU GENERAL PUBLIC LICENSE Version 2
8: *
9: */
10:
11: if (!defined('XOOPS_ROOT_PATH')) exit();
12:
13: require_once XOOPS_ROOT_PATH . "/modules/legacy/kernel/Legacy_Module.class.php";
14:
15: /**
16: * @public
17: * @brief [Secret Agreement] The context class for Legacy which extends to keep
18: * Legacy-module-specific informations.
19: * @attention
20: * Only Legacy_Controller or its sub-classes calls this constructor.
21: */
22: class Legacy_HttpContext extends XCube_HttpContext
23: {
24: /**
25: * @public
26: * @brief [READ ONLY] XoopsUser - The current user profile object.
27: */
28: var $mXoopsUser = null;
29:
30: /**
31: * @public
32: * @brief [READ ONLY] Legacy_AbstractModule - The current module instance.
33: */
34: var $mModule = null;
35:
36: /**
37: * @public
38: * @brief [READ ONLY] XoopsModule - The current Xoops Module object.
39: * @remarks
40: * This is a shortcut to mModule->mXoopsModule.
41: */
42: var $mXoopsModule = null;
43:
44: /**
45: * @public
46: * @brief [READ ONLY] Map Array - std::map<string, mixed>
47: *
48: * This is string collection which indicates site configurations by a site owner.
49: * Those configuration informations are loaded by the controller, and set. This
50: * configuration and the site configuration of XCube_Root are different.
51: *
52: * The array for Xoops, which is configured in the preference of the base. This
53: * property and $xoopsConfig (X2) is the same.
54: */
55: var $mXoopsConfig = array();
56:
57: /**
58: * @public
59: * @var [READ ONLY] Map Array - std::map<string, mixed> - The array for Xoops Module Config.
60: * @remarks
61: * This is a short cut to mModule->mConfig.
62: */
63: var $mModuleConfig = array();
64:
65: /**
66: * @public
67: * @internal
68: * @brief [Secret Agreement] A name of the render system used by the controller strategy.
69: * @attention
70: * This member is used for only Legacy_Controller.
71: */
72: var $mBaseRenderSystemName = "";
73:
74: /**
75: * @public
76: * @brief Gets a value of XoopsConfig by $id.
77: * @param $id string
78: * @return mixed
79: */
80: function getXoopsConfig($id = null)
81: {
82: if ($id != null) {
83: return isset($this->mXoopsConfig[$id]) ? $this->mXoopsConfig[$id] : null;
84: }
85:
86: return $this->mXoopsConfig;
87: }
88:
89: /**
90: * @public
91: * @brief Sets the name of the current theme.
92: * @param $name string
93: * @return void
94: * @attention
95: * This method is for the theme changer feature. However, this API will be
96: * changed.
97: */
98: function setThemeName($name)
99: {
100: parent::setThemeName($name);
101: $this->mXoopsConfig['theme_set'] = $name;
102: $GLOBALS['xoopsConfig']['theme_set'] = $name;
103: }
104: }
105:
106: ?>
107: