cvsimport fixups
[moodle.git] / question / edit.php
CommitLineData
516cf3eb 1<?php // $Id$
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
271e6dec 36 list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) = question_edit_setup('questions');
f4b879dd 37 $questionbank = new question_bank_view();
38 $questionbank->process_actions($thispageurl, $cm);
271e6dec 39
f4b879dd 40 // TODO log this page view.
516cf3eb 41
271e6dec 42 $context = $contexts->lowest();
70c01adb 43 $streditingquestions = get_string('editquestions', "quiz");
b72ff476 44 if ($cm!==null) {
271e6dec 45 $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
46 ? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
70c01adb 47 : "";
3b27b0fe 48 $navlinks = array();
a1bed32f 49 $navlinks[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$COURSE->id", 'type' => 'activity');
0cbddd85 50 $navlinks[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?id={$cm->id}", 'type' => 'title');
3b27b0fe 51 $navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
52 $navigation = build_navigation($navlinks);
b72ff476 53 print_header_simple($streditingquestions, '', $navigation, "", "", true, $strupdatemodule);
70c01adb 54
55 $currenttab = 'edit';
56 $mode = 'questions';
b72ff476 57 ${$cm->modname} = $module;
58 include($CFG->dirroot."/mod/$cm->modname/tabs.php");
70c01adb 59 } else {
b72ff476 60 // Print basic page layout.
3b27b0fe 61 $navlinks = array();
62 $navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
63 $navigation = build_navigation($navlinks);
271e6dec 64
b72ff476 65 print_header_simple($streditingquestions, '', $navigation);
271e6dec 66
70c01adb 67 // print tabs
68 $currenttab = 'questions';
69 include('tabs.php');
70 }
271e6dec 71
09275894 72 echo '<table class="boxaligncenter" border="0" cellpadding="2" cellspacing="0">';
e586cfb4 73 echo '<tr><td valign="top">';
516cf3eb 74
f4b879dd 75 $questionbank->display('questions', $contexts, $thispageurl, $cm, $pagevars['qpage'],
76 $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
77 $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
516cf3eb 78
79 echo '</td></tr>';
80 echo '</table>';
81
271e6dec 82 print_footer($COURSE);
516cf3eb 83?>