예제 #1
0
 * @copyright  (C) 1999 onwards Martin Dougiamas  http://dougiamas.com
 *
 */
require_once $CFG->dirroot . '/mod/customlabel/forms/ClassificationModelForm.php';
$mform = new ModelForm();
if (!$mform->is_cancelled()) {
    if ($data = $mform->get_data()) {
        set_config('classification_type_table', $data->classification_type_table);
        set_config('classification_value_table', $data->classification_value_table);
        set_config('classification_value_type_key', $data->classification_value_type_key);
        set_config('classification_constraint_table', $data->classification_constraint_table);
        set_config('course_metadata_table', $data->course_metadata_table);
        set_config('course_metadata_value_key', $data->course_metadata_value_key);
        set_config('course_metadata_course_key', $data->course_metadata_course_key);
    }
}
// Print table.
echo $deferredheader;
echo $OUTPUT->heading(get_string('classificationmodel', 'customlabel'));
$data = new StdClass();
$data->view = $view;
$data->classification_type_table = 'customlabel_mtd_type';
$data->classification_value_table = 'customlabel_mtd_value';
$data->classification_value_type_key = 'typeid';
$data->classification_constraint_table = 'customlabel_mtd_constraint';
$data->course_metadata_table = 'customlabel_course_metadata';
$data->course_metadata_value_key = 'valueid';
$data->course_metadata_course_key = 'courseid';
$mform->set_data($data);
$mform->display();