You are here

function CourseObjectBook::optionsDefinition in Course 8.2

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

Define configuration elements and their defaults.

Extended classes should call parent::optionsDefinition first to get the parent's configuration.

Overrides CourseObjectNode::optionsDefinition

File

modules/course_book/src/Plugin/course/CourseObject/CourseObjectBook.php, line 52

Class

CourseObjectBook
Plugin annotation @CourseObject( id = "book", label = "Book", handlers = { "fulfillment" = "\Drupal\course_book\Plugin\course\CourseObject\CourseObjectBookFulfillment" } )

Namespace

Drupal\course_book\Plugin\course\CourseObject

Code

function optionsDefinition() {
  $defaults = parent::optionsDefinition();
  $defaults['node_type'] = \Drupal::config('course_book.settings')
    ->get('default_node_type', 'book');
  $defaults['book_tracking'] = 'all';
  $defaults['outline_list_item_type'] = 'active_tree';
  return $defaults;
}