public function ContentTypeCourse::shouldShowNext in Opigno course 8
Same name and namespace in other branches
- 3.x src/Plugin/OpignoGroupManagerContentType/ContentTypeCourse.php \Drupal\opigno_course\Plugin\OpignoGroupManagerContentType\ContentTypeCourse::shouldShowNext()
Return TRUE if the page should show the "next" action button.
Even if the score does not permit the user to go next.
Returning TRUE will not automatically show the button.
The button will show up only if this method returns TRUE and if there is a next step available and if the user is able to go to this next content.
Return value
bool Show next.
Overrides ContentTypeInterface::shouldShowNext
File
- src/
Plugin/ OpignoGroupManagerContentType/ ContentTypeCourse.php, line 322
Class
- ContentTypeCourse
- Class ContentTypeCourse.
Namespace
Drupal\opigno_course\Plugin\OpignoGroupManagerContentTypeCode
public function shouldShowNext() {
// For now, show the next button only if the page is a "view" page
// from a group of type "opigno_course".
$route_name = \Drupal::routeMatch()
->getRouteName();
if ($route_name != 'entity.group.canonical') {
return FALSE;
}
$group = \Drupal::request()
->get('group');
if (empty($group) || $group
->getGroupType()
->id() != 'opigno_course') {
return FALSE;
}
return TRUE;
}