MDL-38735 backup: add missing setType() to forms

This commit is contained in:
Eloy Lafuente (stronk7)
2013-04-03 02:17:40 +02:00
parent d8201d49d8
commit 5ae69b2aed
4 changed files with 44 additions and 0 deletions
@@ -404,6 +404,27 @@ abstract class base_setting {
$dependency->get_dependent_setting()->register_dependent_dependency($dependency);
}
/**
* Get the PARAM_XXXX validation to be applied to the setting
*
* @return string The PARAM_XXXX constant of null if the setting type is not defined
*/
public function get_param_validation() {
switch ($this->vtype) {
case self::IS_BOOLEAN:
return PARAM_BOOL;
case self::IS_INTEGER:
return PARAM_INT;
case self::IS_FILENAME:
return PARAM_FILE;
case self::IS_PATH:
return PARAM_PATH;
case self::IS_TEXT:
return PARAM_TEXT;
}
return null;
}
// Protected API starts here
protected function validate_value($vtype, $value) {