function content_kanban_toolbar_alter in Content Planner 8
Implements hook_toolbar_alter().
File
- modules/
content_kanban/ content_kanban.module, line 105 - Contains content_kanban.module.
Code
function content_kanban_toolbar_alter(&$items) {
$links =& $items['content_planner']['tray']['links']['#items'];
if (\Drupal::currentUser()
->hasPermission('manage own content with content kanban') || \Drupal::currentUser()
->hasPermission('manage any content with content kanban') || \Drupal::currentUser()
->hasPermission('administer content kanban settings')) {
$links['content_kanban'] = [
'#type' => 'link',
'#title' => t('Content Kanban'),
'#url' => Url::fromRoute('content_kanban.kanban'),
'#attributes' => [
'class' => 'toolbar-icon toolbar-icon-system-admin-structure',
],
];
}
}