Question about the page view ($this->_view) in the Bb Codes Formatter class

cclaerhout

Well-known member
Since the XenForo developers are back to work, I've got two questions for them (or any developers who would have the answer of course). In the Formatter class, we can see for example this code (except the php comment):

PHP:
        if ($this->_view)
        {
            $template = $this->_view->createTemplateObject('bb_code_tag_php', array(
                'content' => $content
            ));
            return $template->render();
        }
        else
        {
            //Fallback
            return '<div style="margin: 1em auto" title="PHP">' . $content . '</div>';
        }

In which case the page view ($this->_view) is not available when the formatter is called? Is it with mail templates? When the fallback is needed?


Edit: I forgot to write my second question... :coffee:
What was the purpose of this line which makes me crazy when I was trying to update TinyMCE:
Code:
tinyMCE.dom.Event._pageInit(window); // for ajax loads
There's no reference anywhere on the TinyMCE forum or anywhere else. I didn't find any problem with ajax loads. Was it a problem with some former browsers?
 
No, the needed templates doesn't exist as admin templates (e.g. quote,bb_code_XXXX)
It's also commented in XenForo_ViewAdmin_Feed_Preview

// don't pass a view to this, because the templates don't exist in the admin
$bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base'));
 
No, the needed templates doesn't exist as admin templates (e.g. quote,bb_code_XXXX)
It's also commented in XenForo_ViewAdmin_Feed_Preview

// don't pass a view to this, because the templates don't exist in the admin
$bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base'));
Oh ok !!! It makes sense. Thanks. So if the view is not available it's a choice and there is no way to recreate a copy in the admin template.
 
Top Bottom