commit 785db2185534d1535baef6b61268f97ed267db52 Author: Lee Rowlands Date: Mon Mar 11 18:47:51 2013 +1000 patch 2 diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 0edb028..957f3c2 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2286,6 +2286,22 @@ function theme_mark($variables) { } /** + * Preprocess variables for theme_mark(). + * + * @param array $variables + * An associative array containing: + * - type: Number representing the marker type to display. See MARK_NEW, + * MARK_UPDATED, MARK_READ. + */ +function template_preprocess_mark(&$variables) { + global $user; + $variables['logged_in'] = FALSE; + if ($user->uid) { + $variables['logged_in'] = TRUE; + } +} + +/** * Preprocesses variables for theme_item_list(). * * @param array $variables diff --git a/core/modules/system/templates/mark.html.twig b/core/modules/system/templates/mark.html.twig new file mode 100644 index 0000000..6f44c36 --- /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: + * - 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_mark() + * + * @ingroup themeable + */ +#} +{% if logged_in %} + {% if type == MARK_NEW %} + {{ 'new' | t }} + {% elseif type == MARK_UPDATED %} + {{ 'updated' | t }} + {% endif %} +{% endif %} commit 79c0f9e076a939cfe1d0de250f6bb4466f9903b9 Author: Lee Rowlands Date: Tue Mar 12 18:53:37 2013 +1000 Failing tests diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 957f3c2..9bd4761 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -3199,6 +3199,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()),