Skip to content

Commit be1af86

Browse files
committed
Add support for bbcode font-icons in phpBB 4
1 parent 59467ee commit be1af86

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

styles/all/template/abbc3_posting_buttons.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,23 @@
9898
</div>
9999
{% endif %}
100100
{% else %}
101-
<button type="button" class="{{ custom_tag.BBCODE_IMG ? 'abbc3_button' : 'button button-secondary bbcode-' ~ custom_tag.BBCODE_TAG_CLEAN }}" name="addbbcode{{ custom_tag.BBCODE_ID }}" value="{{ not custom_tag.BBCODE_IMG ? custom_tag.BBCODE_TAG }}"{% if custom_tag.BBCODE_IMG %} style="background-image:url('{{ ROOT_PATH ~ custom_tag.BBCODE_IMG }}');"{% endif %} onclick="bbspecial('{{ custom_tag.BBCODE_TAG }}', {{ custom_tag.BBCODE_ID }})" title="{{ custom_tag.BBCODE_HELPLINE }}">{{ not custom_tag.BBCODE_IMG ? custom_tag.BBCODE_TAG }}</button>
101+
{# Use BBCode font icon if set, otherwise use BBCode image if a match exists, otherwise use BBCode tag name #}
102+
{% set use_bbcode_img = custom_tag.BBCODE_FONT_ICON == '' and custom_tag.BBCODE_IMG %}
103+
<button type="button"
104+
class="{{ use_bbcode_img ? 'abbc3_button' : 'button button-secondary bbcode-' ~ custom_tag.BBCODE_TAG_CLEAN }}"
105+
name="addbbcode{{ custom_tag.BBCODE_ID }}"
106+
value="{{ not use_bbcode_img ? custom_tag.BBCODE_TAG }}"
107+
{% if use_bbcode_img %}
108+
style="background-image:url('{{ ROOT_PATH ~ custom_tag.BBCODE_IMG }}');"
109+
{% endif %}
110+
onclick="bbspecial('{{ custom_tag.BBCODE_TAG }}', {{ custom_tag.BBCODE_ID }})"
111+
title="{{ custom_tag.BBCODE_HELPLINE }}">
112+
{% if custom_tag.BBCODE_FONT_ICON != '' %}
113+
{{ Icon('font', custom_tag.BBCODE_FONT_ICON, '', false, custom_tag.BBCODE_TAG_CLEAN) }}
114+
{% elseif not custom_tag.BBCODE_IMG %}
115+
{{ custom_tag.BBCODE_TAG }}
116+
{% endif %}
117+
</button>
102118
{% endif %}
103119
{% endif %}
104120
{% endfor %}

0 commit comments

Comments
 (0)