diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 360fc28..529770d 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -211,6 +211,7 @@ function system_theme() {
),
'system_compact_link' => array(
'variables' => array(),
+ 'template' => 'system-compact-link',
),
));
}
@@ -1795,21 +1796,25 @@ function system_time_zones($blank = NULL) {
}
/**
- * Returns HTML for a link to show or hide inline help descriptions.
+ * Prepares 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..13a9e18
--- /dev/null
+++ b/core/modules/system/templates/system-compact-link.html.twig
@@ -0,0 +1,13 @@
+{#
+/**
+ * @file
+ * Default theme implementation for the system compact link.
+ *
+ * Displays a link to show or hide inline help descriptions.
+ *
+ * @see template_preprocess_system_compact_link()
+ *
+ * @ingroup themeable
+ */
+#}
+{{ link }}