/notes/edit_form.php

https://bitbucket.org/synergylearning/campusconnect · PHP · 35 lines · 25 code · 10 blank · 0 comment · 1 complexity · 9194bb1e574620d6a0e5ab8bbd8527bd MD5 · raw file

  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->libdir.'/formslib.php');
  6. class note_edit_form extends moodleform {
  7. function definition() {
  8. $mform =& $this->_form;
  9. $mform->addElement('header', 'general', get_string('note', 'notes'));
  10. $mform->addElement('textarea', 'content', get_string('content', 'notes'), array('rows'=>15, 'cols'=>40));
  11. $mform->setType('content', PARAM_RAW);
  12. $mform->addRule('content', get_string('nocontent', 'notes'), 'required', null, 'client');
  13. $mform->addElement('select', 'publishstate', get_string('publishstate', 'notes'), note_get_state_names());
  14. $mform->setDefault('publishstate', NOTES_STATE_PUBLIC);
  15. $mform->setType('publishstate', PARAM_ALPHA);
  16. $mform->addHelpButton('publishstate', 'publishstate', 'notes');
  17. $this->add_action_buttons();
  18. $mform->addElement('hidden', 'courseid');
  19. $mform->setType('courseid', PARAM_INT);
  20. $mform->addElement('hidden', 'userid');
  21. $mform->setType('userid', PARAM_INT);
  22. $mform->addElement('hidden', 'id');
  23. $mform->setType('id', PARAM_INT);
  24. }
  25. }