quiz/themes: Fix minor layout breakage introduced by the theme changes.
[moodle.git] / question / edit.php
CommitLineData
aeb15530 1<?php
f4b879dd 2
3///////////////////////////////////////////////////////////////////////////
4// //
5// NOTICE OF COPYRIGHT //
6// //
7// Moodle - Modular Object-Oriented Dynamic Learning Environment //
8// http://moodle.org //
9// //
10// Copyright (C) 1999 onwards Martin Dougiamas and others //
11// //
12// This program is free software; you can redistribute it and/or modify //
13// it under the terms of the GNU General Public License as published by //
14// the Free Software Foundation; either version 2 of the License, or //
15// (at your option) any later version. //
16// //
17// This program is distributed in the hope that it will be useful, //
18// but WITHOUT ANY WARRANTY; without even the implied warranty of //
19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
20// GNU General Public License for more details: //
21// //
22// http://www.gnu.org/copyleft/gpl.html //
23// //
24///////////////////////////////////////////////////////////////////////////
25
516cf3eb 26/**
e586cfb4 27* Page to edit the question bank
516cf3eb 28*
516cf3eb 29* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
4323d029 30* @package questionbank
f4b879dd 31*//** */
85c375c3 32
e586cfb4 33 require_once("../config.php");
516cf3eb 34 require_once("editlib.php");
35
a6855934 36 $url = new moodle_url('/question/edit.php');
b0f4e4e4 37 if (($lastchanged = optional_param('lastchanged', 0, PARAM_INT)) !== 0) {
38 $url->param('lastchanged', $lastchanged);
39 }
40 if (($category = optional_param('category', 0, PARAM_TEXT)) !== 0) {
41 $url->param('category', $category);
42 }
43 if (($qpage = optional_param('qpage', 0, PARAM_INT)) !== 0) {
44 $url->param('qpage', $qpage);
45 }
46 if (($cat = optional_param('cat', 0, PARAM_TEXT)) !== 0) {
47 $url->param('cat', $cat);
48 }
49 if (($courseid = optional_param('courseid', 0, PARAM_INT)) !== 0) {
50 $url->param('courseid', $courseid);
51 }
52 if (($returnurl = optional_param('returnurl', 0, PARAM_INT)) !== 0) {
53 $url->param('returnurl', $returnurl);
54 }
55 $PAGE->set_url($url);
56
271e6dec 57 list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) = question_edit_setup('questions');
971c6fca 58 $questionbank = new question_bank_view($contexts, $thispageurl, $COURSE, $cm);
5bd22790 59 $questionbank->process_actions();
271e6dec 60
f4b879dd 61 // TODO log this page view.
516cf3eb 62
271e6dec 63 $context = $contexts->lowest();
70c01adb 64 $streditingquestions = get_string('editquestions', "quiz");
b72ff476 65 if ($cm!==null) {
ea3c6b74 66 $PAGE->navbar->add($streditingquestions);
67 $PAGE->set_title($streditingquestions);
ea3c6b74 68 echo $OUTPUT->header();
70c01adb 69
70 $currenttab = 'edit';
71 $mode = 'questions';
b72ff476 72 ${$cm->modname} = $module;
73 include($CFG->dirroot."/mod/$cm->modname/tabs.php");
70c01adb 74 } else {
b72ff476 75 // Print basic page layout.
ea3c6b74 76 $PAGE->navbar->add($streditingquestions);
77 $PAGE->set_title($streditingquestions);
78 echo $OUTPUT->header();
271e6dec 79
70c01adb 80 // print tabs
81 $currenttab = 'questions';
82 include('tabs.php');
83 }
271e6dec 84
cd120b23 85 echo '<div class="questionbankwindow boxwidthwide boxaligncenter">';
5bd22790 86 $questionbank->display('questions', $pagevars['qpage'],
f4b879dd 87 $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
88 $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
cd120b23 89 echo "</div>\n";
516cf3eb 90
9b59580b 91 echo $OUTPUT->footer();
aeb15530 92