summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-16 13:41:45 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-16 13:41:45 +0100
commit28c40af4337dcdfe6005133a7b938627cc65e24d (patch)
treef5032053440ad29ad42a6670c2e2f604e2d76d14
parentf0efd6a9415a6cfccc1c0af5701ac5dddb4221a6 (diff)
downloadthemes-28c40af4337dcdfe6005133a7b938627cc65e24d.tar.gz
themes-28c40af4337dcdfe6005133a7b938627cc65e24d.tar.bz2
themes-28c40af4337dcdfe6005133a7b938627cc65e24d.zip
Filter textarea text to allow {code} wrapper to work properly with ckeditor
-rwxr-xr-xsmartyplugins/function.textarea.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/smartyplugins/function.textarea.php b/smartyplugins/function.textarea.php
index 8ce05c7..388bab6 100755
--- a/smartyplugins/function.textarea.php
+++ b/smartyplugins/function.textarea.php
@@ -92,6 +92,15 @@ function smarty_function_textarea( $pParams, &$pSmartyTemplate ) {
$gBitSmarty->assign('textarea_style', 'style="'.$style.'"');
}
$gBitSmarty->assign('textarea_class', 'class="form-control '.$class.'"');
+
+ if( !empty( $pParams['edit'] )
+ && strpos( $class, 'wysiwyg' ) !== false
+ && $gBitSystem->isPackageActive( 'ckeditor' )
+ && function_exists( 'ckeditor_code_wiki_to_pre' )
+ ) {
+ $gBitSmarty->assign( 'textarea_edit', ckeditor_code_wiki_to_pre( $pParams['edit'] ) );
+ }
+
$ret = $gBitSmarty->fetch("bitpackage:liberty/edit_textarea.tpl");
if( is_object( $gContent ) ) {
if( $formatGuid = $gContent->getField( 'format_guid' ) ) {