Merge branch 'wip-MDL-53402-master' of git://github.com/abgreeve/moodle
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) !== '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user