View file MMO-Hide-2.3.4/upload/src/addons/MMO/Hide/Template/TemplaterSetup.php

File size: 1.09Kb
<?php

namespace MMO\Hide\Template;

use MMO\Hide\Data\HideTags;

class TemplaterSetup
{
    /**
     * @param $templater
     * @param $escape
     * @param $hideType
     * @param null $reactions
     * @return string
     */
    public static function funcMhReact($templater, &$escape, $hideType, $reactions = null)
    {
        $escape = false;

        $reactionsHtml = [];

        foreach ($reactions AS $reactionId)
        {
            $reactionId = intval($reactionId);

            $reactionsHtml[$reactionId] = $templater->func('reaction', [
                [
                    'id' => $reactionId,
                    'showtitle' => true,
                    'small' => true,
                    'hasreaction' => true
                ]
            ], $escape);
        }

        return \implode(', ', $reactionsHtml);
    }

    public static function funcMhAllowedTags($templater, &$escape)
    {
        /** @var HideTags $hideTags */
        $hideTags = \XF::app()->data(HideTags::class);
        return \implode(', ', $hideTags->getHideTags());
    }
}