mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/15538] Revert back to Icon function
PHPBB3-15538
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
{# Wrapper function #}
|
||||
{% macro Icon(type, icon, classes = '', title = '', hidden = false, attributes = {}) %}
|
||||
{% set type = type|capitalize %}
|
||||
|
||||
{% if type in ['Fa', 'Png', 'Svg'] %}
|
||||
{{ attribute(_self, type, [icon, classes, title, hidden, attributes]) }}
|
||||
{% endif %}
|
||||
{% endmacro Icon %}
|
||||
|
||||
{# FA icons #}
|
||||
{% macro Fa(icon, classes = '', title = '', hidden = false, attributes = {}) %}
|
||||
<i class="o-icon font fa-{{ icon ~ Implode_classes(classes) }}"{% if hidden %}{% if title %} title="{{ lang(title) }}"{% endif %} aria-hidden="true"{% endif %}{{ Implode_attributes(attributes) }}></i>
|
||||
{% if title %}<span{% if hidden %} class="sr-only"{% endif %}>{{ lang(title) }}</span>{% endif %}
|
||||
{% endmacro Fa %}
|
||||
|
||||
{# PNG icons #}
|
||||
{% macro Png(icon, classes = '', title = '', hidden = false, attributes = {}) %}
|
||||
<img class="o-icon png png-{{ icon ~ Implode_classes(classes) }}" src="{{ icon|png_path }}" alt="{{ lang(title) }}"{{ _self.attributes(attributes) }}
|
||||
{% endmacro Png %}
|
||||
|
||||
{# SVG icons #}
|
||||
{% macro Svg(icon, classes = '', title = '', hidden = false, attributes = {}) %}
|
||||
{% set title_id = title ? title|lower|replace({' ': '_'}) ~ '-' ~ random() %}
|
||||
|
||||
<svg class="o-icon svg svg-{{ icon ~ Implode_classes(classes) }}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"{% if title %}{% if hidden %} aria-hidden="true"{% endif %} aria-labelledby="{{ title_id }}"{% endif %} role="img"{{ Implode_attributes(attributes) }}>
|
||||
{% if title %}
|
||||
<title id="{{ title_id }}">{{ lang(title) }}</title>
|
||||
{% endif %}
|
||||
|
||||
{{ Svg_clean(icon) }}
|
||||
</svg>
|
||||
{% endmacro Svg %}
|
||||
|
||||
{% from _self import Icon as Icon %}
|
4
phpBB/styles/prosilver/template/icons/font.html
Normal file
4
phpBB/styles/prosilver/template/icons/font.html
Normal file
@@ -0,0 +1,4 @@
|
||||
{% spaceless %}
|
||||
<i class="o-icon font fa-{{ ICON ~ (CLASSES ? ' ' ~ CLASSES) }}"{% if S_HIDDEN %}{% if TITLE %} title="{{ lang(TITLE) }}"{% endif %} aria-hidden="true"{% endif %}{{ ATTRIBUTES }}></i>
|
||||
{% if TITLE %}<span{% if S_HIDDEN %} class="sr-only"{% endif %}>{{ lang(TITLE) }}</span>{% endif %}
|
||||
{% endspaceless %}
|
3
phpBB/styles/prosilver/template/icons/png.html
Normal file
3
phpBB/styles/prosilver/template/icons/png.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{% spaceless %}
|
||||
<img class="o-icon png png-{{ ICON ~ (CLASSES ? ' ' ~ CLASSES) }}" src="{{ SOURCE }}" alt="{{ lang(TITLE) }}"{{ ATTRIBUTES }} />
|
||||
{% endspaceless %}
|
9
phpBB/styles/prosilver/template/icons/svg.html
Normal file
9
phpBB/styles/prosilver/template/icons/svg.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% spaceless %}
|
||||
{% set TITLE_ID = TITLE ? TITLE|lower|replace({' ': '_'}) ~ '-' ~ random() %}
|
||||
|
||||
<svg class="o-icon svg svg-{{ ICON ~ (CLASSES ? ' ' ~ CLASSES) }}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"{% if TITLE %}{% if S_HIDDEN %} aria-hidden="true"{% endif %} aria-labelledby="{{ TITLE_ID }}"{% endif %} role="img"{{ ATTRIBUTES }}>
|
||||
{% if TITLE %}<title id="{{ TITLE_ID }}">{{ lang(TITLE) }}</title>{% endif %}
|
||||
|
||||
{{ SOURCE }}
|
||||
</svg>
|
||||
{% endspaceless %}
|
@@ -11,8 +11,6 @@
|
||||
<!-- ENDIF -->
|
||||
<!-- EVENT index_body_markforums_after -->
|
||||
|
||||
Test: {{ macros.Icon('fa', 'phone') }}
|
||||
|
||||
<!-- INCLUDE forumlist_body.html -->
|
||||
|
||||
<!-- EVENT index_body_forumlist_body_after -->
|
||||
@@ -43,7 +41,7 @@ Test: {{ macros.Icon('fa', 'phone') }}
|
||||
<!-- IF U_VIEWONLINE --><h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3><!-- ELSE --><h3>{L_WHO_IS_ONLINE}</h3><!-- ENDIF -->
|
||||
<p>
|
||||
<!-- EVENT index_body_block_online_prepend -->
|
||||
{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br />
|
||||
{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br />
|
||||
<!-- IF U_VIEWONLINE -->
|
||||
<br />{LOGGED_IN_USER_LIST}
|
||||
<!-- IF LEGEND --><br /><em>{L_LEGEND}{L_COLON} {LEGEND}</em><!-- ENDIF -->
|
||||
|
Reference in New Issue
Block a user