MDL-19817 Converted all print_footer() calls
[moodle.git] / question / edit.php
... / ...
CommitLineData
1<?php // $Id$
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
26/**
27* Page to edit the question bank
28*
29* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
30* @package questionbank
31*//** */
32
33 require_once("../config.php");
34 require_once("editlib.php");
35
36 list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) = question_edit_setup('questions');
37 $questionbank = new question_bank_view($contexts, $thispageurl, $COURSE, $cm);
38 $questionbank->process_actions();
39
40 // TODO log this page view.
41
42 $localcss = '<link rel="stylesheet" type="text/css" href="'.$CFG->wwwroot.
43 '/lib/yui/container/assets/container.css" />';
44 $context = $contexts->lowest();
45 $streditingquestions = get_string('editquestions', "quiz");
46 if ($cm!==null) {
47 $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
48 ? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
49 : "";
50 $navlinks = array();
51 $navlinks[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$COURSE->id", 'type' => 'activity');
52 $navlinks[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?id={$cm->id}", 'type' => 'title');
53 $navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
54 $navigation = build_navigation($navlinks);
55 print_header_simple($streditingquestions, '', $navigation, '', '', true, $strupdatemodule);
56
57 $currenttab = 'edit';
58 $mode = 'questions';
59 ${$cm->modname} = $module;
60 include($CFG->dirroot."/mod/$cm->modname/tabs.php");
61 } else {
62 // Print basic page layout.
63 $navlinks = array();
64 $navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
65 $navigation = build_navigation($navlinks);
66
67 print_header_simple($streditingquestions, '', $navigation, '', '');
68
69 // print tabs
70 $currenttab = 'questions';
71 include('tabs.php');
72 }
73
74 echo '<div class="questionbankwindow boxwidthwide boxaligncenter">';
75 $questionbank->display('questions', $pagevars['qpage'],
76 $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
77 $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
78 echo "</div>\n";
79
80 print_footer($COURSE);
81?>