mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/15538] Extract service and enhance icon function
PHPBB3-15538
This commit is contained in:
@@ -67,7 +67,7 @@ class icon extends \Twig\Extension\AbstractExtension
|
||||
*/
|
||||
public function icon(environment $environment, $type, $icon, $title = '', $hidden = false, $classes = '', array $attributes = [])
|
||||
{
|
||||
$type = utf8_strtolower($type);
|
||||
$type = strtolower($type);
|
||||
|
||||
switch ($type)
|
||||
{
|
||||
@@ -141,16 +141,9 @@ class icon extends \Twig\Extension\AbstractExtension
|
||||
{
|
||||
if ($element->nodeName === 'svg')
|
||||
{
|
||||
$children = [];
|
||||
|
||||
foreach ($element->childNodes as $node)
|
||||
while (isset($element->firstChild))
|
||||
{
|
||||
$children[] = $node;
|
||||
}
|
||||
|
||||
foreach ($children as $child)
|
||||
{
|
||||
$element->parentNode->insertBefore($child, $element);
|
||||
$element->parentNode->insertBefore($element->firstChild, $element);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user