forked from ULCC/moodle-block_ilp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_instance.html
47 lines (35 loc) · 1.09 KB
/
config_instance.html
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
<?php
/**
* Instance config file for the ILP.
*
* @copyright © 2011 University of London Computer Centre
* @author http://www.ulcc.ac.uk, http://moodle.ulcc.ac.uk
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package ILP
* @version 2.0
*/
global $CFG;
// include the moodle forms lib
require_once("{$CFG->dirroot}/lib/formslib.php");
if(!class_exists('block_edit_form')) {
// create the base class that doesn't exist in version 1.x
class block_edit_form extends moodleform {
function definition() {
$mform =& $this->_form;
$this->specific_definition($mform);
$this->add_action_buttons();
}
}
}
// include the moodle 2.x form for editing this block instance
require_once("{$CFG->dirroot}/blocks/ilp/edit_form.php");
// instantiate the form
$mform = new block_ilp_edit_form();
//if the form was submitted
if ($data = $mform->get_data()) {
}
// load the existing config data into the form
$mform->set_data($this->config);
// render the form
$mform->display();
?>