/**
  * Creates a SystemBrandingBlock instance.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The factory for configuration objects.
  * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator
  *   The url generator service.
  * @param \Drupal\Core\Session\AccountInterface $current_user
  *   The current user.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config_factory, UrlGeneratorInterface $url_generator, AccountInterface $current_user)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->configFactory = $config_factory;
     $this->urlGenerator = $url_generator;
     $this->currentUser = $current_user;
 }
Example #2
0
 /**
  * Creates a SystemHelpBlock instance.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Symfony\Component\HttpFoundation\Request $request
  *   The current request.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler.
  * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
  *   The current route match.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, Request $request, ModuleHandlerInterface $module_handler, RouteMatchInterface $route_match)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->request = $request;
     $this->moduleHandler = $module_handler;
     $this->routeMatch = $route_match;
 }
 /**
  * Constructs an AggregatorFeedBlock object.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\aggregator\FeedStorageInterface $feed_storage
  *   The entity storage for feeds.
  * @param \Drupal\aggregator\ItemStorageInterface $item_storage
  *   The entity storage for feed items.
  * @param \Drupal\Core\Entity\Query\QueryInterface $item_query
  *   The entity query object for feed items.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, FeedStorageInterface $feed_storage, ItemStorageInterface $item_storage, QueryInterface $item_query)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->feedStorage = $feed_storage;
     $this->itemStorage = $item_storage;
     $this->itemQuery = $item_query;
 }
Example #4
0
 /**
  * Constructs a new BlockContentBlock.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin ID for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\block\BlockManagerInterface
  *   The Plugin Block Manager.
  * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
  *   The entity manager service.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface
  *   The Module Handler.
  * @param \Drupal\Core\Session\AccountInterface $account
  *   The account for which view access should be checked.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, BlockManagerInterface $block_manager, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, AccountInterface $account)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->blockManager = $block_manager;
     $this->entityManager = $entity_manager;
     $this->moduleHandler = $module_handler;
     $this->account = $account;
 }
Example #5
0
 /**
  * Constructs a \Drupal\views\Plugin\Block\ViewsBlockBase object.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\views\ViewExecutableFactory $executable_factory
  *   The view executable factory.
  * @param \Drupal\Core\Entity\EntityStorageInterface $storage
  *   The views storage.
  * @param \Drupal\Core\Session\AccountInterface $user
  *   The current user.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, ViewExecutableFactory $executable_factory, EntityStorageInterface $storage, AccountInterface $user)
 {
     $this->pluginId = $plugin_id;
     $delta = $this->getDerivativeId();
     list($name, $this->displayID) = explode('-', $delta, 2);
     // Load the view.
     $view = $storage->load($name);
     $this->view = $executable_factory->get($view);
     $this->displaySet = $this->view->setDisplay($this->displayID);
     $this->user = $user;
     parent::__construct($configuration, $plugin_id, $plugin_definition);
 }
Example #6
0
 /**
  * Constructs a new SystemMenuBlock.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param array $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\menu_link\MenuTreeInterface $menu_tree
  *   The menu tree.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, MenuTreeInterface $menu_tree)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->menuTree = $menu_tree;
 }
 /**
  * Constructs a new BookNavigationBlock instance.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
  *   The request stack object.
  * @param \Drupal\book\BookManagerInterface $book_manager
  *   The book manager.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, RequestStack $request_stack, BookManagerInterface $book_manager)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->requestStack = $request_stack;
     $this->bookManager = $book_manager;
 }
 /**
  * Constructs a new SystemBreadcrumbBlock object.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface $breadcrumb_manager
  *   The breadcrumb manager.
  * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
  *   The current route match.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, BreadcrumbBuilderInterface $breadcrumb_manager, RouteMatchInterface $route_match)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->breadcrumbManager = $breadcrumb_manager;
     $this->routeMatch = $route_match;
 }
 /**
  * Constructs a new RedirectFormBlock.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Form\FormBuilderInterface $form_builder
  *   The form builder.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, FormBuilderInterface $form_builder)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->formBuilder = $form_builder;
 }
Example #10
0
 /**
  * Constructs a new SystemMenuBlock.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param array $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Menu\MenuLinkTreeInterface $menu_tree
  *   The menu tree service.
  * @param \Drupal\Core\Menu\MenuActiveTrailInterface $menu_active_trail
  *   The active menu trail service.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, MenuLinkTreeInterface $menu_tree, MenuActiveTrailInterface $menu_active_trail)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->menuTree = $menu_tree;
     $this->menuActiveTrail = $menu_active_trail;
 }
Example #11
0
 /**
  * Constructs an LanguageBlock object.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
  *   The language manager.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, LanguageManagerInterface $language_manager)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->languageManager = $language_manager;
 }