You are here

public function CourseObjectNode::optionsDefinition in Course 7

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

Define configuration elements and their defaults.

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

Overrides CourseObject::optionsDefinition

4 calls to CourseObjectNode::optionsDefinition()
CourseObjectBook::optionsDefinition in modules/course_book/course_book.classes.inc
Define configuration elements and their defaults.
CourseObjectContent::optionsDefinition in modules/course_content/course_content.classes.inc
If course object is saved without configuration, make sure we have a default node type.
CourseObjectPoll::optionsDefinition in modules/course_poll/course_poll.classes.inc
Define configuration elements and their defaults.
CourseObjectQuiz::optionsDefinition in modules/course_quiz/course_quiz.classes.inc
Course quiz options.
4 methods override CourseObjectNode::optionsDefinition()
CourseObjectBook::optionsDefinition in modules/course_book/course_book.classes.inc
Define configuration elements and their defaults.
CourseObjectContent::optionsDefinition in modules/course_content/course_content.classes.inc
If course object is saved without configuration, make sure we have a default node type.
CourseObjectPoll::optionsDefinition in modules/course_poll/course_poll.classes.inc
Define configuration elements and their defaults.
CourseObjectQuiz::optionsDefinition in modules/course_quiz/course_quiz.classes.inc
Course quiz options.

File

includes/CourseObjectNode.inc, line 131

Class

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

Code

public function optionsDefinition() {
  $defaults = parent::optionsDefinition();
  $defaults['private'] = !isset($this->node) && $this
    ->hasNodePrivacySupport();
  $options = array_intersect_key(node_type_get_names(), drupal_map_assoc($this
    ->getNodeTypes()));
  $defaults['node_type'] = key($options);
  $defaults['use_node_title'] = 0;
  $defaults['clone_and_reference'] = 0;
  $defaults['use_existing_node'] = 0;
  return $defaults;
}