function course_check_keyval in Course 7
Same name and namespace in other branches
- 6 includes/course.settings.inc \course_check_keyval()
- 7.2 includes/course.settings.inc \course_check_keyval()
Element validator to make sure all entries are in key|val format.
File
- includes/
course.settings.inc, line 52 - Administrative settings for Course module.
Code
function course_check_keyval($element, &$form_state) {
$val = trim($element['#value']);
if ($val) {
if (substr_count($val, "\n") + 1 != substr_count($val, '|')) {
form_error($element, t('Please ensure all custom object fields are in the format key|value.'));
}
}
}