$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); break; case 'remove': // do the module specific stuff $AppUI->setMsg($setup->remove()); // remove from the installed modules table $obj->remove(); $AppUI->setMsg('Module removed', UI_MSG_ALERT, true); break; case 'upgrade': if ($setup->upgrade($obj->mod_version)) { $obj->bind($config); $obj->store(); $AppUI->setMsg('Module upgraded', UI_MSG_OK); } else {
// 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; case "install": if ($module->mod_version = $setup->upgrade($module->mod_version)) { $module->mod_type = $setup->mod_type; $module->install(); if ($setup->mod_version == $module->mod_version) { CAppUI::setMsg("Installation de '%s' à la version %s", UI_MSG_OK, $module->mod_name, $setup->mod_version); } else { CAppUI::setMsg("Installation de '{$module->mod_name}' à la version {$module->mod_version} sur {$setup->mod_version}", UI_MSG_WARNING, true); } } else { CAppUI::setMsg("Module '{$module->mod_name}' non installé", UI_MSG_ERROR, true); } // In case the setup has added some user prefs CAppUI::buildPrefs(); break; case "upgrade": if ($module->mod_version = $setup->upgrade($module->mod_version)) { $module->mod_type = $setup->mod_type; $module->store();