You are here

class ShortcutsBlock in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/shortcut/src/Plugin/Block/ShortcutsBlock.php \Drupal\shortcut\Plugin\Block\ShortcutsBlock
  2. 9 core/modules/shortcut/src/Plugin/Block/ShortcutsBlock.php \Drupal\shortcut\Plugin\Block\ShortcutsBlock

Provides a 'Shortcut' block.

Plugin annotation


@Block(
  id = "shortcuts",
  admin_label = @Translation("Shortcuts"),
  category = @Translation("Menus")
)

Hierarchy

Expanded class hierarchy of ShortcutsBlock

File

core/modules/shortcut/src/Plugin/Block/ShortcutsBlock.php, line 18

Namespace

Drupal\shortcut\Plugin\Block
View source
class ShortcutsBlock extends BlockBase {

  /**
   * {@inheritdoc}
   */
  public function build() {
    return [
      shortcut_renderable_links(shortcut_current_displayed_set()),
    ];
  }

  /**
   * {@inheritdoc}
   */
  protected function blockAccess(AccountInterface $account) {
    return AccessResult::allowedIfHasPermission($account, 'access shortcuts');
  }

}

Members