Commit 1d47e0a0 authored by webchick's avatar webchick

Issue #1939092 by mgifford, dbazuin, jenlampton, azinoman, pwieck, Cottser,...

Issue #1939092 by mgifford, dbazuin, jenlampton, azinoman, pwieck, Cottser, joelpittet, larowlan: Convert theme_mark() to Twig.
parent a4a887ac
......@@ -1672,26 +1672,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 ' <span class="marker">' . t('new') . '</span>';
}
elseif ($type == MARK_UPDATED) {
return ' <span class="marker">' . t('updated') . '</span>';
}
}
}
/**
* Prepares variables for item list templates.
*
......@@ -2570,6 +2550,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),
......
{#
/**
* @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') %}
<span class="marker">{{ 'new'|t }}</span>
{% elseif status is constant('MARK_UPDATED') %}
<span class="marker">{{ 'updated'|t }}</span>
{% endif %}
{% endif %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment