1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Not Planned Custom Wysiwyg Formatterclass in XenForo_ViewPublic_Helper_Editor::getEditorTemplate

Discussion in 'Closed Suggestions' started by Dan, Apr 29, 2014.

  1. Dan

    Dan Well-Known Member

    We're using a custom bbcode formatter and editor instance with many additonal feaures (and buttons) for our CMS.
    We need to use a custom wysiwyg editor too, but we can't because it's hardcoded in
    PHP:
    if ($message !== '')
           {
             
    $bbCodeParser XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Wysiwyg', array('view' => $view)));
             
    $messageHtml $bbCodeParser->render($message, array('lightBox' => false));
           }
    ATM i had to copy the getEditorTemplate method and replace only the formatter name
    PHP:
    $bbCodeParser XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Wysiwyg', array('view' => $view)));
    with
    PHP:
    if (empty($editorOptions['viewName']))
      {
      
    $editorOptions['viewName'] = 'Wysiwyg';
      }
    $bbCodeParser XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create($editorOptions['viewName'], array('view' => $view)));
    Couldn't you put the formatter name into the editorOptions variable, so we could set it when we call XenForo_ViewPublic_Helper_Editor::getEditorTemplate and also set it via the editor_setup event?


    I don't want to use the xfcp system here, because the new tags and buttons are only for our CMS and shouldn't be available in the forum and all the other pages with an editor.
     
    Last edited by a moderator: Apr 29, 2014

Share This Page