diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 4230087..3efb271 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1671,26 +1671,6 @@ function template_preprocess_table(&$variables) { } /** - * Returns HTML for a marker for new or updated content. - * - * @param $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['status']; - if (\Drupal::currentUser()->isAuthenticated()) { - if ($type == MARK_NEW) { - return ' ' . t('new') . ''; - } - elseif ($type == MARK_UPDATED) { - return ' ' . t('updated') . ''; - } - } -} - -/** * Prepares variables for item list templates. * * Default template: item-list.html.twig. @@ -2562,6 +2542,7 @@ function drupal_common_theme() { ), 'mark' => array( 'variables' => array('status' => MARK_NEW), + 'template' => 'mark', ), 'item_list' => array( 'variables' => array('items' => array(), 'title' => '', 'list_type' => 'ul', 'attributes' => array(), 'empty' => NULL), diff --git a/core/modules/system/templates/mark.html.twig b/core/modules/system/templates/mark.html.twig new file mode 100644 index 0000000..2798bb0 --- /dev/null +++ b/core/modules/system/templates/mark.html.twig @@ -0,0 +1,22 @@ +{# +/** + * @file + * Default theme implementation for a marker for new or updated content. + * + * Available variables: + * - status: Number representing the marker status to display. Use the constants + * below for comparison: + * - MARK_NEW + * - MARK_UPDATED + * - MARK_READ + * + * @ingroup themeable + */ +#} +{% if logged_in %} + {% if status is constant('MARK_NEW') %} + {{ 'new'|t }} + {% elseif status is constant('MARK_UPDATED') %} + {{ 'updated'|t }} + {% endif %} +{% endif %}