Commit 3b2e57f0 authored by alexpott's avatar alexpott

Issue #2326409 by Berdir, tim.plunkett: Annotate render element plugins.

parent 59788e3f
......@@ -3446,9 +3446,6 @@ function drupal_flush_all_caches() {
// Reset all static caches.
drupal_static_reset();
// Clear all non-drupal_static() static caches.
\Drupal::entityManager()->clearCachedDefinitions();
// Wipe the PHP Storage caches.
PhpStorageFactory::get('service_container')->deleteAll();
PhpStorageFactory::get('twig')->deleteAll();
......@@ -3498,6 +3495,9 @@ function drupal_flush_all_caches() {
// Rebuild all information based on new module data.
$module_handler->invokeAll('rebuild');
// Clear all plugin caches.
\Drupal::service('plugin.cache_clearer')->clearCachedDefinitions();
// Rebuild the menu router based on all rebuilt data.
// Important: This rebuild must happen last, so the menu router is guaranteed
// to be based on up to date information.
......
......@@ -85,30 +85,6 @@ function contextual_help($route_name, RouteMatchInterface $route_match) {
}
}
/**
* Implements hook_element_info().
*
* @todo Remove once https://www.drupal.org/node/2326409 is in.
*/
function contextual_element_info() {
$types['contextual_links_placeholder'] = array(
'#pre_render' => array('\Drupal\contextual\Element\ContextualLinksPlaceholder::preRenderPlaceholder'),
'#id' => NULL,
);
$types['contextual_links'] = array(
'#pre_render' => array('\Drupal\contextual\Element\ContextualLinks::preRenderLinks'),
'#theme' => 'links__contextual',
'#links' => array(),
'#attributes' => array('class' => array('contextual-links')),
'#attached' => array(
'library' => array(
'contextual/drupal.contextual-links',
),
),
);
return $types;
}
/**
* Implements hook_preprocess().
*
......
......@@ -12,8 +12,7 @@
/**
* Provides a contextual_links element.
*
* @todo Annotate once https://www.drupal.org/node/2326409 is in.
* RenderElement("contextual_links")
* @RenderElement("contextual_links")
*/
class ContextualLinks extends RenderElement {
......
......@@ -13,8 +13,7 @@
/**
* Provides a contextual_links_placeholder element.
*
* @todo Annotate once https://www.drupal.org/node/2326409 is in.
* RenderElement("contextual_links_placeholder")
* @RenderElement("contextual_links_placeholder")
*/
class ContextualLinksPlaceholder extends RenderElement {
......
......@@ -70,20 +70,6 @@ function field_ui_theme() {
);
}
/**
* Implements hook_element_info().
*
* @todo Remove once https://www.drupal.org/node/2326409 is in.
*/
function field_ui_element_info() {
return array(
'field_ui_table' => array(
'#theme' => 'field_ui_table',
'#regions' => array('' => array()),
),
);
}
/**
* Implements hook_entity_type_build().
*/
......
......@@ -12,8 +12,7 @@
/**
* Provides a field_ui table element.
*
* @todo Annotate once https://www.drupal.org/node/2326409 is in.
* RenderElement("field_ui_table")
* @RenderElement("field_ui_table")
*/
class FieldUiTable extends RenderElement {
......
......@@ -86,34 +86,6 @@ function filter_theme() {
);
}
/**
* Implements hook_element_info().
*
* @see filter_process_format()
* @see text_format_wrapper()
*
* @todo Remove once https://www.drupal.org/node/2326409 is in.
*/
function filter_element_info() {
$type['text_format'] = array(
'#process' => array(
'\Drupal\filter\Element\TextFormat::processFormat',
),
'#base_type' => 'textarea',
'#theme_wrappers' => array('text_format_wrapper'),
);
$type['processed_text'] = array(
'#text' => '',
'#format' => NULL,
'#filter_types_to_skip' => array(),
'#langcode' => '',
'#pre_render' => array(
'\Drupal\filter\Element\ProcessedText::preRenderText',
),
);
return $type;
}
/**
* Retrieves a list of enabled text formats, ordered by weight.
*
......
......@@ -16,8 +16,7 @@
/**
* Provides a processed text render element.
*
* @todo Annotate once https://www.drupal.org/node/2326409 is in.
* RenderElement("processed_text")
* @RenderElement("processed_text")
*/
class ProcessedText extends RenderElement {
......
......@@ -15,8 +15,7 @@
/**
* Provides a text format render element.
*
* @todo Annotate once https://www.drupal.org/node/2326409 is in.
* RenderElement("text_format")
* @RenderElement("text_format")
*/
class TextFormat extends RenderElement {
......
......@@ -169,22 +169,6 @@ function language_process_language_select($element) {
return $element;
}
/**
* Implements hook_element_info().
*
* @todo Remove once https://www.drupal.org/node/2326409 is in.
*/
function language_element_info() {
$types['language_configuration'] = array(
'#input' => TRUE,
'#tree' => TRUE,
'#process' => array(
'\Drupal\language\Element\LanguageConfiguration::processLanguageConfiguration',
),
);
return $types;
}
/**
* Submit handler for the forms that have a language_configuration element.
*/
......
......@@ -14,8 +14,7 @@
/**
* Provides language element configuration.
*
* @todo Annotate once https://www.drupal.org/node/2326409 is in.
* FormElement("language_configuration")
* @FormElement("language_configuration")
*/
class LanguageConfiguration extends FormElement {
......
......@@ -12,8 +12,7 @@
/**
* Provides a render element for the default Drupal toolbar.
*
* @todo Annotate once https://www.drupal.org/node/2326409 is in.
* RenderElement("toolbar")
* @RenderElement("toolbar")
*/
class Toolbar extends RenderElement {
......
......@@ -15,8 +15,7 @@
*
* The 'tray' property contains a renderable array.
*
* @todo Annotate once https://www.drupal.org/node/2326409 is in.
* RenderElement("toolbar_item")
* @RenderElement("toolbar_item")
*/
class ToolbarItem extends RenderElement {
......
......@@ -47,59 +47,6 @@ function toolbar_theme($existing, $type, $theme, $path) {
return $items;
}
/**
* Implements hook_element_info().
*
* @todo Remove once https://www.drupal.org/node/2326409 is in.
*/
function toolbar_element_info() {
$elements = array();
$elements['toolbar'] = array(
'#pre_render' => array(
'\Drupal\toolbar\Element\Toolbar::preRenderToolbar',
),
'#theme' => 'toolbar',
'#attached' => array(
'library' => array(
'toolbar/toolbar',
),
),
// Metadata for the toolbar wrapping element.
'#attributes' => array(
// The id cannot be simply "toolbar" or it will clash with the simpletest
// tests listing which produces a checkbox with attribute id="toolbar"
'id' => 'toolbar-administration',
'role' => 'group',
'aria-label' => t('Site administration toolbar'),
),
// Metadata for the administration bar.
'#bar' => array(
'#heading' => t('Toolbar items'),
'#attributes' => array(
'id' => 'toolbar-bar',
'role' => 'navigation',
'aria-label' => t('Toolbar items'),
),
),
);
// A toolbar item is wrapped in markup for common styling. The 'tray'
// property contains a renderable array.
$elements['toolbar_item'] = array(
'#pre_render' => array(
'\Drupal\toolbar\Element\ToolbarItem::preRenderToolbarItem',
),
'#theme' => 'toolbar_item',
'tab' => array(
'#type' => 'link',
'#title' => NULL,
'#href' => '',
),
);
return $elements;
}
/**
* Implements hook_page_build().
*
......
......@@ -13,8 +13,7 @@
/**
* Provides a render element to display a view.
*
* @todo Annotate once https://www.drupal.org/node/2326409 is in.
* RenderElement("view")
* @RenderElement("view")
*/
class View extends RenderElement {
......
......@@ -47,22 +47,6 @@ function views_help($route_name, RouteMatchInterface $route_match) {
}
}
/**
* Implements hook_element_info().
*
* @todo Remove once https://www.drupal.org/node/2326409 is in.
*/
function views_element_info() {
$types['view'] = array(
'#theme_wrappers' => array('container'),
'#pre_render' => array('\Drupal\views\Element\View::preRenderViewElement'),
'#name' => NULL,
'#display_id' => 'default',
'#arguments' => array(),
);
return $types;
}
/**
* Implements hook_views_pre_render().
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment