Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| revoke_form | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| definition | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | // This file is part of Moodle - https://moodle.org/ |
| 3 | // |
| 4 | // Moodle is free software: you can redistribute it and/or modify |
| 5 | // it under the terms of the GNU General Public License as published by |
| 6 | // the Free Software Foundation, either version 3 of the License, or |
| 7 | // (at your option) any later version. |
| 8 | // |
| 9 | // Moodle is distributed in the hope that it will be useful, |
| 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | // GNU General Public License for more details. |
| 13 | // |
| 14 | // You should have received a copy of the GNU General Public License |
| 15 | // along with Moodle. If not, see <https://www.gnu.org/licenses/>. |
| 16 | |
| 17 | namespace local_transcript\form; |
| 18 | |
| 19 | defined('MOODLE_INTERNAL') || die(); |
| 20 | |
| 21 | require_once($CFG->libdir . '/formslib.php'); |
| 22 | |
| 23 | /** |
| 24 | * Reason for revoking a transcript. |
| 25 | * |
| 26 | * @package local_transcript |
| 27 | * @copyright 2026 DevLMS <contact@devlms.com> |
| 28 | * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
| 29 | */ |
| 30 | class revoke_form extends \moodleform { |
| 31 | /** |
| 32 | * Form fields. |
| 33 | */ |
| 34 | protected function definition() { |
| 35 | $f = $this->_form; |
| 36 | $f->addElement('hidden', 'id', $this->_customdata['id']); |
| 37 | $f->setType('id', PARAM_INT); |
| 38 | $f->addElement('static', 'confirm', '', get_string('revokeconfirm', 'local_transcript', s($this->_customdata['code']))); |
| 39 | $f->addElement('textarea', 'reason', get_string('revokereason', 'local_transcript'), ['rows' => 3, 'cols' => 50]); |
| 40 | $f->setType('reason', PARAM_TEXT); |
| 41 | $f->addRule('reason', null, 'required', null, 'client'); |
| 42 | $this->add_action_buttons(true, get_string('revoke', 'local_transcript')); |
| 43 | } |
| 44 | } |