You are here

function course_check_keyval in Course 6

Same name and namespace in other branches
  1. 7.2 includes/course.settings.inc \course_check_keyval()
  2. 7 includes/course.settings.inc \course_check_keyval()

Element validator to make sure all entries are in key|val format.

1 string reference to 'course_check_keyval'
course_settings_objects_form in includes/course.settings.inc
Course objects settings handler callback.

File

includes/course.settings.inc, line 104
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.'));
    }
  }
}