diff --git a/phpBB/phpbb/template/twig/extension/icon.php b/phpBB/phpbb/template/twig/extension/icon.php index b2a98fad3f..e3300eab80 100644 --- a/phpBB/phpbb/template/twig/extension/icon.php +++ b/phpBB/phpbb/template/twig/extension/icon.php @@ -56,7 +56,7 @@ class icon extends \Twig\Extension\AbstractExtension * Generate icon HTML for use in the template, depending on the mode. * * @param environment $environment Twig environment object - * @param string $type Icon type (font|png|svg) + * @param string $type Icon type (font|iconify|png|svg) * @param string $icon Icon name (eg. "bold") * @param string $title Icon title * @param bool $hidden Hide the icon title from view @@ -72,6 +72,7 @@ class icon extends \Twig\Extension\AbstractExtension switch ($type) { case 'font': + case 'iconify': $source = ''; break; diff --git a/phpBB/styles/prosilver/template/icons/iconify.html b/phpBB/styles/prosilver/template/icons/iconify.html new file mode 100644 index 0000000000..74820bafc0 --- /dev/null +++ b/phpBB/styles/prosilver/template/icons/iconify.html @@ -0,0 +1,4 @@ +{% spaceless %} + + {% if TITLE %}{{ lang(TITLE) }}{% endif %} +{% endspaceless %} diff --git a/tests/template/extension_test.php b/tests/template/extension_test.php index d40a749aa2..fec06fe296 100644 --- a/tests/template/extension_test.php +++ b/tests/template/extension_test.php @@ -302,6 +302,37 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case ' Pencil icon' ], + /** Iconify: default */ + [ + [ + 'type' => 'iconify', + 'icon' => 'phone', + 'title' => '', + 'hidden' => false, + 'classes' => '', + 'attributes' => [], + ], + [], + '', + ], + /** Iconify: all options */ + [ + [ + 'type' => 'iconify', + 'icon' => 'pencil', + 'title' => 'ICON_PENCIL', + 'hidden' => true, + 'classes' => 'icon-lg', + 'attributes' => [ + 'data-swap' => 'Swap text', + ], + ], + [ + 'ICON_PENCIL' => 'Pencil icon', + ], + ' + Pencil icon', + ], /** PNG: default */ [ [