getDB();
/*
$modfunct = create_function('','
echo "Hallo";
');
call_user_func($modfunct);
*/
function getInfo($file) {
$info = array();
include($file);
return $info;
}
function findModules($basepath) {
// echo 'searching in '.$basepath.'
';
$mods = array();
foreach (scandir($basepath) as $entry) {
if ($entry[0] == '.' || $entry[0] == '_') // on . and .. or module data directories (starting with a _) skip the entry
continue;
if (is_dir($basepath.__DS__.$entry))
$mods = array_merge($mods,findModules($basepath.__DS__.$entry));
}
if (file_exists($basepath.__DS__.'_info_.php')) {
$info = getInfo($basepath.__DS__.'_info_.php');
$mod = new stdClass();
$mod->name = $info['title'];
$mod->version = $info['version'];
$mod->abstract = (isset($info['abstract'])) && $info['abstract'] == true;
$mod->noinstall = isset($info['noinstall']) && $info['noinstall'] === true;
$mod->classfile = $entry;
$mod->dir = $basepath;
$mod->setup = isset($info['setup']) ? $info['setup'] : false;
$baseurl = _BASEURL_.str_replace(__DS__,'/',substr($basepath,strlen( _BASEPATH_)));
$imgpath = implode('/',array($basepath,'_admin_','images','icon16.png'));
$imgpathweb = $baseurl.'/_admin_/images/icon16.png';
$mod->icon = file_exists($imgpath) ? $imgpathweb : false;
$mods[] = $mod;
}
return $mods;
}
$mod1 = findModules(_MODPATH_);
foreach($mod1 as $key => &$info)
$info->dir = substr($info->dir,strlen(_MODPATH_)+1);
$mod2 = findModules(_MODPATHX_);
foreach($mod2 as $key => &$info)
$info->dir = substr($info->dir,strlen(_MODPATHX_)+1);
$modules = array_merge($mod1,$mod2);
unset($mod1, $mod2);
foreach($modules as &$info)
$info->namespace = str_replace(__DS__,'.',$info->dir);
?>
Name | Version | Status | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
= $mod->icon ? ' |
= $mod->name ?> | = $mod->namespace ?> | = $mod->version ?> | = $mod->noinstall ? 'Keine Installation' : ($mod->abstract ? 'Gundbaustein' :($installed ? $version : 'Nicht installiert')) ?> | noinstall) echo ' | '; elseif ($mod->abstract) echo ' | '; else { if (!$installed) { if (!defined('FREEZE')) echo ' | ![]() | '; } else { switch (version_compare($version, $mod->version)) { case -1: echo ' | ![]() ![]() | ';
if (!defined('FREEZE')) {
echo '![]() ![]() | ERROR: InstVer<ScriptVer'; break; } } } ?> |