| 1 | {combine_script id="codemirror" path="plugins/LocalFilesEditor/codemirror/lib/codemirror.js"} |
|---|
| 2 | {combine_script id="codemirror.xml" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/xml/xml.js"} |
|---|
| 3 | {combine_script id="codemirror.javascript" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.js"} |
|---|
| 4 | {combine_script id="codemirror.css" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/css/css.js"} |
|---|
| 5 | {combine_script id="codemirror.clike" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/clike/clike.js"} |
|---|
| 6 | {combine_script id="codemirror.htmlmixed" require="codemirror.xml,codemirror.javascript,codemirror.css" path="plugins/LocalFilesEditor/codemirror/mode/htmlmixed/htmlmixed.js"} |
|---|
| 7 | {combine_script id="codemirror.php" require="codemirror.xml,codemirror.javascript,codemirror.css,codemirror.clike" path="plugins/LocalFilesEditor/codemirror/mode/php/php.js"} |
|---|
| 8 | |
|---|
| 9 | {combine_css path="plugins/LocalFilesEditor/codemirror/lib/codemirror.css"} |
|---|
| 10 | {combine_css path="plugins/LocalFilesEditor/codemirror/mode/xml/xml.css"} |
|---|
| 11 | {combine_css path="plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.css"} |
|---|
| 12 | {combine_css path="plugins/LocalFilesEditor/codemirror/mode/css/css.css"} |
|---|
| 13 | {combine_css path="plugins/LocalFilesEditor/codemirror/mode/clike/clike.css"} |
|---|
| 14 | {combine_css path="plugins/LocalFilesEditor/locfiledit.css"} |
|---|
| 15 | |
|---|
| 16 | {footer_script} |
|---|
| 17 | function loadCodemirror() {ldelim} |
|---|
| 18 | editor = CodeMirror.fromTextArea(document.getElementById("text"), {ldelim} |
|---|
| 19 | matchBrackets: true, |
|---|
| 20 | mode: "{$CODEMIRROR_MODE}", |
|---|
| 21 | tabMode: "shift" |
|---|
| 22 | }); |
|---|
| 23 | jQuery("#showedit, #hideedit").toggle(); |
|---|
| 24 | jQuery.post("plugins/LocalFilesEditor/update_config.php", {ldelim} editarea: "on"}); |
|---|
| 25 | } |
|---|
| 26 | |
|---|
| 27 | function unloadCodemirror() {ldelim} |
|---|
| 28 | editor.toTextArea(); |
|---|
| 29 | jQuery("#showedit, #hideedit").toggle(); |
|---|
| 30 | jQuery.post("plugins/LocalFilesEditor/update_config.php", {ldelim} editarea: "off"}); |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | {if $LOAD_CODEMIRROR == 'on'} |
|---|
| 34 | if (document.getElementById("text") != null) loadCodemirror(); |
|---|
| 35 | {/if} |
|---|
| 36 | {/footer_script} |
|---|
| 37 | |
|---|
| 38 | <div class="titrePage"> |
|---|
| 39 | <h2>LocalFiles Editor</h2> |
|---|
| 40 | </div> |
|---|
| 41 | |
|---|
| 42 | <form method="post" class="properties" action="{$F_ACTION}" ENCTYPE="multipart/form-data" name="form"> |
|---|
| 43 | |
|---|
| 44 | <div id="LocalFilesEditor"> |
|---|
| 45 | |
|---|
| 46 | <input type="hidden" value="{$zone_edit.EDITED_FILE}" name="edited_file"/> |
|---|
| 47 | |
|---|
| 48 | {if isset ($create_tpl)} |
|---|
| 49 | <table> |
|---|
| 50 | <tr> |
|---|
| 51 | <td style="text-align: right;">{'locfiledit_new_filename'|@translate}</td> |
|---|
| 52 | <td style="text-align: left;"><input type="text" size="55" maxlength="50" value="{$create_tpl.NEW_FILE_NAME}" name="tpl_name"/></td> |
|---|
| 53 | </tr> |
|---|
| 54 | <tr> |
|---|
| 55 | <td style="text-align: right;">{'locfiledit_parent_directory'|@translate}</td> |
|---|
| 56 | <td style="text-align: left;">{html_options name=tpl_parent options=$create_tpl.PARENT_OPTIONS selected=$create_tpl.PARENT_SELECTED}</td> |
|---|
| 57 | </tr> |
|---|
| 58 | <tr> |
|---|
| 59 | <td style="text-align: right;">{'locfiledit_model'|@translate}</td> |
|---|
| 60 | <td style="text-align: left;">{html_options name=tpl_model options=$create_tpl.MODEL_OPTIONS selected=$create_tpl.MODEL_SELECTED}</td> |
|---|
| 61 | </tr> |
|---|
| 62 | </table> |
|---|
| 63 | <br><br> |
|---|
| 64 | <input class="submit" type="submit" value="{'Submit'|@translate}" name="create_tpl" /> |
|---|
| 65 | {/if} |
|---|
| 66 | |
|---|
| 67 | {if isset ($css_lang_tpl)} |
|---|
| 68 | {html_options name=file_to_edit options=$css_lang_tpl.OPTIONS selected=$css_lang_tpl.SELECTED} |
|---|
| 69 | <input class="submit" type="submit" value="{'locfiledit_edit'|@translate}" name="edit" /> |
|---|
| 70 | <br><br> |
|---|
| 71 | {if isset ($css_lang_tpl.NEW_FILE_URL)} |
|---|
| 72 | <span class="{$css_lang_tpl.NEW_FILE_CLASS}"> |
|---|
| 73 | <a href="{$css_lang_tpl.NEW_FILE_URL}">{'locfiledit_new_tpl'|@translate}</a> |
|---|
| 74 | </span> |
|---|
| 75 | {/if} |
|---|
| 76 | {/if} |
|---|
| 77 | |
|---|
| 78 | <div style="overflow:auto;"> {* top bar buttons *} |
|---|
| 79 | {if !empty($show_default)} |
|---|
| 80 | {foreach from=$show_default item=file name=default_loop} |
|---|
| 81 | <span class="top_right"> |
|---|
| 82 | <a href="{$file.SHOW_DEFAULT}" onclick="window.open( this.href, 'local_file', 'location=no,toolbar=no,menubar=no,status=no,resizable=yes,scrollbars=yes,width=800,height=700' ); return false;">{'locfiledit_show_default'|@translate} "{$file.FILE}"</a> |
|---|
| 83 | </span> |
|---|
| 84 | {if !($smarty.foreach.default_loop.last)}<br>{/if} |
|---|
| 85 | {/foreach} |
|---|
| 86 | {/if} |
|---|
| 87 | |
|---|
| 88 | {if isset ($zone_edit)} |
|---|
| 89 | <b>{$zone_edit.FILE_NAME}</b> |
|---|
| 90 | |
|---|
| 91 | </div> {* top bar buttons *} |
|---|
| 92 | |
|---|
| 93 | <textarea rows="30" cols="90" name="text" id="text">{$zone_edit.CONTENT_FILE}</textarea> |
|---|
| 94 | <div id="editarea_buttons"> |
|---|
| 95 | <a href="javascript:loadCodemirror();" id="showedit">[{'locfiledit_enable_codemirror'|@translate}]</a> |
|---|
| 96 | <a href="javascript:unloadCodemirror();" id="hideedit">[{'locfiledit_disable_codemirror'|@translate}]</a> |
|---|
| 97 | </div> |
|---|
| 98 | |
|---|
| 99 | <br> |
|---|
| 100 | |
|---|
| 101 | <input class="submit" type="submit" value="{'locfiledit_save_file'|@translate}" name="submit"/> |
|---|
| 102 | {if isset ($restore)} |
|---|
| 103 | <input class="submit" type="submit" value="{'locfiledit_restore'|@translate}" name="restore" onclick="return confirm('{'locfiledit_restore_confirm'|@translate|escape:'javascript'}');"/> |
|---|
| 104 | {/if} |
|---|
| 105 | |
|---|
| 106 | {if isset ($restore_infos)} |
|---|
| 107 | <br><br> |
|---|
| 108 | {'locfiledit_save_bak'|@translate} |
|---|
| 109 | {/if} |
|---|
| 110 | |
|---|
| 111 | {/if} |
|---|
| 112 | </div> |
|---|
| 113 | </form> |
|---|