Commit 046477e7 authored by webchick's avatar webchick

Issue #1938912 by Manuel Garcia, joelpittet, lokapujya, duellj, Cottser,...

Issue #1938912 by Manuel Garcia, joelpittet, lokapujya, duellj, Cottser, akalata, pplantinga, mdrummond, rpayanm, Hydra, lauriii: Convert language content setting table theme to a twig template
parent 8f487d28
......@@ -534,7 +534,7 @@ function content_translation_form_language_content_settings_form_alter(array &$f
}
/**
* Implements hook_preprocess_HOOK() for theme_language_content_settings_table().
* Implements hook_preprocess_HOOK() for language-content-settings-table.html.twig.
*/
function content_translation_preprocess_language_content_settings_table(&$variables) {
module_load_include('inc', 'content_translation', 'content_translation.admin');
......
......@@ -94,7 +94,14 @@ function template_preprocess_language_negotiation_configure_form(&$variables) {
}
/**
* Implements hook_preprocess_HOOK() for theme_language_content_settings_table().
* Prepares variables for language content settings table templates.
*
* Default template: language-content-settings-table.html.twig.
*
* @param array $variables
* An associative array containing:
* - element: An associative array containing the properties of the element.
* Properties used: #bundle_label, #title.
*/
function template_preprocess_language_content_settings_table(&$variables) {
// Add a render element representing the bundle language settings table.
......@@ -132,24 +139,10 @@ function template_preprocess_language_content_settings_table(&$variables) {
);
}
$variables['title'] = $element['#title'];
$variables['build'] = array(
'#title' => $element['#title'],
'#header' => $header,
'#rows' => $rows,
'#type' => 'table',
);
}
/**
* Returns HTML for an administration settings table.
*
* @param array $variables
* An associative array containing:
* - build: A render element representing a table of bundle content language
* settings for a particular entity type.
*
* @ingroup themeable
*/
function theme_language_content_settings_table($variables) {
return '<h4>' . theme_render_and_autoescape($variables['build']['#title']) . '</h4>' . theme_render_and_autoescape($variables['build']);
}
......@@ -108,7 +108,6 @@ function language_theme() {
'language_content_settings_table' => array(
'render element' => 'element',
'file' => 'language.admin.inc',
'function' => 'theme_language_content_settings_table',
),
);
}
......
{#
/**
* @file
* Default theme implementation to display a language content settings table.
*
* Available variables:
* - title: The title of the table.
* - build: Table of content language settings.
*
* @see template_preprocess_language_content_settings_table()
*
* @ingroup themeable
*/
#}
<h4>{{ title }}</h4>
{{ build }}
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