You are here

public function CourseObjectNode::optionsSubmit in Course 6

Same name and namespace in other branches
  1. 7.2 includes/CourseObjectNode.inc \CourseObjectNode::optionsSubmit()
  2. 7 includes/CourseObjectNode.inc \CourseObjectNode::optionsSubmit()

Save object configs to cache.

Overrides CourseObject::optionsSubmit

2 calls to CourseObjectNode::optionsSubmit()
CourseObjectSignup::optionsSubmit in modules/course_signup/course_signup.classes.inc
Set a specialized instance ID.
CourseObjectUbercart::optionsSubmit in modules/course_uc/course_uc.classes.inc
Set a specialized instance ID.
2 methods override CourseObjectNode::optionsSubmit()
CourseObjectSignup::optionsSubmit in modules/course_signup/course_signup.classes.inc
Set a specialized instance ID.
CourseObjectUbercart::optionsSubmit in modules/course_uc/course_uc.classes.inc
Set a specialized instance ID.

File

includes/course_object.core.inc, line 1209

Class

CourseObjectNode
A course object that uses a node as a base.

Code

public function optionsSubmit(&$form, &$form_state) {
  $nid = $form_state['values']['instance'];
  if (!is_numeric($nid)) {
    preg_match('/^(?:\\s*|(.*) )?\\[\\s*nid\\s*:\\s*(\\d+)\\s*\\]$/', $nid, $matches);
    $nid = $matches[2];
  }
  if ($nid) {
    $form_state['values']['instance'] = $nid;
  }
  else {

    // Unset it, or we'll erase the relationship (since the textfield is
    // actually blank).
    unset($form_state['values']['instance']);
  }
  parent::optionsSubmit($form, $form_state);
}