You are here

class JumpMenuBlock in Better Jump Menus 8

Same name in this branch
  1. 8 lib/Drupal/jump_menu/Plugin/Derivative/JumpMenuBlock.php \Drupal\jump_menu\Plugin\Derivative\JumpMenuBlock
  2. 8 lib/Drupal/jump_menu/Plugin/Block/JumpMenuBlock.php \Drupal\jump_menu\Plugin\Block\JumpMenuBlock

Provides a Jump Menu block.

Plugin annotation


@Block(
  id = "jump_menu_block",
  admin_label = @Translation("Jump Menu"),
  category = @Translation("Jump Menu"),
  derivative = "Drupal\jump_menu\Plugin\Derivative\JumpMenuBlock"
)

Hierarchy

  • class \Drupal\jump_menu\Plugin\Block\JumpMenuBlock extends \Drupal\block\BlockBase

Expanded class hierarchy of JumpMenuBlock

File

lib/Drupal/jump_menu/Plugin/Block/JumpMenuBlock.php, line 24
Contains \Drupal\jump_menu\Plugin\Block\JumpMenuBlock.

Namespace

Drupal\jump_menu\Plugin\Block
View source
class JumpMenuBlock extends BlockBase {

  /**
   * Overrides \Drupal\block\BlockBase::access().
   */
  public function access() {

    // @todo Clean up when http://drupal.org/node/1874498 lands.
    list(, $derivative) = explode(':', $this
      ->getPluginId());
    return $GLOBALS['user']
      ->isAuthenticated() || in_array($derivative, array(
      'main',
      'tools',
      'footer',
    ));
  }

  /**
   * {@inheritdoc}
   */
  public function build() {

    // @todo Clean up when http://drupal.org/node/1874498 lands.

    //list(, $menu) = explode(':', $this->getPluginId());
    return 'THE MENU';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
JumpMenuBlock::access public function Overrides \Drupal\block\BlockBase::access().
JumpMenuBlock::build public function