-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy patheditimage_form.php
More file actions
81 lines (54 loc) · 2.46 KB
/
editimage_form.php
File metadata and controls
81 lines (54 loc) · 2.46 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
require_once("$CFG->libdir/formslib.php");
class image_form extends moodleform {
function definition() {
$mform = $this->_form;
$instance = $this->_customdata;
// visible elements
//$mform->addElement('filemanager', 'newfile', get_string('uploadafile'));
//$mform->addElement('filemanager', 'files_filemanager', get_string('uploadafile'), null, $instance['options']);
$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'));
}
}
?>
<?php
/*
require_once("$CFG->libdir/formslib.php");
class image_form extends moodleform {
function definition() {
global $USER, $CFG, $DB;
$mform = $this->_form;
$course = $this->_customdata['course']; // this contains the data of this form
$data = $this->_customdata['data'];
$options = $this->_customdata['options'];
//$mform->addElement(type, id, title_string, ?, options e.g: array('maxbytes' => $maxbytes, 'accepted_types' => '*'));
$mform->addElement('filemanager', 'userfile_filemanager', get_string('file'), null, $options);
$mform->addElement('hidden', 'returnurl', $data->returnurl);
$this->add_action_buttons(true, get_string('savechanges'));
$this->set_data($data);
*/
/*
$mform = $this->_form;
$data = $this->_customdata['data'];
$options = $this->_customdata['options'];
$mform->addElement('filemanager', 'files_filemanager', get_string('files'), null, $options);
$mform->addElement('hidden', 'returnurl', $data->returnurl);
$this->add_action_buttons(true, get_string('savechanges'));
$this->set_data($data);
*/
/*
} // Close the function
} // Close the class
*/
?>