class DashboardBlockBase in Content Planner 8
Implements DashboardBlockBase.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\content_planner\DashboardBlockBase implements DashboardBlockInterface, ContainerFactoryPluginInterface uses ConfigFormBaseTrait
Expanded class hierarchy of DashboardBlockBase
7 files declare their use of DashboardBlockBase
- ContentStateStatistic.php in modules/
content_kanban/ src/ Plugin/ DashboardBlock/ ContentStateStatistic.php - CustomHTMLBlockBase.php in src/
Plugin/ DashboardBlock/ CustomHTMLBlockBase.php - DashboardSettingsForm.php in src/
Form/ DashboardSettingsForm.php - RecentCalendarPublicationsBlock.php in modules/
content_calendar/ src/ Plugin/ DashboardBlock/ RecentCalendarPublicationsBlock.php - RecentKanbanActivities.php in modules/
content_kanban/ src/ Plugin/ DashboardBlock/ RecentKanbanActivities.php
File
- src/
DashboardBlockBase.php, line 17
Namespace
Drupal\content_plannerView source
class DashboardBlockBase extends PluginBase implements DashboardBlockInterface, ContainerFactoryPluginInterface {
use ConfigFormBaseTrait;
/**
* The route match.
*
* @var \Drupal\Core\Entity\EntityTypeManager
*/
protected $entityTypeManager;
/**
* Constructs a new UserLoginBlock instance.
*
* @param array $configuration
* The plugin configuration, i.e. an array with configuration values keyed
* by configuration option name. The special key 'context' may be used to
* initialize the defined contexts by setting it to an array of context
* values keyed by context names.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('entity_type.manager'));
}
/**
* Gets the configuration names that will be editable.
*
* @return array
* An array of configuration object names that are editable if called in
* conjunction with the trait's config() method.
*/
protected function getEditableConfigNames() {
}
/**
* {@inheritdoc}
*/
public function getName() {
return $this->pluginDefinition['name'];
}
/**
* {@inheritdoc}
*/
public function isConfigurable() {
if (array_key_exists('configurable', $this->pluginDefinition)) {
return $this->pluginDefinition['configurable'];
}
return FALSE;
}
/**
* {@inheritdoc}
*/
public function getConfiguration() {
return $this->configuration;
}
/**
* Get basic configuration structure for the block configuration.
*
* @return array
* The basic configuration structure.
*/
public static function getBasicConfigStructure() {
return [
'plugin_id' => NULL,
'title' => NULL,
'weight' => 0,
'configured' => FALSE,
'plugin_specific_config' => [],
];
}
/**
* Get custom config.
*
* @param array $block_configuration
* The block plugin configuration.
* @param string $key
* The config key.
* @param mixed $default_value
* The default value to return if key does not exist in the specific
* configuration.
*
* @return mixed|null
* The config value or NULL.
*/
protected function getCustomConfigByKey(array $block_configuration, $key, $default_value = NULL) {
// If a given key exists in the plugin specific configuration, then return
// it.
if (array_key_exists($key, $block_configuration['plugin_specific_config'])) {
return $block_configuration['plugin_specific_config'][$key];
}
return $default_value;
}
/**
* {@inheritdoc}
*/
public function build() {
return [];
}
/**
* {@inheritdoc}
*/
public function getConfigSpecificFormFields(FormStateInterface &$form_state, Request &$request, array $block_configuration) {
return [];
}
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface &$form_state) {
}
/**
* {@inheritdoc}
*/
public function submitSettingsForm(array &$form, FormStateInterface &$form_state) {
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigFormBaseTrait:: |
protected | function | Retrieves a configuration object. | |
DashboardBlockBase:: |
protected | property | The route match. | |
DashboardBlockBase:: |
public | function |
Build the block and return a renderable array. Overrides DashboardBlockInterface:: |
6 |
DashboardBlockBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
2 |
DashboardBlockBase:: |
public static | function | Get basic configuration structure for the block configuration. | |
DashboardBlockBase:: |
public | function |
Add additonal form elements specific to the Plugin. Overrides DashboardBlockInterface:: |
6 |
DashboardBlockBase:: |
public | function |
Get Configuration passed in by Plugin Manager. Overrides DashboardBlockInterface:: |
|
DashboardBlockBase:: |
protected | function | Get custom config. | |
DashboardBlockBase:: |
protected | function |
Gets the configuration names that will be editable. Overrides ConfigFormBaseTrait:: |
|
DashboardBlockBase:: |
public | function |
Return the name of the block. Overrides DashboardBlockInterface:: |
|
DashboardBlockBase:: |
public | function |
Determines if the plugin is configurable. Overrides PluginBase:: |
|
DashboardBlockBase:: |
public | function |
Submit form handler. Overrides DashboardBlockInterface:: |
|
DashboardBlockBase:: |
public | function |
Validates teh plugin config form. Overrides DashboardBlockInterface:: |
|
DashboardBlockBase:: |
public | function |
Constructs a new UserLoginBlock instance. Overrides PluginBase:: |
2 |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |