. defined('MOODLE_INTERNAL') || die(); require_once($CFG->dirroot.'/course/moodleform_mod.php'); require_once($CFG->dirroot.'/mod/gradeimporter/lib.php'); class mod_gradeimporter_mod_form extends moodleform_mod { public function definition() { global $CFG, $COURSE, $USER, $DB, $OUTPUT; $mform =& $this->_form; $coursemodulesid = optional_param('update', 0, PARAM_INT); // Header $mform->addElement('header', 'general', get_string('general', 'gradeimporter')); // Name text field $mform->addElement('text', 'name', get_string('name', 'gradeimporter'), array('size' => '64', 'maxlength' => "256") ); $mform->setType('name', PARAM_TEXT); $mform->addRule('name', get_string('error_nameField', 'gradeimporter'), 'required', null, 'client'); // Description $this->standard_intro_elements(get_string('description', 'gradeimporter')); $features = array('groups' => false, 'groupings' => false, 'groupmembersonly' => false, 'outcomes' => false, 'gradecat' => false, 'idnumber' => false ); $this->standard_coursemodule_elements($features); // Hidden fields $mform->addElement('hidden', 'action'); $mform->setType('action', PARAM_TEXT); $mform->addElement('hidden', 'id'); $mform->setType('id', PARAM_TEXT); $mform->addElement('hidden', 'author_name'); $mform->setType('author_name', PARAM_TEXT); $mform->addElement('hidden', 'author_modified_name'); $mform->setType('author_modified_name', PARAM_TEXT); $mform->addElement('hidden', 'timecreated'); $mform->setType('timecreated', PARAM_TEXT); $mform->addElement('hidden', 'position'); $mform->setType('position', PARAM_TEXT); $this->add_action_buttons(); } }