On this page
function template_preprocess_language_content_settings_table
template_preprocess_language_content_settings_table(&$variables)
Prepares variables for language content settings table templates.
Default template: language-content-settings-table.html.twig.
Parameters
array $variables: An associative array containing:
- element: An associative array containing the properties of the element. Properties used: #bundle_label, #title.
File
- core/modules/language/language.admin.inc, line 106
- Administration functions for language.module.
Code
function template_preprocess_language_content_settings_table(&$variables) {
// Add a render element representing the bundle language settings table.
$element = $variables['element'];
$header = array(
array(
'data' => $element['#bundle_label'],
'class' => array('bundle'),
),
array(
'data' => t('Configuration'),
'class' => array('operations'),
),
);
$rows = array();
foreach (Element::children($element) as $bundle) {
$rows[$bundle] = array(
'data' => array(
array(
'data' => array(
'#prefix' => '<label>',
'#suffix' => '</label>',
'#plain_text' => $element[$bundle]['settings']['#label'],
),
'class' => array('bundle'),
),
array(
'data' => $element[$bundle]['settings'],
'class' => array('operations'),
),
),
'class' => array('bundle-settings'),
);
}
$variables['title'] = $element['#title'];
$variables['build'] = array(
'#header' => $header,
'#rows' => $rows,
'#type' => 'table',
);
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!language!language.admin.inc/function/template_preprocess_language_content_settings_table/8.1.x