@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux phosweb012 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
Current Path :
/
homepage
/
v-mt
/
tmpl
/
cms
/
Path :
Upload File :
New :
File
Dir
//homepage/v-mt/tmpl/cms/edit_template.tmpl
<mt:setvarblock name="page_title"><mt:if name="id"><__trans phrase="Edit Template"><mt:else><__trans phrase="Create Template"></mt:if></mt:setvarblock> <mt:setvarblock name="html_title"><mt:if name="id"><mt:if name="has_name"><mt:var name="name"><mt:else><mt:var name="template_name"></mt:if> - <__trans phrase="Edit Template"><mt:else><__trans phrase="Create Template"></mt:if></mt:setvarblock> <mt:var name="position_actions_bottom" value="1"> <mt:setvarblock name="system_msg"> <mt:unless name="recovered_object"> <mt:if name="autosaved_object_exists"> <mtapp:statusmsg id="autosaved-object-exists" can_close="1" class="info"> <__trans phrase="A saved version of this [_1] was auto-saved [_3]. <a href="[_2]">Recover auto-saved content</a>" params="<mt:var name="object_label">%%<mt:var name="script_url">?__mode=view&_type=template&&_recover=1&blog_id=<mt:var name="blog_id"><mt:if name="id">&id=<mt:var name="id"></mt:if>%%<mt:date ts="$autosaved_object_ts" relative="1" offset_blog_id="<$mt:var name="blog_id"$>">"> </mtapp:statusmsg> </mt:if> </mt:unless> <mt:if name="recovered_object"> <mtapp:statusmsg id="recovered-object" class="success"> <__trans phrase="You have successfully recovered your saved [_1]." params="<mt:var name="object_label">"> </mtapp:statusmsg> </mt:if> <mt:if name="recovered_failed"> <mtapp:statusmsg id="recovered-failed" class="error"> <__trans phrase="An error occurred while trying to recover your saved [_1]." params="<mt:var name="object_label">"> </mtapp:statusmsg> </mt:if> <mt:if name="saved"> <mt:if name="error"> <mtapp:statusmsg id="generic-error" class="error"> <__trans phrase="Your template changes have been saved."> <mt:var name="error"> </mtapp:statusmsg> <mt:else> <mtapp:statusmsg id="saved" class="success"> <__trans phrase="Your template changes have been saved."> <mt:unless name="build_dynamic"> <mt:if name="has_rebuild"> <mt:if name="can_rebuild"> <__trans phrase="<a href="[_1]" class="rebuild-link">Publish</a> this template." params="<mt:var name="script_url">?__mode=start_rebuild&blog_id=<mt:var name="blog_id">&next=0&type=index-<mt:var name="id">&tmpl_id=<mt:var name="id">&single_template=1'"></a> </mt:if> </mt:if> </mt:unless> </mtapp:statusmsg> </mt:if> <mt:else> <mt:if name="error"> <mtapp:statusmsg id="generic-error" class="error"> <mt:var name="error"> </mtapp:statusmsg> </mt:if> </mt:if> <mt:if name="message"> <mtapp:statusmsg id="message" class="alert"> <mt:var name="message"> </mtapp:statusmsg> </mt:if> <mt:if name="saved_rebuild"> <mtapp:statusmsg id="saved-rebuild" class="success"> <__trans phrase="Your [_1] has been published." params="<mt:var name="name">"> </mtapp:statusmsg> </mt:if> </mt:setvarblock> <mt:setvarblock name="related_content"> <mtapp:widget id="useful-links" label="<__trans phrase="Useful Links">"> <ul> <mt:if name="published_url"> <li><a href="<mt:var name="published_url">" class="icon-left icon-related" target="<__trans phrase="_external_link_target">"><__trans phrase="View Published Template"></a></li> </mt:if> <li><a href="<mt:var name="script_url">?__mode=list&_type=template&blog_id=<mt:var name="blog_id">&filter_key=<$mt:var name="template_group"$>_templates" class="icon-left icon-related"><__trans phrase="List [_1] templates" params="<$mt:var name="template_group_trans"$>"></a></li> <li><a href="javascript:void(0)" onclick="return openManual('templates', 'tags')" class="icon-left icon-related help-link"><__trans phrase="Template tag reference"></a></li> </ul> </mtapp:widget> <mt:if name="have_includes"> <mtapp:widget id="template-includes" label="<__trans phrase="Includes and Widgets">"> <ul> <mt:loop name="include_loop"> <li><mt:if name="include_link"><a href="<mt:var name="include_link">" class="icon-left icon-related"><mt:var name="include_module"></a><mt:else><mt:var name="include_module"> (<a href="<mt:var name="create_link">"><__trans phrase="create"></a>)</mt:if></li> </mt:loop> <mt:loop name="widget_loop"> <li><mt:if name="include_link"><a href="<mt:var name="include_link">" class="icon-left icon-related"><mt:var name="include_module"></a><mt:else><mt:var name="include_module"> (<a href="<mt:var name="create_link">"><__trans phrase="create"></a>)</mt:if></li> </mt:loop> <mt:loop name="widget_set_loop"> <li><mt:if name="include_link"><a href="<mt:var name="include_link">" class="icon-left icon-related"><mt:var name="include_module"></a><mt:else><mt:var name="include_module"> (<a href="<mt:var name="create_link">"><__trans phrase="create"></a>)</mt:if></li> </mt:loop> </ul> </mtapp:widget> </mt:if> <mtapp:widget id="tag-list" class="hidden" label="<__trans phrase="Tag Documentation">" label_link="$link_doc"> <div id="tag-list-inner"> </div> </mtapp:widget> <mtapp:widget id="badtag-list" class="hidden" label="<__trans phrase="Unrecognized Tags">"> <div id="badtag-list-inner"> </div> </mtapp:widget> </mt:setvarblock> <mt:setvartemplate name="action_buttons"> <button onclick="return validate(this.form);" type="submit" accesskey="s" tabindex="12" title="<__trans phrase="Save (s)">" class="primary-button" ><__trans phrase="Save"></button> <mt:unless name="new_object"> <mt:unless name="build_dynamic"> <mt:if name="has_rebuild"> <mt:if name="can_rebuild"> <button type="submit" accesskey="r" tabindex="13" title="<__trans phrase="Save and Publish this template (r)">" onclick="return validate(this.form, 1);" ><__trans phrase="Save & Publish"></button> </mt:if> </mt:if> </mt:unless> </mt:unless> <div id="autosave-notification-<$mt:var name="bar_position" default="top"$>" class="autosave-notification"></div> </mt:setvartemplate> <mt:setvarblock name="html_head" append="1"> <script type="text/javascript" src="<mt:var name="static_uri">js/tc/client.js"></script> <script type="text/javascript"> <!-- var tag_inserts = {}; var snippets = []; <mt:loop name="template_snippets"> var content = "<mt:var name="content" escape="js">"; <mt:if name="trigger"> var output = content.replace(/\$(?!0)/g, ''); snippets.push({ 'input' : '<mt:var name="trigger" escape="js">', 'output' : output }); </mt:if> content = content.replace(/\$0/, ''); tag_inserts['<mt:var name="id" escape="js">'] = content; </mt:loop> if ( !window.Editor ) Editor = { strings: {} }; Editor.strings.unsavedChanges = '<__trans phrase="You have unsaved changes to this template that will be lost." escape="js">'; var fieldStorage = {}; var dirty = false; function setDirty () { log.warn('deprecated function setDirty(), call app.setDirty instead'); app.setDirty(); } function clearDirty () { log.warn('deprecated function clearDirty(), call app.clearDirty instead'); app.clearDirty(); } var tag_docs = <tmpl_var name="tag_docs" to_json="1">; function documentTags( useTextInput ) { // scan text of editor for tags var str; if ( !useTextInput && ( window.app && window.app.cpeList.length > 0 && window.app.cpeList[0].editor ) ) { str = window.app.cpeList[0].getCode(); } else { var area = DOM.getElement('text_cpe') || DOM.getElement('text'); str = area.value; } if ( !defined( str ) ) str = ''; // clear any ignore blocks var re = new RegExp('(<m' + 't:?ignore([^>])*?>)[\\S\\s]*?</mt:?ignore>', 'gi'); str = str.replace(re, '$1'); // scan template string for MT tags and build // a hash of unique tag names var tags = {}; var matches = str.match(/<\$?[mM][tT]:?[^\s>]+/g); if (matches) { for (var i = 0; i < matches.length; i++ ) { var orig_tag = matches[i]; if (orig_tag.match(/^<\$/)) { if (!orig_tag.match(/\$$/)) orig_tag += '$'; } orig_tag = orig_tag.replace(/^</, '<'); orig_tag += '>'; var tag = matches[i].replace(/^<\$?[mM][tT]:?/, ''); tag = tag.replace(/\$$/, ''); tags[dirify(tag.toLowerCase())] = orig_tag; } } // construct a set of bullets for all discovered tags // separate into valid/invalid lists var sorted_tags = []; for ( var t in tags ) { if ( !tags.hasOwnProperty( t ) ) continue; sorted_tags.push(t); } sorted_tags.sort(); var list = ''; var bad_list = ''; for ( var i = 0; i < sorted_tags.length; i++ ) { var t = sorted_tags[i]; var url = tagDocURL( t ); var tag_name = tags[t]; if (!url) { bad_list = bad_list + "<li>" + tag_name + "</li>"; continue; } var link = "<a target=\"mt_docs\" href=\"" + url + "\">" + tag_name + "</a>"; list = list + "<li>" + link + "</li>"; } // if we found tags to list, display the tag-list widget, otherwise // hide it if (list != '') { list = '<ul>' + list + '</ul>'; DOM.getElement("tag-list-inner").innerHTML = list; DOM.removeClassName("tag-list", "hidden"); } else { DOM.addClassName("tag-list", "hidden"); } // if we found invalid tags, display them in badtag-list, otherwise // hide it if (bad_list != '') { bad_list = '<ul>' + bad_list + '</ul>'; DOM.getElement("badtag-list-inner").innerHTML = bad_list; DOM.removeClassName("badtag-list", "hidden"); } else { DOM.addClassName("badtag-list", "hidden"); } } function tagDocURL(name) { var re = new RegExp('(?:^|,)' + name + '\\??(?:,|$)', 'i'); for ( var u in tag_docs ) { if ( !tag_docs.hasOwnProperty(u) ) continue; var tags = tag_docs[u]; var m; if (m = tags.match(re)) { return u.replace(/\%t/, name); } } return; } function archiveFileSelect(sel) { var fld = sel.name; fld = fld.replace(/sel/, 'tmpl'); var edit = getByID(fld); var map = sel.options[sel.selectedIndex].value; if (map == '') { edit.style.display = 'block'; sel.style.display = 'none'; edit.focus(); } else { edit.value = map; } } function insertSnippet(el) { if (el.selectedIndex == -1) return false; var opt = el.options[el.selectedIndex].value; if (!opt) return false; el.selectedIndex = 0; if (tag_inserts[opt]) { app.insertCode( tag_inserts[opt] ); } } function setRebuild(f) { f['rebuild'].value = 'Y'; } function toggleAutoRebuild (t) { o = getByID('rebuild_me'); if (o) { if (t.checked) { o.disabled = true; } else { o.disabled = false; } } } function validate (f, rebuild) { if (f.name && !f.name.value) { alert('<__trans phrase="You must set the Template Name." escape="js">'); return false; } else if (f.outfile && !f.outfile.value) { alert('<__trans phrase="You must set the template Output File." escape="js">'); return false; } else { app.clearDirty(); if (rebuild) setRebuild(f); } return true; } function saveArchiveMapChange(param) { showMsg('<__trans phrase="Please wait..." escape="js">', 'map-message', 'success') // TBD: we need to get the blog id from the selector control // itself var params = { uri: '<mt:var name="script_url">', method: 'POST', arguments: param, load: savedArchiveMapChange }; TC.Client.call(params); } function savedArchiveMapChange(c) { var res = c.responseText; if (res == '') message = '<__trans phrase="Error occurred while updating archive maps." escape="js">'; else message = '<__trans phrase="Archive map has been successfully updated." escape="js">'; showMsg(message, 'map-message', 'success'); var map = getByID('template-maps'); if (map) map.innerHTML = res; } function deleteMap(mapid) { if (!confirm('<__trans phrase="Are you sure you want to remove this template map?" escape="js">')) return; var tr = getByID(mapid); if (tr) { var tbody = tr.parentNode; if (tbody) tbody.deleteRow(tr.rowIndex - 1); // thead has a row - subtract it } var frm = document.forms['archive_map_form']; if (!frm) return false; var param = '__mode=delete_map' + '&blog_id=' + frm['blog_id'].value + '&template_id=<mt:var name="id">' + '&id=' + mapid + '&magic_token=<mt:var name="magic_token">'; saveArchiveMapChange(param); } function setCreateMode () { var el = getByID('map-message'); if (el) el.style.display = 'none'; getByID('create-inline-mapping').style.display = 'block'; return false; } function cancelCreateMode () { getByID('create-inline-mapping').style.display = 'none'; return false; } function addMap() { getByID('create-inline-mapping').style.display = 'none'; var f = document.forms['template-listing-form']; var frm = document.forms['archive_map_form']; if (!frm) return false; var param = '__mode=add_map' + '&blog_id=' + frm['blog_id'].value + '&template_id=<mt:var name="id">' + '&new_archive_type=' + f['new_archive_type'].value + '&magic_token=<mt:var name="magic_token">'; saveArchiveMapChange(param); } function togglePreferred(checkbox, mapid) { var frm = document.forms['template-listing-form']; if (!frm) return false; var checkboxes = frm[checkbox.name]; if (checkbox.length == undefined) { for (var j = 0; j < frm[checkbox.id].length; ++j) { if (frm[checkbox.id][j].type == 'hidden') frm[checkbox.id][j].value = checkbox.checked ? '1' : '0'; } } else { for (var i = 0; i < checkboxes.length; ++i) { if (checkboxes[i] != checkbox) checkboxes[i].checked = false; for (var j = 0; j < frm[checkboxes[i].id].length; ++j) { if (frm[checkboxes[i].id][j].type == 'hidden') { frm[checkboxes[i].id][j].value = checkboxes[i].checked ? '1' : '0'; } } } } } Template.templates.autoSave = '<mt:section encode_js="1"> [# if ( saving ) { #] [#= trans("Auto-saving..." ) #] [# } else { #] [#= trans("Last auto-save at [_1]:[_2]:[_3]", hh, mm, ss ) #] [# } #] </mt:section>'; function init() { var txt = getByID("text"); if (txt) { var w; if (w = txt.contentWindow) { if (w.Language) { if (w.Language && !w.Language.snippets) { w.Language.snippets = []; } var fsnippets = w.Language.snippets; for (var i = 0; i < snippets.length; i++) { fsnippets.push(snippets[i]); } } } } } TC.attachLoadEvent( init ); //--> </script> </mt:setvarblock> <mt:include name="include/header.tmpl"> <div id="edit-template"> <form name="template-listing-form" id="template-listing-form" method="post" action="<mt:var name="script_url">" mt:once="1" mt:auto-save="1" mt:auto-save-delay="<$mt:var name="autosave_frequency"$>000"> <input type="hidden" name="id" value="<mt:var name="id">" /> <input type="hidden" name="blog_id" value="<mt:var name="blog_id" default="0">" /> <input type="hidden" name="type" value="<mt:var name="type" escape="html">" /> <input type="hidden" name="__mode" value="save" /> <input type="hidden" name="_type" value="template" /> <input type="hidden" name="rebuild" value="" /> <input type="hidden" name="action_name" value="" /> <input type="hidden" name="action_input" value="" /> <input type="hidden" name="return_args" value="<mt:var name="return_args" escape="html">" /> <input type="hidden" name="magic_token" value="<mt:var name="magic_token">" /> <mt:include name="include/actions_bar.tmpl" hide_pager="1"> <mtapp:setting id="title" label="<__trans phrase="Template Name">" label_class = "no-header" help_page="templates" help_section="template_name"> <mt:if name="has_name"> <input name="name" id="title" tabindex="1" value="<mt:var name="name" escape="html">" maxlength="255" mt:watch-change="1" /> <mt:else> <input type="hidden" name="name" value="<$mt:var name="template_name" escape="html"$>" /> <input type="text" id="title" name="name_display" value="<$mt:var name="template_name_label" escape="html">" disabled="disabled" /> </mt:if> </mtapp:setting> <mt:if name="type_custom"> <$mt:setvar name="template_name" value="<__trans phrase="Module Body">"$> <mt:else> <$mt:setvar name="template_name" value="<__trans phrase="Template Body">"$> </mt:if> <mtapp:setting id="template-body" label="$template_name" label_class="no-header" help_page="templates" help_section="template_name"> <div id="template-body-actions"> <span class="codepress-toolbar" style="float:right"> <a href="javascript: void 0;" title="<__trans phrase="Syntax Highlight On" escape="singlequotes">" mt:command="set-mode-codepress-on" class="command-toggle-codepress-on toolbar button"><b>Syntax Hightlight On</b><s></s></a> <a href="javascript: void 0;" title="<__trans phrase="Syntax Highlight Off" escape="singlequotes">" mt:command="set-mode-codepress-off" class="command-toggle-codepress-off toolbar button"><b>Syntax Hightlight Off</b><s></s></a> </span> <mt:if name="template_snippets"> <select id="tag-insert" tabindex="2" name="tag-insert" onchange="insertSnippet(this)"> <option value=""><__trans phrase="Insert..."></option> <mt:loop name="template_snippets"> <option value="<mt:var name="id">"><mt:var name="label" escape="html"><mt:if name="trigger"> (<mt:var name="trigger" escape="html">)</mt:if></option> </mt:loop> </select> </mt:if> </div> <div id="textarea-enclosure" style="position: relative; padding-bottom: 10px; height: <mt:var name="disp_prefs_height_text" default="290">px" mt:min-height="66" mt:update-field-height="text_height"> <textarea tabindex="3" class="full-width monospace medium" spellcheck="false" name="text" id="text" cols="" rows="" mt:watch-change="1" style="height: <mt:var name="disp_prefs_height_text" default="290">px" mt:editor="codepress" mt:editor-options="lang:<mt:var name="template_lang"> autocomplete:off" /><mt:var name="text" escape="html"></textarea> <input type="hidden" name="text_height" id="text_height" value="<mt:var name="disp_prefs_height_text" default="290">" /> <div class="resizer" mt:delegate="resizer" mt:target="textarea-enclosure" mt:lock="x"> <img src="<$mt:var name="static_uri"$>images/spacer.gif" width="100%" height="10"/> </div> </div> </mtapp:setting> <mt:if name="type" eq="index"> <mtapp:setting label="<__trans phrase="Template Type">" id="identifier" help_page="templates" help_section="template_type"> <select name="identifier" id="identifier" tabindex="4" class="full-width"> <option value="" <mt:unless name="identifier">selected="selected"</mt:unless>><__trans phrase="Custom Index Template"></option> <mt:loop name="index_identifiers"> <option value="<mt:var name="key" escape="html">" <mt:if name="selected">selected="selected"</mt:if>><$mt:var name="label" escape="html"$> (<$mt:var name="key" escape="html"$>)</option> </mt:loop> </select> </mtapp:setting> </mt:if> <mt:if name="has_outfile"> <mtapp:setting id="outfile" label="<__trans phrase="Output File">" help_page="templates" help_section="output_file"> <div class="textarea-wrapper"> <input name="outfile" id="outfile" tabindex="5" value="<mt:var name="outfile" escape="html">" class="full-width" mt:watch-change="1" /> </div> </mtapp:setting> </mt:if> <mt:if name="has_build_options"> <mtapp:setting id="build_dynamic" label="<__trans phrase="Publish Options">" help_page="templates" help_section="enable_dynamic_publishing"> <mt:if name="custom_dynamic"><mt:if name="build_dynamic"><input type="hidden" name="current_build_dynamic" value="1" /></mt:if></mt:if> <mt:unless name="build_dynamic"><mt:if name="has_rebuild"><mt:if name="rebuild_me"><input type="hidden" name="current_rebuild_me" value="1" /></mt:if></mt:if></mt:unless> <ul> <mt:if name="custom_dynamic"> <li><input type="checkbox" id="build_dynamic" name="build_dynamic" tabindex="6" value="1" <mt:if name="build_dynamic">checked="checked" </mt:if> mt:watch-change="1" /> <label for="build_dynamic"><__trans phrase="Enable dynamic publishing for this template"></label> <a href="javascript:void(0)" onclick="return openManual('templates', 'enable_dynamic_publishing')" class="help-link">?</a></li> </mt:if> <mt:unless name="build_dynamic"> <mt:if name="has_rebuild"> <li><input type="checkbox" id="rebuild_me" name="rebuild_me" tabindex="7" value="1" <mt:if name="rebuild_me">checked="checked" </mt:if> mt:watch-change="1" /> <label for="rebuild_me"><__trans phrase="Publish this template automatically when rebuilding index templates"></label> <a href="javascript:void(0)" onclick="return openManual('templates', 'rebuild_with_indexes')" class="help-link">?</a></li> </mt:if> </mt:unless> </ul> </mtapp:setting> </mt:if> <mtapp:setting label="<__trans phrase="Link to File">" id="linked_file" help_page="templates" help_section="linked_templates"> <div class="textarea-wrapper"> <input name="linked_file" id="linked_file" tabindex="8" value="<mt:var name="linked_file" escape="html">" maxlength="255" class="full-width" mt:watch-change="1" /> </div> </mtapp:setting> <mt:if name="archive_types"> <mtapp:setting id="archive_mapping" label="<__trans phrase="Archive Mapping">" content_class="field-content-text" hint="" show_hint="0"> <p><a href="javascript:void(0)" onclick="return setCreateMode()" class="icon-left icon-create"><__trans phrase="Create Archive Mapping"></a></p> <div id="msg-block"></div> <div class="create-inline" id="create-inline-mapping"> <label for="new_archive_type"><strong><__trans phrase="Type"></strong></label> <select name="new_archive_type" id="new_archive_type" tabindex="9"> <mt:loop name="archive_types"> <option value="<mt:var name="archive_type" escape="html">"><mt:var name="archive_type_translated" escape="html"></option> </mt:loop> </select> <span class="buttons"> <a href="javascript:void(0)" onclick="addMap(); return false;" ><__trans phrase="Add"></a> <a href="javascript:void(0)" onclick="cancelCreateMode(); return false" ><__trans phrase="Cancel"></a> </span> </div> <div id="template-maps"> <mt:include name="include/archive_maps.tmpl"> </div> </mtapp:setting> </mt:if> <mt:include name="include/actions_bar.tmpl" bar_position="bottom" hide_pager="1"> </form> <form name="archive_map_form" method="post" action="<mt:var name="script_url">"> <input type="hidden" name="__mode" value="" /> <input type="hidden" name="_type" value="<mt:var name="object_type">" /> <input type="hidden" name="blog_id" value="<mt:var name="blog_id">" /> <input type="hidden" name="magic_token" value="<mt:var name="magic_token">" /> </form> </div> <script type="text/javascript"> <!-- App.singletonConstructor = MT.App = new Class( MT.App, { initComponents: function() { arguments.callee.applySuper( this, arguments ); documentTags( true ); }, autoSave: function() { arguments.callee.applySuper( this, arguments ); documentTags(); } } ); --> </script> <mt:include name="include/footer.tmpl">