forked from arborrow/moodle-courseformat_grid
-
Notifications
You must be signed in to change notification settings - Fork 10
/
editimage_form.php
executable file
·29 lines (23 loc) · 988 Bytes
/
editimage_form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
defined('MOODLE_INTERNAL') || die();
require_once("{$CFG->libdir}/formslib.php");
class image_form extends moodleform {
function definition() {
$mform = $this->_form;
$instance = $this->_customdata;
// visible elements
$mform->addElement('filepicker', 'assignment_file',
get_string('uploadafile'), null, $instance['options']);
// hidden params
$mform->addElement('hidden', 'contextid', $instance['contextid']);
$mform->setType('contextid', PARAM_INT);
$mform->addElement('hidden', 'userid', $instance['userid']);
$mform->setType('userid', PARAM_INT);
$mform->addElement('hidden', 'sectionid', $instance['sectionid']);
$mform->setType('sectionid', PARAM_INT);
$mform->addElement('hidden', 'action', 'uploadfile');
$mform->setType('action', PARAM_ALPHA);
// buttons
$this->add_action_buttons(true, get_string('savechanges', 'admin'));
}
}