You are here

public function CourseObjectWebform::getWarnings in Course 6

Same name and namespace in other branches
  1. 7.2 modules/course_webform/course_webform.classes.inc \CourseObjectWebform::getWarnings()
  2. 7 modules/course_webform/course_webform.classes.inc \CourseObjectWebform::getWarnings()

Return a list of warning strings about this handler.

For example, if a user adds a quiz to a course with no questions, trigger a message.

Overrides CourseObjectNode::getWarnings

See also

CourseObjectQuiz

CourseObjectWebform

File

modules/course_webform/course_webform.classes.inc, line 17

Class

CourseObjectWebform
Parent class for webform course tracking.

Code

public function getWarnings() {
  $warnings = parent::getWarnings();
  if ($this
    ->getInstanceId()) {
    if (!$this->node->webform['components']) {
      $warnings[] = t('The Webform has no questions. Please !link.', array(
        '!link' => l('add questions', "node/{$this->getInstanceId()}/webform"),
      ));
    }
  }
  return $warnings;
}