Added redactor/codemirror in box add form
authorMarcel Werk <burntime@woltlab.com>
Mon, 27 Jun 2016 13:18:49 +0000 (15:18 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 27 Jun 2016 13:18:49 +0000 (15:18 +0200)
wcfsetup/install/files/acp/templates/__boxAddContent.tpl [new file with mode: 0644]
wcfsetup/install/files/acp/templates/boxAdd.tpl

diff --git a/wcfsetup/install/files/acp/templates/__boxAddContent.tpl b/wcfsetup/install/files/acp/templates/__boxAddContent.tpl
new file mode 100644 (file)
index 0000000..9813c54
--- /dev/null
@@ -0,0 +1,8 @@
+<textarea name="content[{@$languageID}]" id="content{@$languageID}">{if !$content[$languageID]|empty}{$content[$languageID]}{/if}</textarea>
+{if $boxType == 'text'}
+       {include file='wysiwyg' wysiwygSelector='content'|concat:$languageID}
+{elseif $boxType == 'html'}
+       {include file='codemirror' codemirrorMode='htmlmixed' codemirrorSelector='#content'|concat:$languageID}
+{elseif $boxType == 'tpl'}
+       {include file='codemirror' codemirrorMode='smartymixed' codemirrorSelector='#content'|concat:$languageID}
+{/if}
index 88081b0d7da3170edbceb49150626113941c01ae..81b3ff535c3ad556470803c5ad5442762167bae2 100644 (file)
                                        <dl{if $errorField == 'content'} class="formError"{/if}>
                                                <dt><label for="content0">{lang}wcf.acp.box.content{/lang}</label></dt>
                                                <dd>
-                                                       <textarea name="content[0]" id="content0" rows="10">{if !$content[0]|empty}{$content[0]}{/if}</textarea>
+                                                       {include file='__boxAddContent' languageID=0}
+                                                       
                                                        {if $errorField == 'content'}
                                                                <small class="innerError">
                                                                        {if $errorType == 'empty'}
                                                                        <dl{if $errorField == 'content'|concat:$availableLanguage->languageID} class="formError"{/if}>
                                                                                <dt><label for="content{@$availableLanguage->languageID}">{lang}wcf.acp.box.content{/lang}</label></dt>
                                                                                <dd>
-                                                                                       <textarea name="content[{@$availableLanguage->languageID}]" id="content{@$availableLanguage->languageID}">{if !$content[$availableLanguage->languageID]|empty}{$content[$availableLanguage->languageID]}{/if}</textarea>
+                                                                                       {include file='__boxAddContent' languageID=$availableLanguage->languageID}
+                                                                                       
                                                                                        {if $errorField == 'content'|concat:$availableLanguage->languageID}
                                                                                                <small class="innerError">
                                                                                                        {if $errorType == 'empty'}