$AppUI->setMsg('Module does not have a valid setup class defined', UI_MSG_ERROR);
        $AppUI->redirect();
    }
} else {
    $setup = new $setupclass();
}
switch ($cmd) {
    case 'moveup':
    case 'movedn':
        $obj->move($cmd);
        $AppUI->setMsg('Module re-ordered', UI_MSG_OK);
        break;
    case 'toggle':
        // just toggle the active state of the table entry
        $obj->mod_active = 1 - $obj->mod_active;
        $obj->store();
        $AppUI->setMsg('Module state changed', UI_MSG_OK);
        break;
    case 'toggleMenu':
        // just toggle the active state of the table entry
        $obj->mod_ui_active = 1 - $obj->mod_ui_active;
        $obj->store();
        $AppUI->setMsg('Module menu state changed', UI_MSG_OK);
        break;
    case 'install':
        // do the module specific stuff
        $AppUI->setMsg($setup->install());
        $obj->bind($config);
        // add to the installed modules table
        $obj->install();
        $AppUI->setMsg('Module installed', UI_MSG_OK, true);
Ejemplo n.º 2
0
    CAppUI::setMsg("Core modules can't be uninstalled or disactivated", UI_MSG_ERROR);
    CAppUI::redirect();
}
if (!$module->_files_missing) {
    $setup = new $setupclass();
}
switch ($cmd) {
    case "moveup":
    case "movedn":
        $module->move($cmd);
        CAppUI::setMsg("CModule-msg-reordered", UI_MSG_OK);
        break;
    case "toggle":
        // just toggle the active state of the table entry
        $module->mod_active = 1 - $module->mod_active;
        $module->store();
        CAppUI::setMsg("CModule-msg-state-changed", UI_MSG_OK);
        break;
    case "toggleMenu":
        // just toggle the active state of the table entry
        $module->mod_ui_active = 1 - $module->mod_ui_active;
        $module->store();
        CAppUI::setMsg("CModule-msg-state-changed", UI_MSG_OK);
        break;
    case "remove":
        $success = $module->_files_missing ? true : $setup->remove();
        if ($success !== null) {
            $module->delete();
            CAppUI::setMsg("CModule-msg-removed", $success ? UI_MSG_OK : UI_MSG_ERROR, true);
        }
        break;