mod_form.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. if (!defined('MOODLE_INTERNAL')) {
  3. die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
  4. }
  5. require_once($CFG->dirroot.'/course/moodleform_mod.php');
  6. require_once($CFG->dirroot.'/mod/gradeimporter/lib.php');
  7. class mod_gradeimporter_mod_form extends moodleform_mod {
  8. function definition() {
  9. global $CFG, $COURSE, $USER, $DB, $OUTPUT;
  10. $mform =& $this->_form;
  11. $course_modules_id = optional_param('update', 0, PARAM_INT);
  12. $mform->addElement('header', 'general', get_string('general', 'gradeimporter'));
  13. $mform->addElement('text', 'name', get_string('name', 'gradeimporter'), array('size'=>'64'));
  14. $mform->setType('name', PARAM_TEXT);
  15. $mform->addRule('name', get_string('error_nameField', 'gradeimporter'), 'required', null, 'client');
  16. $this->standard_intro_elements(get_string('description', 'gradeimporter'));
  17. //$ynoptions = array(0 => get_string('visibilityOn', 'gradeimporter'), 1 => get_string('visibilityOff', 'gradeimporter'));
  18. //$mform->addElement('')
  19. $features = array('groups' => false, 'groupings' => false, 'groupmembersonly' => false, 'outcomes' => false,'gradecat' => false, 'idnumber' => false);
  20. $this->standard_coursemodule_elements($features);
  21. //hidden fields
  22. $mform->addElement('hidden', 'action');
  23. $mform->setType('action', PARAM_TEXT);
  24. $mform->addElement('hidden', 'id');
  25. $mform->setType('id', PARAM_TEXT);
  26. $mform->addElement('hidden', 'iassign_id');
  27. $mform->setType('iassign_id', PARAM_TEXT);
  28. $mform->addElement('hidden', 'author_name');
  29. $mform->setType('author_name', PARAM_TEXT);
  30. $mform->addElement('hidden', 'author_modified_name');
  31. $mform->setType('author_modified_name', PARAM_TEXT);
  32. $mform->addElement('hidden', 'timecreated');
  33. $mform->setType('timecreated', PARAM_TEXT);
  34. $mform->addElement('hidden', 'position');
  35. $mform->setType('position', PARAM_TEXT);
  36. $this->add_action_buttons();
  37. }
  38. }