15 trigger_error(
"The package only works for XOOPS 2.3+", E_USER_ERROR );
18 if (!defined(
"FRAMEWORKS_ART_FUNCTIONS_INI")):
19 define(
"FRAMEWORKS_ART_FUNCTIONS_INI",
true);
21 define(
"FRAMEWORKS_ROOT_PATH", XOOPS_ROOT_PATH .
"/Frameworks");
33 $handlerClass =
"ArtObject";
34 $fileName =
"object.php";
36 $handlerClass =
"ArtObject".ucfirst(
$handler).
"Handler";
37 $fileName =
"object.{$handler}.php";
41 return class_exists($handlerClass);
59 $constant = strtoupper(
"frameworks_{$dirname}_functions" . (($group) ?
"_{$group}" :
""));
60 if (defined($constant))
return true;
61 return include_once
FRAMEWORKS_ROOT_PATH .
"/{$dirname}/functions.{$group}" . (empty($group) ?
"" :
"." ) .
"php";
80 $constant = strtoupper(
"{$dirname}_functions" . ( ($group) ?
"_{$group}" :
"" ) .
"_loaded" );
81 if (defined($constant))
return true;
82 $filename = XOOPS_ROOT_PATH .
"/modules/{$dirname}/include/functions.{$group}" . (empty($group) ?
"" :
"." ) .
"php";
83 return include_once $filename;
99 $renderer = ucfirst(
$dirname) . ucfirst($class) .
"Renderer";
100 if (!class_exists($renderer)) {
101 require_once XOOPS_ROOT_PATH .
"/modules/{$dirname}/class/{$class}.renderer.php";
103 $instance = eval(
"{$renderer}::instance()");
112 if (!function_exists(
"mod_constant")) {
113 function mod_constant($name)
115 if (!empty(
$GLOBALS[
"VAR_PREFIXU"]) && @defined(
$GLOBALS[
"VAR_PREFIXU"] .
"_" . strtoupper($name))) {
116 return CONSTANT(
$GLOBALS[
"VAR_PREFIXU"] .
"_" . strtoupper($name));
117 } elseif (!empty(
$GLOBALS[
"xoopsModule"]) && @defined(strtoupper(
$GLOBALS[
"xoopsModule"]->getVar(
"dirname",
"n") .
"_" . $name))) {
118 return CONSTANT(strtoupper(
$GLOBALS[
"xoopsModule"]->getVar(
"dirname",
"n") .
"_" . $name));
119 } elseif (defined(strtoupper($name))) {
120 return CONSTANT(strtoupper($name));
122 return str_replace(
"_",
" ", strtolower($name));
133 if (!function_exists(
"mod_DB_prefix")) {
134 function mod_DB_prefix($name, $isRel =
false)
136 $relative_name =
$GLOBALS[
"MOD_DB_PREFIX"] .
"_" . $name;
137 if ($isRel)
return $relative_name;
138 return $GLOBALS[
"xoopsDB"]->prefix($relative_name);
147 if (!function_exists(
"xoops_message")):
148 function xoops_message( $message, $userlevel = 0)
152 if (!$xoopsUser) $level = 0;
153 elseif ($xoopsUser->isAdmin()) $level = 99;
155 if ($userlevel > $level)
return;
157 echo
"<div style=\"clear:both\"> </div>";
158 if (is_array($message) || is_object($message)) {
163 echo
"<div>{$message}</div>";
165 echo
"<div style=\"clear:both\"> </div>";
171 if (!empty($xoopsModuleConfig[
"do_debug"])) {
172 if (is_array($message) || is_object($message)) {
177 echo
"<div>$message</div>";
209 !empty(
$GLOBALS[
"xoopsModule"]) &&
"system" ==
$GLOBALS[
"xoopsModule"]->getVar(
"dirname",
"n")
215 (
"update_ok" ==
$_POST[
"op"] ||
"install_ok" ==
$_POST[
"op"] ||
"uninstall_ok" ==
$_POST[
"op"])
218 "modulesadmin" ==
$_POST[
"fct"]