Tabs on question bank editing pages

This commit is contained in:
gustav_delius 2006-03-01 08:43:41 +00:00
parent 63339fc88c
commit 567709c4e0
5 changed files with 49 additions and 4 deletions

View File

@ -62,8 +62,12 @@
include($CFG->dirroot.'/mod/quiz/tabs.php');
} else {
print_header_simple(get_string('editcategories', 'quiz'), '',
'-> <a href="edit.php">'.get_string('editquestions', 'quiz').'</a>'.
'<a href="edit.php">'.get_string('editquestions', 'quiz').'</a>'.
' -> '.get_string('editcategories', 'quiz'));
// print tabs
$currenttab = 'categories';
include('tabs.php');
}
//==========

View File

@ -33,7 +33,11 @@
$streditingquestions = get_string('editquestions', "quiz");
print_header_simple($streditingquestions, '',
"$streditingquestions");
print_heading_with_help(get_string('questions', 'quiz'), 'questionbank');
// print tabs
$currenttab = 'editq';
include('tabs.php');
echo '<table align="center" border="0" cellpadding="2" cellspacing="0">';
echo '<tr><td valign="top">';

View File

@ -71,6 +71,9 @@
print_header_simple($strexportquestions, '',
"<a href=\"edit.php?courseid={$course->id}\">".get_string('editquestions', 'quiz').'</a>'.
' -> '.$strexportquestions);
// print tabs
$currenttab = 'export';
include('tabs.php');
}
if (!empty($format)) { /// Filename

View File

@ -72,9 +72,11 @@
include('tabs.php');
} else {
print_header_simple($strimportquestions, '',
"<a href=\"index.php?id=$course->id\">".get_string('modulenameplural', 'quiz').'</a>'.
'-> <a href="edit.php">'.get_string('editquestions', 'quiz').'</a>'.
'<a href="edit.php">'.get_string('editquestions', 'quiz').'</a>'.
' -> '.$strimportquestions);
// print tabs
$currenttab = 'import';
include('tabs.php');
}

32
question/tabs.php Normal file
View File

@ -0,0 +1,32 @@
<?php // $Id$
/**
* Sets up the tabs used by the question bank editing page
*
* @version $Id$
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package question
*/
/// 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();
$row = array();
$inactive = array();
$row[] = new tabobject('editq', "$CFG->wwwroot/question/edit.php?courseid=$course->id", get_string('questions', 'quiz'), get_string('editquizquestions', 'quiz'));
$row[] = new tabobject('categories', "$CFG->wwwroot/question/category.php?id=$course->id", get_string('categories', 'quiz'), get_string('editqcats', 'quiz'));
$row[] = new tabobject('import', "$CFG->wwwroot/question/import.php?course=$course->id", get_string('import', 'quiz'), get_string('importquestions', 'quiz'));
$row[] = new tabobject('export', "$CFG->wwwroot/question/export.php?courseid=$course->id", get_string('export', 'quiz'), get_string('exportquestions', 'quiz'));
$tabs[] = $row;
print_tabs($tabs, $currenttab, $inactive);
?>