} break; case "modules": // Retrieve a list of available modules. require_once './include/api/modules.php'; $list = phorum_api_modules_list(); // Process posted form data if (isset($_POST["do_modules_update"])) { foreach ($_POST as $key => $value) { $key = base64_decode($key); if (substr($key, 0, 5) == "mods_") { $mod = substr($key, 5); if ($value) { phorum_api_modules_enable($mod); } else { phorum_api_modules_disable($mod); } } } phorum_api_modules_save(); $step = "done"; } break; } } // THIS IS THE OUTPUT STEP if (isset($PHORUM["installed"]) && $PHORUM["installed"]) { $step = "done"; } switch ($step) { case "start":
} } // ---------------------------------------------------------------------- // Build the form // ---------------------------------------------------------------------- // Just used for building form elements. include_once "./include/admin/PhorumInputForm.php"; $frm = new PhorumInputForm("", "post", ""); $frm_url = phorum_admin_build_url(); $html = "<form id=\"modules_form\" " . "action=\"{$frm_url}\" method=\"post\">" . "<input type=\"hidden\" name=\"phorum_admin_token\"\n value=\"{$PHORUM['admin_token']}\" />" . "<input style=\"display:none\" type=\"submit\" " . "value=\"catch [enter] key\" onclick=\"return false\"/>" . "<input type=\"hidden\" name=\"module\" value=\"mods\" />" . "<input type=\"hidden\" name=\"do_module_updates\" value=\"1\" />" . "<div class=\"PhorumAdminTitle\">Phorum module settings</div>" . "<div class=\"modules_filter\">" . "<strong>Filter:</strong> " . "show " . $frm->select_tag('filter_status', array(0 => 'all', 1 => 'enabled', 2 => 'disabled'), isset($_POST['filter_status']) ? $_POST['filter_status'] : 0, 'onchange="filter_modules(this.form)"') . " modules, matching " . $frm->text_box('filter_text', isset($_POST['filter_text']) ? $_POST['filter_text'] : '', 30, NULL, FALSE, 'onkeyup="filter_modules(this.form)" id="filter_text"') . $frm->checkbox('hide_description', 1, 'hide descriptions', isset($_POST['hide_description']) ? 1 : 0, 'style="margin-left:1em" ' . 'onchange="filter_modules(this.form)" ' . 'id="hide_descriptions"') . "</div>"; foreach ($list['modules'] as $name => $info) { // Disable a module if it's enabled, but should be disabled based // on the Phorum version. if ($info['version_disabled'] && $info['enabled']) { phorum_admin_error("Minimum Phorum-Version requirement not met for " . "module \"" . htmlspecialchars($name) . "\"<br/>" . "It requires at least version " . "\"" . htmlspecialchars($info['required_version']) . "\", " . "but the current version is \"" . PHORUM . "\".<br />" . "The module was disabled to avoid malfunction of " . "your Phorum because of that requirement.<br/>"); phorum_api_modules_disable($name); phorum_api_modules_save(); $info['version_disabled'] = TRUE; } $id = base64_encode("mods_{$name}"); $title = $info["title"]; if (isset($info["version"])) { $title .= " (version " . $info["version"] . ")"; } // Compatibility modules are handles in a special way. These are // not enabled from the admin panel. Instead, they are automatically // loaded when required from the start of common.php. $is_compat = FALSE; if (!empty($info['compat'])) { foreach ($info['compat'] as $function => $extension) { if (!function_exists($function)) {