$status = in_array($module, $activemodules) ? "on" : "off"; // required modules can not be toggled on and off $toggle_action = NULL; if(!Modules::required($module)) { $toggle_action = in_array($module, $activemodules) ? "off" : "on"; } $menu[] = array( "name" => $module, "status" => $status, "toggle_action" => $toggle_action, "toggle_url" => toggle_url($module, $toggle_action), "swap_up_url" => swap_url($module, $index, $modules[$index-1], $index-1), "swap_down_url" => swap_url($module, $index, $modules[$index+1], $index+1) ); } $img_ext = ($page->branch == 'Basic') ? 'gif' : 'jpg'; $check_imgs = Array( 'on' => $page->img_tag('check-on', $img_ext, 'On', array('border' => '0')), 'off' => $page->img_tag('check-off', $img_ext, 'Off', array('border' => '0')), ); $up_img = $page->img_tag('up', $img_ext, 'Up', array('border' => '0')); $down_img = $page->img_tag('down', $img_ext, 'Down', array('border' => '0')); } require $template;
} $activemodules = Modules::add_required($activemodules); $old_modules = $modules; $modules = Modules::refreshAll($old_modules); $activemodules = Modules::refreshActive($old_modules, $activemodules); setModuleOrder($modules); setActiveModules($activemodules); $menu = array(); foreach ($modules as $index => $module) { $status = in_array($module, $activemodules) ? "on" : "off"; // required modules can not be toggled on and off $toggle_action = NULL; if (!Modules::required($module)) { $toggle_action = in_array($module, $activemodules) ? "off" : "on"; } $menu[] = array("name" => $module, "status" => $status, "toggle_action" => $toggle_action, "toggle_url" => toggle_url($module, $toggle_action), "swap_up_url" => swap_url($module, $index, $modules[$index - 1], $index - 1), "swap_down_url" => swap_url($module, $index, $modules[$index + 1], $index + 1)); } $img_ext = $page->branch == 'Basic' ? 'gif' : 'jpg'; $check_imgs = array('on' => $page->img_tag('check-on', $img_ext, 'On', array('border' => '0')), 'off' => $page->img_tag('check-off', $img_ext, 'Off', array('border' => '0'))); $up_img = $page->img_tag('up', $img_ext, 'Up', array('border' => '0')); $down_img = $page->img_tag('down', $img_ext, 'Down', array('border' => '0')); } require $template; $page->output(); function toggle_url($module, $action) { if ($action) { return "index.php?action={$action}&module={$module}"; } } function swap_url($module1, $position1, $module2, $position2)