$reportlist = array('overview'); // Standard reports we want to show first foreach ($allreports as $report) { if (!in_array($report, $reportlist)) { $reportlist[] = $report; } } $row = array(); $currenttab = ''; foreach ($reportlist as $report) { $row[] = new tabobject($report, "{$CFG->wwwroot}/mod/game/report.php?q={$game->id}&mode={$report}", get_string($report, 'game')); if ($report == $mode) { $currenttab = $report; } } $tabs[] = $row; } if ($currenttab == 'edit' and isset($mode)) { $inactive[] = 'edit'; $activated[] = 'edit'; $row = array(); $currenttab = $mode; $strgames = get_string('modulenameplural', 'game'); $strgame = get_string('modulename', 'game'); $streditinggame = get_string("editinga", "moodle", $strgame); $strupdate = get_string('updatethis', 'moodle', $strgame); $row[] = new tabobject('editq', "{$CFG->wwwroot}/mod/game/edit.php?gameid={$game->id}", $strgame, $streditinggame); questionbank_navigation_tabs($row, $context, $course->id); $tabs[] = $row; } print_tabs($tabs, $currenttab, $inactive, $activated);
<?php // $Id: tabs.php,v 1.7 2007/08/20 03:36:07 jamiesensei Exp $ /** * Sets up the tabs used by the question bank editing page * * @license http://www.gnu.org/copyleft/gpl.html GNU Public License * @package questionbank */ /// This file to be included so we can assume config.php has already been included. if (!isset($currenttab)) { $currenttab = ''; } if (!isset($COURSE)) { error('No course specified'); } $tabs = array(); $inactive = array(); $row = array(); questionbank_navigation_tabs($row, $contexts, $thispageurl->get_query_string()); $tabs[] = $row; print_tabs($tabs, $currenttab, array());