Commit | Line | Data |
---|---|---|
e5c01f51 AE |
1 | {assign var='__pageContentID' value='content'|concat:$languageID} |
2 | ||
3 | <script data-relocate="true"> | |
4 | require(['Language'], function (Language) { | |
e5c625ac AE |
5 | Language.addObject({ |
6 | 'wcf.page.search': '{lang}wcf.page.search{/lang}', | |
7 | 'wcf.page.search.error.tooShort': '{lang}wcf.page.search.error.tooShort{/lang}', | |
8 | 'wcf.page.search.error.noResults': '{lang}wcf.page.search.error.noResults{/lang}', | |
9 | 'wcf.page.search.name': '{lang}wcf.page.search.name{/lang}', | |
53f1501f | 10 | 'wcf.page.search.results': '{lang}wcf.page.search.results{/lang}' |
e5c625ac | 11 | }); |
e5c01f51 AE |
12 | }) |
13 | </script> | |
14 | ||
15 | {if $pageType == 'html' || $pageType == 'tpl'} | |
16 | <ul class="codemirrorToolbar"> | |
17 | <li><a href="#" id="codemirror-{@$__pageContentID}-media" class="jsTooltip" title="{lang}wcf.editor.button.media{/lang}"><span class="icon icon16 fa-file-o"></span></a></li> | |
18 | <li><a href="#" id="codemirror-{@$__pageContentID}-page" class="jsTooltip" title="{lang}wcf.editor.button.page{/lang}"><span class="icon icon16 fa-file-text-o"></span></a></li> | |
19 | </ul> | |
20 | <script data-relocate="true"> | |
75541cb5 MW |
21 | {include file='mediaJavaScript'} |
22 | ||
58d7e8f8 | 23 | require(['WoltLabSuite/Core/Acp/Ui/CodeMirror/Media', 'WoltLabSuite/Core/Acp/Ui/CodeMirror/Page'], function(AcpUiCodeMirrorMedia, AcpUiCodeMirrorPage) { |
e5c01f51 AE |
24 | new AcpUiCodeMirrorMedia('{@$__pageContentID}'); |
25 | new AcpUiCodeMirrorPage('{@$__pageContentID}'); | |
26 | }); | |
27 | </script> | |
28 | {/if} | |
29 | ||
e5c01f51 | 30 | {if $pageType == 'text'} |
5432b9ab MW |
31 | <textarea name="content[{@$languageID}]" id="{@$__pageContentID}" |
32 | {if $pageType == 'text'} | |
223f2245 | 33 | class="wysiwygTextarea" data-disable-attachments="true" data-autosave="com.woltlab.wcf.page{$action|ucfirst}-{if $action == 'edit'}{@$pageID}{else}0{/if}-{@$languageID}" |
5432b9ab MW |
34 | {/if} |
35 | >{if !$content[$languageID]|empty}{$content[$languageID]}{/if}</textarea> | |
36 | ||
e5c01f51 AE |
37 | {capture append='__redactorJavaScript'}, '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabPage.js?v={@LAST_UPDATE_TIME}'{/capture} |
38 | {capture append='__redactorConfig'} | |
e5c625ac AE |
39 | buttonOptions.woltlabPage = { icon: 'fa-file-text-o', title: '{lang}wcf.editor.button.page{/lang}' }; |
40 | ||
41 | buttons.push('woltlabPage'); | |
42 | ||
43 | config.plugins.push('WoltLabPage'); | |
44 | {/capture} | |
45 | ||
e5c01f51 | 46 | {include file='wysiwyg' wysiwygSelector=$__pageContentID} |
5432b9ab MW |
47 | {else} |
48 | <div dir="ltr"> | |
49 | <textarea name="content[{@$languageID}]" id="{@$__pageContentID}" | |
223f2245 AE |
50 | {if $pageType == 'text'} |
51 | class="wysiwygTextarea" data-disable-attachments="true" data-autosave="com.woltlab.wcf.page{$action|ucfirst}-{if $action == 'edit'}{@$pageID}{else}0{/if}-{@$languageID}" | |
5432b9ab MW |
52 | {/if} |
53 | >{if !$content[$languageID]|empty}{$content[$languageID]}{/if}</textarea> | |
54 | </div> | |
55 | {if $pageType == 'html'} | |
56 | {include file='codemirror' codemirrorMode='htmlmixed' codemirrorSelector='#content'|concat:$languageID} | |
57 | {elseif $pageType == 'tpl'} | |
58 | {include file='codemirror' codemirrorMode='smartymixed' codemirrorSelector='#content'|concat:$languageID} | |
59 | {/if} | |
849be203 | 60 | {/if} |