$AppUI->redirect(); } } $setupclass = $config['mod_setup_class']; if (!$setupclass) { if ($obj->mod_type != 'core') { $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':
if ($module->mod_type != "core" && !$module->_files_missing) { CAppUI::setMsg("CModule-msg-no-setup", UI_MSG_ERROR); CAppUI::redirect(); } } if ($module->mod_type == "core" && in_array($cmd, array("remove", "install", "toggle"))) { 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":