MDL-29794 Initial support for re-using a shared grading form
[moodle.git] / grade / grading / templates_form.php
CommitLineData
20836db9
DM
1<?php
2
3// This file is part of Moodle - http://moodle.org/
4//
5// Moodle is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Moodle is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17
18/**
19 * Defines forms used by templates.php
20 *
21 * @package core
22 * @subpackage grading
23 * @copyright 2011 David Mudrak <david@moodle.com>
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 */
26
27defined('MOODLE_INTERNAL') || die();
28
29require_once($CFG->dirroot.'/lib/formslib.php');
30
31/**
32 * Allows to search for a specific shared template
33 */
34class grading_search_template_form extends moodleform {
35
36 /**
37 * Pretty simple search box
38 */
39 public function definition() {
40 $mform = $this->_form;
41 $mform->addGroup(array(
42 $mform->createElement('text', 'needle', '', array('size' => 30)),
43 $mform->createElement('submit', 'submitbutton', get_string('search')),
44 ), 'buttonar', '', array(' '), false);
45 $mform->setType('needle', PARAM_TEXT);
46 $mform->setType('buttonar', PARAM_RAW);
47 }
48}