Merge branch 'wip-MDL-53402-master' of git://github.com/abgreeve/moodle

This commit is contained in:
David Monllao
2016-05-03 13:02:15 +08:00
3 changed files with 22 additions and 1 deletions
+1 -1
View File
@@ -234,7 +234,7 @@ class data_field_checkbox extends data_field_base {
function notemptyfield($value, $name) {
$found = false;
foreach ($value as $checkboxitem) {
if (!empty($checkboxitem)) {
if (strval($checkboxitem) !== '') {
$found = true;
break;
}
+11
View File
@@ -117,4 +117,15 @@ class data_field_menu extends data_field_base {
return array(" ({$tablealias}.fieldid = {$this->field->id} AND $varcharcontent = :$name) ", array($name=>$value));
}
/**
* Check if a field from an add form is empty
*
* @param mixed $value
* @param mixed $name
* @return bool
*/
function notemptyfield($value, $name) {
return strval($value) !== '';
}
}
@@ -116,5 +116,15 @@ class data_field_radiobutton extends data_field_base {
return array(" ({$tablealias}.fieldid = {$this->field->id} AND $varcharcontent = :$name) ", array($name=>$value));
}
/**
* Check if a field from an add form is empty
*
* @param mixed $value
* @param mixed $name
* @return bool
*/
function notemptyfield($value, $name) {
return strval($value) !== '';
}
}