mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 05:54:19 +02:00
Merge branch 'MDL-28520' of git://git.luns.net.uk/moodle
This commit is contained in:
commit
948ef5d07a
@ -1657,6 +1657,18 @@ abstract class repository {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Admin Settings Moodle form
|
||||
* @param object $mform Moodle form (passed by reference)
|
||||
* @param array array of ("fieldname"=>value) of submitted data
|
||||
* @param array array of ("fieldname"=>errormessage) of errors
|
||||
* @return array array of errors
|
||||
*/
|
||||
public static function type_form_validation($mform, $data, $errors) {
|
||||
return $errors;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Edit/Create Instance Settings Moodle form
|
||||
* @param object $mform Moodle form (passed by reference)
|
||||
@ -1941,6 +1953,21 @@ final class repository_type_form extends moodleform {
|
||||
|
||||
$this->add_action_buttons(true, get_string('save','repository'));
|
||||
}
|
||||
|
||||
public function validation($data) {
|
||||
$errors = array();
|
||||
$plugin = $this->_customdata['plugin'];
|
||||
$instance = (isset($this->_customdata['instance'])
|
||||
&& is_subclass_of($this->_customdata['instance'], 'repository'))
|
||||
? $this->_customdata['instance'] : null;
|
||||
if (!$instance) {
|
||||
$errors = repository::static_function($plugin, 'type_form_validation', $this, $data, $errors);
|
||||
} else {
|
||||
$errors = $instance->type_form_validation($this, $data, $errors);
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user