20 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
27 static function load($name,
$type =
"core")
32 if (!isset($deprecated)) {
34 'uploader' =>
'xoopsmediauploader',
35 'utility' =>
'xoopsutility',
36 'captcha' =>
'xoopscaptcha',
37 'cache' =>
'xoopscache',
38 'file' =>
'xoopsfile',
39 'model' =>
'xoopsmodelfactory',
40 'calendar' =>
'xoopscalendar',
41 'userutility' =>
'xoopsuserutility',
44 $name = strtolower($name);
45 if (in_array(
$type,array(
'core',
'class')) && array_key_exists($name, $deprecated)) {
46 if (isset(
$GLOBALS[
'xoopsLogger'])) {
47 $GLOBALS[
'xoopsLogger']->addDeprecated(
"xoops_load('{$name}') is deprecated, use xoops_load('{$deprecated[$name]}')");
49 trigger_error(
"xoops_load('{$name}') is deprecated, use xoops_load('{$deprecated[$name]}')", E_USER_WARNING);
51 $name = $deprecated[$name];
55 if (isset($loaded[
$type][$name])) {
56 return $loaded[
$type][$name];
59 if (class_exists($name,
false)) {
60 $loaded[
$type][$name] =
true;
77 $loaded[
$type][$name] = $isloaded;
78 return $loaded[
$type][$name];
86 static function loadCore($name)
95 if (class_exists($name) && method_exists($name,
'__autoload')) {
96 call_user_func(array($name ,
'__autoload'));
99 } elseif (file_exists(
$file = XOOPS_ROOT_PATH .
'/class/' . $name .
'.php')) {
101 $class =
'Xoops' . ucfirst($name);
102 if (class_exists($class)) {
105 trigger_error(
'Class ' . $name .
' not found in file ' . __FILE__ .
'at line ' . __LINE__, E_USER_WARNING);
116 function loadFramework($name)
118 if (!file_exists(
$file = XOOPS_ROOT_PATH .
'/Frameworks/' . $name .
'/xoops' . $name .
'.php')) {
119 trigger_error(
'File ' . str_replace(XOOPS_ROOT_PATH,
'',
$file) .
' not found in file ' . __FILE__ .
' at line ' . __LINE__, E_USER_WARNING);
123 $class =
'Xoops' . ucfirst($name);
124 if (class_exists($class)) {
138 if (file_exists(
$file = XOOPS_ROOT_PATH .
'/modules/' .
$dirname .
'/class/' . $name .
'.php')) {
140 if (class_exists(ucfirst(
$dirname) . ucfirst($name))) {
152 static function loadCoreConfig()
155 'xoopsuserutility' => XOOPS_ROOT_PATH .
'/class/userutility.php',
156 'xoopsmediauploader' => XOOPS_ROOT_PATH .
'/class/uploader.php',
157 'xoopsutility' => XOOPS_ROOT_PATH .
'/class/utility/xoopsutility.php',
158 'xoopscaptcha' => XOOPS_ROOT_PATH .
'/class/captcha/xoopscaptcha.php',
159 'xoopscache' => XOOPS_ROOT_PATH .
'/class/cache/xoopscache.php',
160 'xoopsfile' => XOOPS_ROOT_PATH .
'/class/file/xoopsfile.php',
161 'xoopsmodelfactory' => XOOPS_ROOT_PATH .
'/class/model/xoopsmodel.php',
162 'xoopscalendar' => XOOPS_ROOT_PATH .
'/class/calendar/xoopscalendar.php',
163 'xoopskernel' => XOOPS_ROOT_PATH .
'/class/xoopskernel.php',
164 'xoopssecurity' => XOOPS_ROOT_PATH .
'/class/xoopssecurity.php',
165 'xoopslogger' => XOOPS_ROOT_PATH .
'/class/logger/xoopslogger.php',
166 'xoopspagenav' => XOOPS_ROOT_PATH .
'/class/pagenav.php',
167 'xoopslists' => XOOPS_ROOT_PATH .
'/class/xoopslists.php',
168 'xoopslocal' => XOOPS_ROOT_PATH .
'/include/xoopslocal.php',
169 'xoopslocalabstract' => XOOPS_ROOT_PATH .
'/class/xoopslocal.php',
170 'xoopseditor' => XOOPS_ROOT_PATH .
'/class/xoopseditor/xoopseditor.php',
171 'xoopseditorhandler' => XOOPS_ROOT_PATH .
'/class/xoopseditor/xoopseditor.php',
172 'xoopsformloader' => XOOPS_ROOT_PATH .
'/class/xoopsformloader.php',
173 'xoopsformelement' => XOOPS_ROOT_PATH .
'/class/xoopsform/formelement.php',
174 'xoopsform' => XOOPS_ROOT_PATH .
'/class/xoopsform/form.php',
175 'xoopsformlabel' => XOOPS_ROOT_PATH .
'/class/xoopsform/formlabel.php',
176 'xoopsformselect' => XOOPS_ROOT_PATH .
'/class/xoopsform/formselect.php',
177 'xoopsformpassword' => XOOPS_ROOT_PATH .
'/class/xoopsform/formpassword.php',
178 'xoopsformbutton' => XOOPS_ROOT_PATH .
'/class/xoopsform/formbutton.php',
179 'xoopsformbuttontray' => XOOPS_ROOT_PATH .
'/class/xoopsform/formbuttontray.php',
180 'xoopsformcheckbox' => XOOPS_ROOT_PATH .
'/class/xoopsform/formcheckbox.php',
181 'xoopsformselectcheckgroup' => XOOPS_ROOT_PATH .
'/class/xoopsform/formselectcheckgroup.php',
182 'xoopsformhidden' => XOOPS_ROOT_PATH .
'/class/xoopsform/formhidden.php',
183 'xoopsformfile' => XOOPS_ROOT_PATH .
'/class/xoopsform/formfile.php',
184 'xoopsformradio' => XOOPS_ROOT_PATH .
'/class/xoopsform/formradio.php',
185 'xoopsformradioyn' => XOOPS_ROOT_PATH .
'/class/xoopsform/formradioyn.php',
186 'xoopsformselectcountry' => XOOPS_ROOT_PATH .
'/class/xoopsform/formselectcountry.php',
187 'xoopsformselecttimezone' => XOOPS_ROOT_PATH .
'/class/xoopsform/formselecttimezone.php',
188 'xoopsformselectlang' => XOOPS_ROOT_PATH .
'/class/xoopsform/formselectlang.php',
189 'xoopsformselectgroup' => XOOPS_ROOT_PATH .
'/class/xoopsform/formselectgroup.php',
190 'xoopsformselectuser' => XOOPS_ROOT_PATH .
'/class/xoopsform/formselectuser.php',
191 'xoopsformselecttheme' => XOOPS_ROOT_PATH .
'/class/xoopsform/formselecttheme.php',
192 'xoopsformselectmatchoption' => XOOPS_ROOT_PATH .
'/class/xoopsform/formselectmatchoption.php',
193 'xoopsformtext' => XOOPS_ROOT_PATH .
'/class/xoopsform/formtext.php',
194 'xoopsformtextarea' => XOOPS_ROOT_PATH .
'/class/xoopsform/formtextarea.php',
195 'xoopsformdhtmltextarea' => XOOPS_ROOT_PATH .
'/class/xoopsform/formdhtmltextarea.php',
196 'xoopsformelementtray' => XOOPS_ROOT_PATH .
'/class/xoopsform/formelementtray.php',
197 'xoopsthemeform' => XOOPS_ROOT_PATH .
'/class/xoopsform/themeform.php',
198 'xoopssimpleform' => XOOPS_ROOT_PATH .
'/class/xoopsform/simpleform.php',
199 'xoopsformtextdateselect' => XOOPS_ROOT_PATH .
'/class/xoopsform/formtextdateselect.php',
200 'xoopsformdatetime' => XOOPS_ROOT_PATH .
'/class/xoopsform/formdatetime.php',
201 'xoopsformhiddentoken' => XOOPS_ROOT_PATH .
'/class/xoopsform/formhiddentoken.php',
202 'xoopsformcolorpicker' => XOOPS_ROOT_PATH .
'/class/xoopsform/formcolorpicker.php',
203 'xoopsformcaptcha' => XOOPS_ROOT_PATH .
'/class/xoopsform/formcaptcha.php',
204 'xoopsformeditor' => XOOPS_ROOT_PATH .
'/class/xoopsform/formeditor.php',
205 'xoopsformselecteditor' => XOOPS_ROOT_PATH .
'/class/xoopsform/formselecteditor.php',
206 'xoopsformcalendar' => XOOPS_ROOT_PATH .
'/class/xoopsform/formcalendar.php',
216 function loadConfig($data = null)
218 if (is_array($data)) {
221 if (! empty($data)) {
223 } elseif (is_object(
$GLOBALS[
'xoopsModule'])) {
228 if (file_exists(
$file = XOOPS_ROOT_PATH .
'/modules/' .
$dirname .
'/include/autoload.php')) {