Пример #1
0
 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;
 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);
     }