diff --git a/classes/form/override.php b/classes/form/override.php new file mode 100644 index 00000000..8bac7e38 --- /dev/null +++ b/classes/form/override.php @@ -0,0 +1,65 @@ +. + +namespace enrol_wallet\form; + +use enrol_wallet\util\form; + +use moodleform; + +defined('MOODLE_INTERNAL') || die(); +global $CFG; +require_once($CFG->libdir.'/formslib.php'); + +/** + * Class override + * + * @package enrol_wallet + * @copyright 2024 Mohammad Farouk + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class override extends moodleform { + /** + * Form definition. + * @return void + */ + protected function definition() { + $mform = $this->_form; + + $data = $this->_customdata; + $instanceid = $data['instanceid']; + + form::add_user_auto_complete_selection($mform, 'users', multi: true); + + $mform->addElement('hidden', 'instanceid'); + $mform->setType('instanceid', PARAM_INT); + $mform->setConstant('instanceid', $instanceid); + + $this->add_action_buttons(); + $this->set_display_vertical(); + } + + /** + * Validate override form + * @param array $data + * @param array $files + * @return array + */ + public function validation($data, $files) { + $errors = []; + return $errors; + } +}