diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 8d527df..f8b2a18 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2273,24 +2273,23 @@ function theme_tablesort_indicator($variables) {
}
/**
- * Returns HTML for a marker for new or updated content.
+ * Prepares variables for mark templates.
*
- * @param $variables
+ * Default template: mark.html.twig
+ *
+ * @param array $variables
* An associative array containing:
* - type: Number representing the marker type to display. See MARK_NEW,
* MARK_UPDATED, MARK_READ.
*/
-function theme_mark($variables) {
- $type = $variables['type'];
+function template_preprocess_mark(&$variables) {
global $user;
+ $variables['logged_in'] = FALSE;
if ($user->uid) {
- if ($type == MARK_NEW) {
- return ' ' . t('new') . '';
- }
- elseif ($type == MARK_UPDATED) {
- return ' ' . t('updated') . '';
- }
+ $variables['logged_in'] = TRUE;
}
+ $variables['MARK_NEW'] = MARK_NEW;
+ $variables['MARK_UPDATED'] = MARK_UPDATED;
}
/**
@@ -3191,6 +3190,7 @@ function drupal_common_theme() {
),
'mark' => array(
'variables' => array('type' => MARK_NEW),
+ 'template' => 'mark'
),
'item_list' => array(
'variables' => array('items' => array(), 'title' => '', 'type' => 'ul', 'attributes' => array()),
diff --git a/core/modules/system/templates/mark.html.twig b/core/modules/system/templates/mark.html.twig
new file mode 100644
index 0000000..2008222
--- /dev/null
+++ b/core/modules/system/templates/mark.html.twig
@@ -0,0 +1,23 @@
+{#
+/**
+ * @file
+ * Default theme implementation for a marker for new or updated content.
+ *
+ * Available variables:
+ * - type: Number representing the marker type to display. See MARK_NEW,
+ * MARK_UPDATED, MARK_READ.
+ * - logged_in: TRUE if the user is logged in, else FALSE.
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_mark()
+ *
+ * @ingroup themeable
+ */
+#}
+{% if logged_in %}
+ {% if type == MARK_NEW %}
+ {{ 'new'|t }}
+ {% elseif type == MARK_UPDATED %}
+ {{ 'updated'|t }}
+ {% endif %}
+{% endif %}