<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage System
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkAdmin();
CModule::loadModules(false);
$setupClasses = CApp::getChildClasses("CSetup");
$mbmodules = array("notInstalled" => array(), "installed" => array());
$coreModules = array();
$upgradable = false;
foreach ($setupClasses as $setupClass) {
    if (!class_exists($setupClass)) {
        continue;
    }
    $setup = new $setupClass();
    $mbmodule = new CModule();
    $mbmodule->compareToSetup($setup);
    $mbmodule->checkModuleFiles();
    $mbmodule->getUpdateMessages($setup, true);
    $mbmodule->updateFormFields();
    if ($mbmodule->mod_ui_order == 1000) {
        $mbmodules["notInstalled"][$mbmodule->mod_name] = $mbmodule;
    } else {
        $mbmodules["installed"][$mbmodule->mod_name] = $mbmodule;