예제 #1
0
function output_modules()
{
    $modules = mod_listinstalled();
    foreach ($modules as $mod => $name) {
        /*{*/
        if (mod_checkisinstalled($mod)) {
            if (mod_getadmin($mod)) {
                if (ses_get("admin")) {
                    echo output_link("?m=" . $mod, $name) . "<br />";
                }
            } else {
                echo output_link("?m=" . $mod, $name) . "<br />";
            }
        }
    }
    /*}*/
}
예제 #2
0
function AdminModules_listavailablemodules()
{
    $modulesavailable = array();
    $modules = array();
    $dir = opendir("modules/");
    while ($file = readdir($dir)) {
        if ($file != "." && $file != ".." && is_dir("modules/" . $file)) {
            $modulesavailable[] = $file;
        }
    }
    $modulesinstalled = mod_listinstalled();
    foreach ($modulesavailable as $i => $modavailable) {
        foreach ($modulesinstalled as $j => $modinstalled) {
            if ($modavailable == $modinstalled) {
                $modules[$modavailable] = 1;
                break;
            } else {
                $modules[$modavailable] = 0;
            }
        }
    }
    ksort($modules);
    return $modules;
}