fixed links on edit icons so that they return to question bank page.
[moodle.git] / question / edit.php
CommitLineData
516cf3eb 1<?php // $Id$
2/**
e586cfb4 3* Page to edit the question bank
516cf3eb 4*
e586cfb4 5* TODO: add logging
516cf3eb 6*
516cf3eb 7* @author Martin Dougiamas and many others. This has recently been extensively
8* rewritten by Gustav Delius and other members of the Serving Mathematics project
9* {@link http://maths.york.ac.uk/serving_maths}
10* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
4323d029 11* @package questionbank
516cf3eb 12*/
e586cfb4 13 require_once("../config.php");
516cf3eb 14 require_once("editlib.php");
15
b72ff476 16 list($thispageurl, $courseid, $cmid, $cm, $module, $pagevars) = question_edit_setup();
36e298bc 17
e586cfb4 18 if (! $course = get_record("course", "id", $courseid)) {
516cf3eb 19 error("This course doesn't exist");
20 }
3765fd53 21 $context = get_context_instance(CONTEXT_COURSE, $courseid);
3765fd53 22
516cf3eb 23
70c01adb 24 $streditingquestions = get_string('editquestions', "quiz");
b72ff476 25 if ($cm!==null) {
17d6a25e 26 $strupdatemodule = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $course->id))
b72ff476 27 ? update_module_button($cm->id, $course->id, get_string('modulename', $cm->modname))
70c01adb 28 : "";
b72ff476 29 $crumbs = array();
30 $crumbs[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$course->id", 'type' => 'activity');
31 $crumbs[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?cmid={$cm->id}", 'type' => 'title');
32 $crumbs[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
33 $navigation = build_navigation($crumbs);
34 print_header_simple($streditingquestions, '', $navigation, "", "", true, $strupdatemodule);
70c01adb 35
36 $currenttab = 'edit';
37 $mode = 'questions';
b72ff476 38 ${$cm->modname} = $module;
39 include($CFG->dirroot."/mod/$cm->modname/tabs.php");
70c01adb 40 } else {
b72ff476 41 // Print basic page layout.
42 $crumbs = array();
43 $crumbs[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
44 $navigation = build_navigation($crumbs);
45
46 print_header_simple($streditingquestions, '', $navigation);
47
70c01adb 48 // print tabs
49 $currenttab = 'questions';
50 include('tabs.php');
51 }
b72ff476 52
53
09275894 54 echo '<table class="boxaligncenter" border="0" cellpadding="2" cellspacing="0">';
e586cfb4 55 echo '<tr><td valign="top">';
516cf3eb 56
36e298bc 57 question_showbank($thispageurl, $cm, $pagevars['qpage'], $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
58 $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
516cf3eb 59
60 echo '</td></tr>';
61 echo '</table>';
62
516cf3eb 63 print_footer($course);
64?>