Skip to content
Snippets Groups Projects
Commit 1d47e0a0 authored by Angie Byron's avatar Angie Byron
Browse files

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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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 %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment