You are here

function CourseObjectWebform::optionsForm in Course 8.2

Same name and namespace in other branches
  1. 8.3 modules/course_webform/src/Plugin/course/CourseObject/CourseObjectWebform.php \Drupal\course_webform\Plugin\course\CourseObject\CourseObjectWebform::optionsForm()
  2. 3.x modules/course_webform/src/Plugin/course/CourseObject/CourseObjectWebform.php \Drupal\course_webform\Plugin\course\CourseObject\CourseObjectWebform::optionsForm()

Default options form for all course objects.

Overrides CourseObject::optionsForm

File

modules/course_webform/src/Plugin/course/CourseObject/CourseObjectWebform.php, line 121

Class

CourseObjectWebform
Plugin annotation @CourseObject( id = "webform", label = "Webform", handlers = { "fulfillment" = "\Drupal\course_webform\Plugin\course\CourseObject\CourseObjectWebformFulfillment" } )

Namespace

Drupal\course_webform\Plugin\course\CourseObject

Code

function optionsForm(&$form, &$form_state) {
  parent::optionsForm($form, $form_state);
  $form['instance'] = array(
    '#type' => 'entity_autocomplete',
    '#target_type' => 'webform',
    '#default_value' => $this
      ->getOption('instance') ? Webform::load($this
      ->getOption('instance')) : NULL,
  );
  return $form;
}