Commit 25c5830b authored by Stephen Mustgrave's avatar Stephen Mustgrave
Browse files

Issue #3245165: Make toolbar link title configurable

parent 708297cc
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -63,14 +63,19 @@ function moderation_dashboard_toolbar_alter(&$items) {
  $user = \Drupal::currentUser();

  if (isset($items['user']) && $user->hasPermission('use moderation dashboard')) {
    $view = \Drupal::service('entity_type.manager')
      ->getStorage('view')
      ->load('moderation_dashboard')
      ->getExecutable();
    $view->setDisplay('page_1');
    $items['user']['tray']['moderation_dashboard'] = [
      '#theme' => 'links__toolbar_user',
      '#links' => [
        'moderation_dashboard_link' => [
          'title' => t('Moderation Dashboard'),
          'title' => $view->getTitle(),
          'url' => Url::fromRoute('view.moderation_dashboard.page_1', ['user' => $user->id()]),
          'attributes' => [
            'title' => t('View the Moderation Dashboard page'),
            'title' => t('View the @title page', ['@title' => $view->getTitle()]),
          ],
        ],
      ],