setPageNameIndex (BX_PAGE_DEFAULT); $oTemplate->setPageHeader ("Visual editor"); $oTemplate->setPageContent ('page_main_code', PageCompMainCode()); $oTemplate->getPageCode(); /** * page code function */ function PageCompMainCode() { $oEditor = BxDolEditor::getObjectInstance(); // get default editor object instance ob_start(); if ('editor' == bx_get('action')) { echo ''; echo $oEditor->attachEditor('#my_textarea_popup', BX_EDITOR_STANDARD, true); exit; } elseif (bx_get('my_textarea')) { echo 'Submitted data:
' . bx_process_output(bx_get('my_textarea')) . '
'; } // standard editor echo '
'; // form must have id echo ''; // print text area element echo ''; echo '

'; // standard editor in popup echo BxTemplFunctions::getInstance()->popupBox('bx-sample-editor-in-popup', 'popupBox', 'Editor in popup', true); echo ''; if ($oEditor) // check if editor is available for using echo $oEditor->attachEditor ('#my_textarea'); // output HTML which will automatically apply editor to textarea element by its id // print all available editors and editors view modes below /* echo '
'; $aEditors = array('sys_quill', 'bx_froala'); $aViewModes = array(BX_EDITOR_MINI => 'Mini', BX_EDITOR_STANDARD => 'Standard', BX_EDITOR_FULL => 'Full'); foreach ($aViewModes as $iViewMode => $sViewModeHeader) { echo "

$sViewModeHeader

"; foreach ($aEditors as $sEditor) { $sId = 'textarea_' . $sEditor . '_' . $iViewMode; echo ''; $oEditor = BxDolEditor::getObjectInstance($sEditor); if (!$oEditor) continue; echo $oEditor->attachEditor ('#' . $sId, $iViewMode); echo '
'; } } */ return DesignBoxContent("Visual editor", ob_get_clean(), BX_DB_PADDING_DEF); } /** @} */