You are here

public function CourseObject::optionsValidate in Course 7

Same name and namespace in other branches
  1. 6 includes/course_object.core.inc \CourseObject::optionsValidate()
  2. 7.2 includes/CourseObject.inc \CourseObject::optionsValidate()

Validate?

Overrides CourseHandler::optionsValidate

1 call to CourseObject::optionsValidate()
CourseObjectNode::optionsValidate in includes/CourseObjectNode.inc
Validate the options form. Check the node type.
1 method overrides CourseObject::optionsValidate()
CourseObjectNode::optionsValidate in includes/CourseObjectNode.inc
Validate the options form. Check the node type.

File

includes/CourseObject.inc, line 389

Class

CourseObject
Parent abstract base class of all course objects.

Code

public function optionsValidate(&$form, &$form_state) {

  // Pass validation to plugins.
  ctools_include('plugins');
  foreach (ctools_get_plugins('course', 'course_object_access') as $key => $plugin) {
    $values =& $form_state['values']['plugins']['access'][$key];
    $class = ctools_plugin_get_class($plugin, 'handler');
    $instance = new $class($values);
    $instance
      ->setCourseObject($this);
    $instance
      ->setType($key);
    $instance
      ->optionsValidate($form['plugins']['access'][$key], $form_state['values']['plugins']['access'][$key]);
  }
}