summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2015-10-23 00:05:35 (GMT)
committerwebchick2015-10-23 00:05:35 (GMT)
commit046477e7d61c1e52bfe822293200d875c75364d7 (patch)
tree42aa93ee230567f033cebaa487ce85857e49e6fe
parent8f487d2806041414a626e0777aee3cd1a48aece4 (diff)
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
-rw-r--r--core/modules/content_translation/content_translation.module2
-rw-r--r--core/modules/language/language.admin.inc25
-rw-r--r--core/modules/language/language.module1
-rw-r--r--core/modules/language/templates/language-content-settings-table.html.twig16
4 files changed, 26 insertions, 18 deletions
diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module
index 0370367..ff1b34d 100644
--- a/core/modules/content_translation/content_translation.module
+++ b/core/modules/content_translation/content_translation.module
@@ -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');
diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc
index 71d3da0..b5a8ec6 100644
--- a/core/modules/language/language.admin.inc
+++ b/core/modules/language/language.admin.inc
@@ -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']);
-}
diff --git a/core/modules/language/language.module b/core/modules/language/language.module
index 251b435..e92baa2 100644
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -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',
),
);
}
diff --git a/core/modules/language/templates/language-content-settings-table.html.twig b/core/modules/language/templates/language-content-settings-table.html.twig
new file mode 100644
index 0000000..ff2cdbd
--- /dev/null
+++ b/core/modules/language/templates/language-content-settings-table.html.twig
@@ -0,0 +1,16 @@
+{#
+/**
+ * @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 }}