You are here

public function CourseObjectCertificate::optionsForm in Course 8.2

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

Default options form for all course objects.

Overrides CourseObject::optionsForm

File

modules/course_certificate/src/Plugin/course/CourseObject/CourseObjectCertificate.php, line 36

Class

CourseObjectCertificate
Plugin annotation @CourseObject( id = "certificate", label = "Certificate", handlers = { "fulfillment" = "\Drupal\course\Entity\CourseObjectFulfillment" } )

Namespace

Drupal\course_certificate\Plugin\course\CourseObject

Code

public function optionsForm(&$form, &$form_state) {
  parent::optionsForm($form, $form_state);
  $options = $this
    ->getOptions();
  $form['certificate_node'] = array(
    '#title' => t('Use node settings from Certificate'),
    '#type' => 'checkbox',
    '#default_value' => $options['certificate_node'],
    '#description' => t('This will direct the user to node/%course/certificate'),
    '#disabled' => TRUE,
  );
}