diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index ee3466d..1792e5a 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -188,6 +188,7 @@ function system_theme() {
),
'system_compact_link' => array(
'variables' => array(),
+ 'template' => 'system-compact-link',
),
));
}
@@ -2749,21 +2750,25 @@ function theme_system_powered_by() {
}
/**
- * Returns HTML for a link to show or hide inline help descriptions.
+ * Prepare variables for system compact link templates.
+ *
+ * Default template: system-compact-link.html.twig.
*
* @ingroup themeable
*/
-function theme_system_compact_link() {
- $output = '
';
+function template_preprocess_system_compact_link(&$variables) {
if (system_admin_compact_mode()) {
- $output .= l(t('Show descriptions'), 'admin/compact/off', array('attributes' => array('title' => t('Expand layout to include descriptions.')), 'query' => drupal_get_destination()));
+ $variables['link'] = l(t('Show descriptions'), 'admin/compact/off', array(
+ 'query' => array(drupal_get_destination()),
+ 'attributes' => array('title' => t('Expand layout to include descriptions.')),
+ ));
}
else {
- $output .= l(t('Hide descriptions'), 'admin/compact/on', array('attributes' => array('title' => t('Compress layout by hiding descriptions.')), 'query' => drupal_get_destination()));
+ $variables['link'] = l(t('Hide descriptions'), 'admin/compact/on', array(
+ 'query' => array(drupal_get_destination()),
+ 'attributes' => array('title' => t('Compress layout by hiding descriptions.')),
+ ));
}
- $output .= '
';
-
- return $output;
}
/**
diff --git a/core/modules/system/templates/system-compact-link.html.twig b/core/modules/system/templates/system-compact-link.html.twig
new file mode 100644
index 0000000..2c021a5
--- /dev/null
+++ b/core/modules/system/templates/system-compact-link.html.twig
@@ -0,0 +1,12 @@
+{#
+/**
+ * @file
+ * Default theme implementation for a link to show or hide inline help
+ * descriptions.
+ *
+ * @see template_preprocess_system_compact_link()
+ *
+ * @ingroup themeable
+ */
+#}
+{{ link }}