MDL-16438 standardized component names
[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');
971c6fca 37 $questionbank = new question_bank_view($contexts, $thispageurl, $COURSE, $cm);
5bd22790 38 $questionbank->process_actions();
271e6dec 39
f4b879dd 40 // TODO log this page view.
516cf3eb 41
cd120b23 42 $localcss = '<link rel="stylesheet" type="text/css" href="'.$CFG->wwwroot.
43 '/lib/yui/container/assets/container.css" />';
271e6dec 44 $context = $contexts->lowest();
70c01adb 45 $streditingquestions = get_string('editquestions', "quiz");
b72ff476 46 if ($cm!==null) {
271e6dec 47 $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
48 ? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
70c01adb 49 : "";
3b27b0fe 50 $navlinks = array();
a1bed32f 51 $navlinks[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$COURSE->id", 'type' => 'activity');
0cbddd85 52 $navlinks[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?id={$cm->id}", 'type' => 'title');
3b27b0fe 53 $navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
54 $navigation = build_navigation($navlinks);
cd120b23 55 print_header_simple($streditingquestions, '', $navigation, '', $localcss, true, $strupdatemodule);
70c01adb 56
57 $currenttab = 'edit';
58 $mode = 'questions';
b72ff476 59 ${$cm->modname} = $module;
60 include($CFG->dirroot."/mod/$cm->modname/tabs.php");
70c01adb 61 } else {
b72ff476 62 // Print basic page layout.
3b27b0fe 63 $navlinks = array();
64 $navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
65 $navigation = build_navigation($navlinks);
271e6dec 66
cd120b23 67 print_header_simple($streditingquestions, '', $navigation, '', $localcss);
271e6dec 68
70c01adb 69 // print tabs
70 $currenttab = 'questions';
71 include('tabs.php');
72 }
271e6dec 73
cd120b23 74 echo '<div class="questionbankwindow boxwidthwide boxaligncenter">';
5bd22790 75 $questionbank->display('questions', $pagevars['qpage'],
f4b879dd 76 $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
77 $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
cd120b23 78 echo "</div>\n";
516cf3eb 79
271e6dec 80 print_footer($COURSE);
516cf3eb 81?>