aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/LocalFilesEditor/template
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2011-04-13 10:38:45 +0000
committerpatdenice <patdenice@piwigo.org>2011-04-13 10:38:45 +0000
commit7211eee1caba1b1d798449b6df6def86c50552ef (patch)
treee56f5030267867ab82aa4328eb9f5cc42d3429b5 /plugins/LocalFilesEditor/template
parentacd200d6472f4e141c45c51c2d15dea8667d71d5 (diff)
merge r10348 from trunk to branch 2.2
Clean code git-svn-id: http://piwigo.org/svn/branches/2.2@10349 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'plugins/LocalFilesEditor/template')
-rw-r--r--plugins/LocalFilesEditor/template/admin.tpl97
-rw-r--r--plugins/LocalFilesEditor/template/locfiledit.css32
-rw-r--r--plugins/LocalFilesEditor/template/show_default.tpl37
3 files changed, 166 insertions, 0 deletions
diff --git a/plugins/LocalFilesEditor/template/admin.tpl b/plugins/LocalFilesEditor/template/admin.tpl
new file mode 100644
index 000000000..1761951d2
--- /dev/null
+++ b/plugins/LocalFilesEditor/template/admin.tpl
@@ -0,0 +1,97 @@
+{combine_script id="codemirror" path="plugins/LocalFilesEditor/codemirror/lib/codemirror.js"}
+{combine_script id="codemirror.xml" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/xml/xml.js"}
+{combine_script id="codemirror.javascript" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.js"}
+{combine_script id="codemirror.css" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/css/css.js"}
+{combine_script id="codemirror.clike" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/clike/clike.js"}
+{combine_script id="codemirror.htmlmixed" require="codemirror.xml,codemirror.javascript,codemirror.css" path="plugins/LocalFilesEditor/codemirror/mode/htmlmixed/htmlmixed.js"}
+{combine_script id="codemirror.php" require="codemirror.xml,codemirror.javascript,codemirror.css,codemirror.clike" path="plugins/LocalFilesEditor/codemirror/mode/php/php.js"}
+
+{combine_css path="plugins/LocalFilesEditor/codemirror/lib/codemirror.css"}
+{combine_css path="plugins/LocalFilesEditor/codemirror/mode/xml/xml.css"}
+{combine_css path="plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.css"}
+{combine_css path="plugins/LocalFilesEditor/codemirror/mode/css/css.css"}
+{combine_css path="plugins/LocalFilesEditor/codemirror/mode/clike/clike.css"}
+{combine_css path="plugins/LocalFilesEditor/template/locfiledit.css"}
+
+{footer_script}
+if (document.getElementById("text") != null)
+ var editor = CodeMirror.fromTextArea(document.getElementById("text"), {ldelim}
+ matchBrackets: true,
+ mode: "{$CODEMIRROR_MODE}",
+ tabMode: "shift"
+ });
+{/footer_script}
+
+<div class="titrePage">
+ <h2>LocalFiles Editor</h2>
+</div>
+
+<form method="post" class="properties" action="{$F_ACTION}" ENCTYPE="multipart/form-data" name="form">
+
+<div id="LocalFilesEditor">
+
+<input type="hidden" value="{$zone_edit.EDITED_FILE}" name="edited_file"/>
+
+{if isset ($create_tpl)}
+ <table>
+ <tr>
+ <td style="text-align: right;">{'locfiledit_new_filename'|@translate}</td>
+ <td style="text-align: left;"><input type="text" size="55" maxlength="50" value="{$create_tpl.NEW_FILE_NAME}" name="tpl_name"/></td>
+ </tr>
+ <tr>
+ <td style="text-align: right;">{'locfiledit_parent_directory'|@translate}</td>
+ <td style="text-align: left;">{html_options name=tpl_parent options=$create_tpl.PARENT_OPTIONS selected=$create_tpl.PARENT_SELECTED}</td>
+ </tr>
+ <tr>
+ <td style="text-align: right;">{'locfiledit_model'|@translate}</td>
+ <td style="text-align: left;">{html_options name=tpl_model options=$create_tpl.MODEL_OPTIONS selected=$create_tpl.MODEL_SELECTED}</td>
+ </tr>
+ </table>
+<br><br>
+<input class="submit" type="submit" value="{'Submit'|@translate}" name="create_tpl" />
+{/if}
+
+{if isset ($css_lang_tpl)}
+{html_options name=file_to_edit options=$css_lang_tpl.OPTIONS selected=$css_lang_tpl.SELECTED}
+<input class="submit" type="submit" value="{'locfiledit_edit'|@translate}" name="edit" />
+<br><br>
+ {if isset ($css_lang_tpl.NEW_FILE_URL)}
+ <span class="{$css_lang_tpl.NEW_FILE_CLASS}">
+ <a href="{$css_lang_tpl.NEW_FILE_URL}">{'locfiledit_new_tpl'|@translate}</a>
+ </span>
+ {/if}
+{/if}
+
+{if isset ($zone_edit)}
+<div id="title_bar">
+{/if}
+
+{if !empty($show_default)}
+{foreach from=$show_default item=file name=default_loop}
+<span class="default_file">
+<a href="{$file.URL}" 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>
+</span>
+{if !($smarty.foreach.default_loop.last)}<br>{/if}
+{/foreach}
+{/if}
+
+{if isset ($zone_edit)}
+<span class="file_name">{$zone_edit.FILE_NAME}</span>
+</div> {* title_bar *}
+
+<textarea rows="30" cols="90" name="text" id="text">{$zone_edit.CONTENT_FILE}</textarea>
+<br>
+<input class="submit" type="submit" value="{'locfiledit_save_file'|@translate}" name="submit"/>
+
+{if isset ($restore)}
+<input class="submit" type="submit" value="{'locfiledit_restore'|@translate}" name="restore" onclick="return confirm('{'locfiledit_restore_confirm'|@translate|escape:'javascript'}');"/>
+{/if}
+
+{if isset ($restore_infos)}
+<br><br>
+{'locfiledit_save_bak'|@translate}
+{/if}
+
+{/if} {* zone_edit *}
+</div>
+</form>
diff --git a/plugins/LocalFilesEditor/template/locfiledit.css b/plugins/LocalFilesEditor/template/locfiledit.css
new file mode 100644
index 000000000..10589bcec
--- /dev/null
+++ b/plugins/LocalFilesEditor/template/locfiledit.css
@@ -0,0 +1,32 @@
+#LocalFilesEditor {
+ text-align: center;
+ margin: 0 2em;
+}
+
+#LocalFilesEditor #title_bar {
+ overflow: auto;
+}
+
+#LocalFilesEditor .file_name {
+ font-weight: bold;
+ float: left;
+}
+
+#LocalFilesEditor .default_file {
+ float: right;
+}
+
+#LocalFilesEditor TD {
+ padding: 0.5em;
+}
+
+#LocalFilesEditor TEXTAREA, .CodeMirror {
+ background-color: #EEEEEE;
+ font-family: monospace,Arial,sans-serif;
+ font-size: 1.2em;
+ border: 1px solid #999999;
+ margin: 0.5em 0;
+ width: 100%;
+ min-height: 500px;
+ height: auto;
+} \ No newline at end of file
diff --git a/plugins/LocalFilesEditor/template/show_default.tpl b/plugins/LocalFilesEditor/template/show_default.tpl
new file mode 100644
index 000000000..cd6c3f318
--- /dev/null
+++ b/plugins/LocalFilesEditor/template/show_default.tpl
@@ -0,0 +1,37 @@
+{combine_script id="codemirror" path="plugins/LocalFilesEditor/codemirror/lib/codemirror.js"}
+{combine_script id="codemirror.xml" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/xml/xml.js"}
+{combine_script id="codemirror.javascript" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.js"}
+{combine_script id="codemirror.css" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/css/css.js"}
+{combine_script id="codemirror.clike" require="codemirror" path="plugins/LocalFilesEditor/codemirror/mode/clike/clike.js"}
+{combine_script id="codemirror.htmlmixed" require="codemirror.xml,codemirror.javascript,codemirror.css" path="plugins/LocalFilesEditor/codemirror/mode/htmlmixed/htmlmixed.js"}
+{combine_script id="codemirror.php" require="codemirror.xml,codemirror.javascript,codemirror.css,codemirror.clike" path="plugins/LocalFilesEditor/codemirror/mode/php/php.js"}
+
+{combine_css path="plugins/LocalFilesEditor/codemirror/lib/codemirror.css"}
+{combine_css path="plugins/LocalFilesEditor/codemirror/mode/xml/xml.css"}
+{combine_css path="plugins/LocalFilesEditor/codemirror/mode/javascript/javascript.css"}
+{combine_css path="plugins/LocalFilesEditor/codemirror/mode/css/css.css"}
+{combine_css path="plugins/LocalFilesEditor/codemirror/mode/clike/clike.css"}
+{combine_css path="plugins/LocalFilesEditor/template/locfiledit.css"}
+
+{footer_script}
+var editor = CodeMirror.fromTextArea(document.getElementById("text"), {ldelim}
+ readOnly: true,
+ mode: "application/x-httpd-php"
+});
+{/footer_script}
+
+{html_head}
+<style type="text/css">
+#headbranch, #theHeader, #copyright {ldelim} display: none; }
+</style>
+{/html_head}
+
+<div id="LocalFilesEditor">
+
+<div id="title_bar">
+ <span class="file_name">{$TITLE}</span>
+</div>
+
+<textarea id="text" rows="30" cols="90" class="show_default_area">{$DEFAULT_CONTENT}</textarea>
+
+</div>