protected function WebformSubmissionListBuilder::isSubmissionViewResultsReplaced in Webform 6.x
Same name and namespace in other branches
- 8.5 src/WebformSubmissionListBuilder.php \Drupal\webform\WebformSubmissionListBuilder::isSubmissionViewResultsReplaced()
Determine if the submission view(s) replaced the default results table.
Return value
bool TRUE if the submission view(s) replaced the default results table.
2 calls to WebformSubmissionListBuilder::isSubmissionViewResultsReplaced()
- WebformSubmissionListBuilder::buildSubmissionViewsMenu in src/
WebformSubmissionListBuilder.php - Build the submission views menu.
- WebformSubmissionListBuilder::initialize in src/
WebformSubmissionListBuilder.php - Initialize WebformSubmissionListBuilder object.
File
- src/
WebformSubmissionListBuilder.php, line 1197
Class
- WebformSubmissionListBuilder
- Provides a list controller for webform submission entity.
Namespace
Drupal\webformCode
protected function isSubmissionViewResultsReplaced() {
$type = $this
->getSubmissionViewType();
$replace_routes = [];
$default_replace = $this->configFactory
->get('webform.settings')
->get('settings.default_submission_views_replace') ?: [];
if (isset($default_replace[$type . '_routes'])) {
$replace_routes = array_merge($replace_routes, $default_replace[$type . '_routes']);
}
if ($this->webform) {
$webform_replace = $this->webform
->getSetting('submission_views_replace') ?: [];
if (isset($webform_replace[$type . '_routes'])) {
$replace_routes = array_merge($replace_routes, $webform_replace[$type . '_routes']);
}
}
$route_name = $this->routeMatch
->getRouteName();
return $replace_routes && in_array($route_name, $replace_routes) ? TRUE : FALSE;
}