Drupal 8  8.0.2
SystemMenuBlock Class Reference
Inheritance diagram for SystemMenuBlock:

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, MenuLinkTreeInterface $menu_tree, MenuActiveTrailInterface $menu_active_trail)
 
 blockForm ($form, FormStateInterface $form_state)
 
 blockSubmit ($form, FormStateInterface $form_state)
 
 build ()
 
 defaultConfiguration ()
 
 getCacheTags ()
 
 getCacheContexts ()
 
- Public Member Functions inherited from BlockBase
 label ()
 
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 getConfiguration ()
 
 setConfiguration (array $configuration)
 
 defaultConfiguration ()
 
 setConfigurationValue ($key, $value)
 
 calculateDependencies ()
 
 access (AccountInterface $account, $return_as_object=FALSE)
 
 buildConfigurationForm (array $form, FormStateInterface $form_state)
 
 blockForm ($form, FormStateInterface $form_state)
 
 validateConfigurationForm (array &$form, FormStateInterface $form_state)
 
 blockValidate ($form, FormStateInterface $form_state)
 
 submitConfigurationForm (array &$form, FormStateInterface $form_state)
 
 blockSubmit ($form, FormStateInterface $form_state)
 
 getMachineNameSuggestion ()
 
 setTransliteration (TransliterationInterface $transliteration)
 
- Public Member Functions inherited from ContextAwarePluginBase
 getContext ($name)
 
 setContext ($name, ComponentContextInterface $context)
 
 setContextValue ($name, $value)
 
 getContextMapping ()
 
 setContextMapping (array $context_mapping)
 
 getContextDefinitions ()
 
 getContextDefinition ($name)
 
- Public Member Functions inherited from ContextAwarePluginBase
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 getContextDefinitions ()
 
 getContextDefinition ($name)
 
 getContexts ()
 
 getContext ($name)
 
 setContext ($name, ContextInterface $context)
 
 getContextValues ()
 
 getContextValue ($name)
 
 setContextValue ($name, $value)
 
 validateContexts ()
 
- Public Member Functions inherited from PluginBase
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 getPluginId ()
 
 getBaseId ()
 
 getDerivativeId ()
 
 getPluginDefinition ()
 
- Public Member Functions inherited from CacheableDependencyInterface
 getCacheMaxAge ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 
static processMenuLevelParents (&$element, FormStateInterface $form_state, &$complete_form)
 

Protected Attributes

 $menuTree
 
 $menuActiveTrail
 
- Protected Attributes inherited from BlockBase
 $transliteration
 
- Protected Attributes inherited from ContextAwarePluginBase
 $context = []
 
- Protected Attributes inherited from PluginBase
 $pluginId
 
 $pluginDefinition
 
 $configuration
 

Additional Inherited Members

- Data Fields inherited from PluginBase
const DERIVATIVE_SEPARATOR = ':'
 
- Protected Member Functions inherited from BlockBase
 baseConfigurationDefaults ()
 
 blockAccess (AccountInterface $account)
 
 transliteration ()
 
- Protected Member Functions inherited from ContextAwarePluginBase
 createContextFromConfiguration (array $context_configuration)
 
 contextHandler ()
 
- Protected Member Functions inherited from ContextAwarePluginBase
 createContextFromConfiguration (array $context_configuration)
 

Detailed Description

Provides a generic Menu block.

( id = "system_menu_block", admin_label = ("Menu"), category = ("Menus"), deriver = "Drupal\system\Plugin\Derivative\SystemMenuBlock" )

Constructor & Destructor Documentation

__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
MenuLinkTreeInterface  $menu_tree,
MenuActiveTrailInterface  $menu_active_trail 
)

Constructs a new SystemMenuBlock.

Parameters
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin_id for the plugin instance.
array$plugin_definitionThe plugin implementation definition.
\Drupal\Core\Menu\MenuLinkTreeInterface$menu_treeThe menu tree service.
\Drupal\Core\Menu\MenuActiveTrailInterface$menu_active_trailThe active menu trail service.

References Drupal\menuTree().

Here is the call graph for this function:

Member Function Documentation

blockForm (   $form,
FormStateInterface  $form_state 
)

{}

References SystemMenuBlock\defaultConfiguration(), Drupal\menuTree(), and t().

Here is the call graph for this function:

blockSubmit (   $form,
FormStateInterface  $form_state 
)

{}

build ( )

{Builds and returns the renderable array for this block plugin.If a block should not be rendered because it has no content, then this method must also ensure to return no content: it must then only return an empty array, or an empty array with cache set (with cacheability metadata indicating the circumstances for it being empty).

Returns
array A renderable array representing the content of the block.
See Also
}

Implements BlockPluginInterface.

References DerivativeInspectionInterface\getDerivativeId(), and Drupal\menuTree().

Here is the call graph for this function:

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.
}

Implements ContainerFactoryPluginInterface.

defaultConfiguration ( )

{Gets default configuration for this plugin.

Returns
array An associative array with the default configuration.
}

Implements ConfigurablePluginInterface.

Referenced by SystemMenuBlock\blockForm().

Here is the caller graph for this function:

getCacheContexts ( )

{The cache contexts associated with this object.These identify a specific variation/representation of the object.Cache contexts are tokens: placeholders that are converted to cache keys by the service. The replacement value depends on the request context (the current URL, language, and so on). They're converted before storing an object in cache.

Returns
string[] An array of cache context tokens, used to generate a cache ID.
See Also
::convertTokensToKeys()
}

Implements CacheableDependencyInterface.

References DerivativeInspectionInterface\getDerivativeId(), and Cache\mergeContexts().

Here is the call graph for this function:

getCacheTags ( )

{The cache tags associated with this object.When this object is modified, these cache tags will be invalidated.

Returns
string[] A set of cache tags.
}

Implements CacheableDependencyInterface.

References DerivativeInspectionInterface\getDerivativeId().

Here is the call graph for this function:

static processMenuLevelParents ( $element,
FormStateInterface  $form_state,
$complete_form 
)
static

Form API callback: Processes the menu_levels field element.

Adjusts the #parents of menu_levels to save its children at the top level.


The documentation for this class was generated from the following file: