function content_access_help in Content Access 8
Same name and namespace in other branches
- 7 content_access.module \content_access_help()
Implements hook_help().
File
- ./
content_access.module, line 24 - Content access module file.
Code
function content_access_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.content_access':
case 'entity.node.content_access':
case 'entity.node_type.content_access_form':
$hint_service = FALSE;
if (!empty(\Drupal::hasService('advanced_help_hint.gethint'))) {
$hint_service = \Drupal::service('advanced_help_hint.gethint');
}
$output = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The <strong>Content Access</strong> module let you content manage access permission in a flexible and transparant way.') . '</p>';
$output .= '<h3>' . t('Use') . '</h3>';
$output .= '<p>' . t('It provides two new permissions: <em>view all</em> (allows anyone to view the content) and <em>view own</em> (allows only the content creator to see his/her own content). It also gives access to the existing core permissions <em>edit</em> and <em>delete</em> on the same settings page.') . '</p>';
$output .= '<p>' . t('It provides the following modalities:') . '</p><ul>';
$output .= '<li>' . t('Each <a href=":url"><em>content type</em></a> can have its own default content access settings by role.', [
':url' => Url::fromRoute('entity.node_type.collection')
->toString(),
]) . '</li>';
$output .= '<li>' . t('Optionally you can enable role based access control settings per <em>content node</em>.') . '</li>';
$output .= '<li>' . t('Access control can be further customized per <em>user</em> if you have the <a href=":url"><strong>ACL</strong></a> module enabled.', [
':url' => Url::fromUri('https://www.drupal.org/project/acl/')
->toString(),
]) . '</li></ul>';
if ($hint_service) {
$output .= '<p>' . $hint_service
->produceHint('content_access', 'https://www.drupal.org/docs/7/modules/content-access', TRUE) . '</p>';
}
else {
$output .= '<p>' . t('If you install and enable the module <a href=":url"><strong>Advanced Help Hint</strong></a>, you will get more help for <strong>Content Access</strong>.', [
':url' => Url::fromUri('https://www.drupal.org/project/advanced_help_hint')
->toString(),
]) . '</p>';
}
return $output;
}
}