Pull merge.
[yaffs-website] / web / core / modules / shortcut / src / Plugin / Block / ShortcutsBlock.php
1 <?php
2
3 namespace Drupal\shortcut\Plugin\Block;
4
5 use Drupal\Core\Access\AccessResult;
6 use Drupal\Core\Block\BlockBase;
7 use Drupal\Core\Session\AccountInterface;
8
9 /**
10  * Provides a 'Shortcut' block.
11  *
12  * @Block(
13  *   id = "shortcuts",
14  *   admin_label = @Translation("Shortcuts"),
15  *   category = @Translation("Menus")
16  * )
17  */
18 class ShortcutsBlock extends BlockBase {
19
20   /**
21    * {@inheritdoc}
22    */
23   public function build() {
24     return [
25       shortcut_renderable_links(shortcut_current_displayed_set()),
26     ];
27   }
28
29   /**
30    * {@inheritdoc}
31    */
32   protected function blockAccess(AccountInterface $account) {
33     return AccessResult::allowedIfHasPermission($account, 'access shortcuts');
34   }
35
36 }