public function CourseObjectNode::getWarnings in Course 6
Same name and namespace in other branches
- 7.2 includes/CourseObjectNode.inc \CourseObjectNode::getWarnings()
- 7 includes/CourseObjectNode.inc \CourseObjectNode::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 CourseHandler::getWarnings
See also
2 calls to CourseObjectNode::getWarnings()
- CourseObjectQuiz::getWarnings in modules/
course_quiz/ course_quiz.classes.inc - Let the user know if they have a Quiz without questions.
- CourseObjectWebform::getWarnings in modules/
course_webform/ course_webform.classes.inc - Return a list of warning strings about this handler.
2 methods override CourseObjectNode::getWarnings()
- CourseObjectQuiz::getWarnings in modules/
course_quiz/ course_quiz.classes.inc - Let the user know if they have a Quiz without questions.
- CourseObjectWebform::getWarnings in modules/
course_webform/ course_webform.classes.inc - Return a list of warning strings about this handler.
File
- includes/
course_object.core.inc, line 1229
Class
- CourseObjectNode
- A course object that uses a node as a base.
Code
public function getWarnings() {
$warnings = parent::getWarnings();
if ($this
->getOption('private')) {
$settings = variable_get('content_access_settings', array());
if (!$settings['per_node'][$this
->getComponent()]) {
$warnings[] = t('%t is set to Private, but the content type %c does not have access control lists enabled. Users will not be able to acces this content. Please visit !l to set up content access settings.', array(
'%t' => $this
->getTitle(),
'%c' => $this
->getComponent(),
'!l' => l('Access control', "admin/content/node-type/{$this->getComponent()}/access"),
));
}
}
return $warnings;
}