View file upload/src/addons/MMO/Hide/BbCode/Tag/Hide.php

File size: 914B
<?php

namespace MMO\Hide\BbCode\Tag;

use MMO\Hide\BbCode\AbstractTag;
use MMO\Hide\BbCode\Traits\HasReplyTrait;

class Hide extends AbstractTag
{
    use HasReplyTrait;

    /**
     * @inheritDoc
     */
    public function render($content, array $tagChildren, $tagOption, array $tag, array $options)
    {
        if($this->options()->mhHideLikeAsReply)
        {
            return $this->renderTemplate($content, \XF::phrase('mh_tag_reply'), [
                'canView' => $this->canReplyView($options),
                'options' => $options,
                'tag' => $tag['tag']
            ]);
        }
        else
        {
            return $this->renderTemplate($content, \XF::phrase('mh_tag_hide'), [
                'canView' => $this->visitor()->user_id,
                'options' => $options,
                'tag' => $tag['tag']
            ]);
        }
    }
}