/**
 * Logic and rendering for listing modules
 * @return NULL	Assigns content to the template
 */
function xoops_module_list()
{
    global $icmsAdminTpl, $icmsConfig;
    $icmsAdminTpl->assign('lang_madmin', _MD_AM_MODADMIN);
    $icmsAdminTpl->assign('lang_module', _MD_AM_MODULE);
    $icmsAdminTpl->assign('lang_version', _MD_AM_VERSION);
    $icmsAdminTpl->assign('lang_modstatus', _MD_AM_MODULESADMIN_STATUS);
    $icmsAdminTpl->assign('lang_lastup', _MD_AM_LASTUP);
    $icmsAdminTpl->assign('lang_active', _MD_AM_ACTIVE);
    $icmsAdminTpl->assign('lang_order', _MD_AM_ORDER);
    $icmsAdminTpl->assign('lang_order0', _MD_AM_ORDER0);
    $icmsAdminTpl->assign('lang_action', _MD_AM_ACTION);
    $icmsAdminTpl->assign('lang_modulename', _MD_AM_MODULESADMIN_MODULENAME);
    $icmsAdminTpl->assign('lang_moduletitle', _MD_AM_MODULESADMIN_MODULETITLE);
    $icmsAdminTpl->assign('lang_info', _INFO);
    $icmsAdminTpl->assign('lang_update', _MD_AM_UPDATE);
    $icmsAdminTpl->assign('lang_unistall', _MD_AM_UNINSTALL);
    $icmsAdminTpl->assign('lang_support', _MD_AM_MODULESADMIN_SUPPORT);
    $icmsAdminTpl->assign('lang_submit', _MD_AM_SUBMIT);
    $icmsAdminTpl->assign('lang_install', _MD_AM_INSTALL);
    $icmsAdminTpl->assign('lang_installed', _MD_AM_INSTALLED);
    $icmsAdminTpl->assign('lang_noninstall', _MD_AM_NONINSTALL);
    $module_handler = icms::handler('icms_module');
    $installed_mods =& $module_handler->getObjects();
    $listed_mods = array();
    foreach ($installed_mods as $module) {
        $module->registerClassPath(FALSE);
        $module->getInfo();
        $mod = array('mid' => $module->getVar('mid'), 'dirname' => $module->getVar('dirname'), 'name' => $module->getInfo('name'), 'title' => $module->getVar('name'), 'image' => $module->getInfo('image'), 'adminindex' => $module->getInfo('adminindex'), 'hasadmin' => $module->getVar('hasadmin'), 'hasmain' => $module->getVar('hasmain'), 'isactive' => $module->getVar('isactive'), 'version' => icms_conv_nr2local(round($module->getVar('version') / 100, 2)), 'status' => $module->getInfo('status') ? $module->getInfo('status') : ' ', 'last_update' => $module->getVar('last_update') != 0 ? formatTimestamp($module->getVar('last_update'), 'm') : ' ', 'weight' => $module->getVar('weight'), 'support_site_url' => $module->getInfo('support_site_url'));
        $icmsAdminTpl->append('modules', $mod);
        $listed_mods[] = $module->getVar('dirname');
    }
    $dirlist = icms_module_Handler::getAvailable();
    $uninstalled = array_diff($dirlist, $listed_mods);
    foreach ($uninstalled as $file) {
        clearstatcache();
        $file = trim($file);
        $module =& $module_handler->create();
        if (!$module->loadInfo($file, FALSE)) {
            continue;
        }
        $mod = array('dirname' => $module->getInfo('dirname'), 'name' => $module->getInfo('name'), 'image' => $module->getInfo('image'), 'version' => icms_conv_nr2local(round($module->getInfo('version'), 2)), 'status' => $module->getInfo('status'));
        $icmsAdminTpl->append('avmodules', $mod);
        unset($module);
    }
    return $icmsAdminTpl->fetch('db:admin/modulesadmin/system_adm_modulesadmin.html');
}
Example #2
0
 /**
  * Gets a list of module folders from the modules directory
  * @todo	Remove in version 1.4
  * @deprecated	Use icms_module_Handler::getAvailable, instead
  */
 public static function getModulesList()
 {
     icms_core_Debug::setDeprecated('icms_module_Handler::getAvailable', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
     return icms_module_Handler::getAvailable();
 }
            /*        	include_once "./class/mainfilemanager.php";
            			 $mm = new mainfile_manager("../mainfile.php");
            			 $mm->setRewrite('PROTECTOR1', 'include  XOOPS_TRUST_PATH.\'/modules/protector/include/precheck.inc.php\')' ;
            			 $mm->setRewrite('PROTECTOR2', 'include  XOOPS_TRUST_PATH.\'/modules/protector/include/postcheck.inc.php\')' ;
            
            			 $result = $mm->doRewrite();
            			 $mm->report();*/
        }
        $tables = array();
        $content .= "<div style='height:auto;max-height:400px;overflow:auto;'>" . $dbm->report() . "</div>";
    } else {
        $wizard->redirectToPage('+1');
        exit;
    }
} else {
    $content .= '<div>' . _INSTALL_SELECT_MODS_INTRO . '</div>';
    $content .= '<div class="dbconn_line">';
    $content .= '<h3>' . _INSTALL_SELECT_MODULES . '</h3>';
    $content .= '<div id="modinstall" name="install_mods[]">';
    $langarr = icms_module_Handler::getAvailable();
    foreach ($langarr as $lang) {
        if ($lang == 'system' || $lang == 'protector') {
            continue;
        }
        $content .= "<div class=\"langselect\" style=\"text-decoration: none;\"><a href=\"javascript:void(0);\" style=\"text-decoration: none;\"><img src=\"../modules/{$lang}/images/icon_small.png\" alt=\"{$lang}\" /><br />{$lang} <br /><input type=\"checkbox\" checked=\"checked\" name=\"install_mods[]\" value=\"{$lang}\" /></a></div>";
    }
    $content .= "</div><div class='clear'>&nbsp;</div>";
    $content .= '</div>';
    $content .= '<input type="hidden" name="mod" value="1" />';
}
include 'install_tpl.php';