root/branches/release-29/tmpl/cms/cfg_archives.tmpl @ 1309

Revision 1309, 16.5 kB (checked in by ddavis, 23 months ago)

standarize js comment tag escape. BugzID:58265

  • Property svn:keywords set to Author Date Id Revision
Line 
1<mt:setvar name="page_title" value="<__trans phrase="Publishing Settings">">
2<$mt:setvar name="position_actions_bottom" value="1"$>
3<mt:setvar name="publishing" value="1">
4<mt:setvarblock name="system_msg">
5
6    <mt:if name="error">
7        <mtapp:statusmsg
8            id="error"
9            class="error">
10            <mt:var name="error">
11        </mtapp:statusmsg>
12    </mt:if>
13
14    <mt:if name="no_writedir">
15        <mtapp:statusmsg
16            id="no-writedir"
17            class="error">
18            <__trans phrase="Error: Movable Type was not able to create a directory for publishing your blog. If you create this directory yourself, assign sufficient permissions that allow Movable Type to create files within it.">
19        </mtapp:statusmsg>
20    <mt:else>
21
22    <mt:if name="no_cachedir">
23        <mtapp:statusmsg
24            id="no-cachedir"
25            class="error">
26            <__trans phrase="Error: Movable Type was not able to create a directory to cache your dynamic templates. You should create a directory called <code>[_1]</code> underneath your blog directory." params="templates_c">
27        </mtapp:statusmsg>
28    <mt:else>
29
30    <mt:if name="no_writecache">
31        <mtapp:statusmsg
32            id="no-writecache"
33            class="error">
34            <__trans phrase="Error: Movable Type cannot write to the template cache directory. Please check the permissions for the directory called <code>[_1]</code> underneath your blog directory." params="templates_c">
35        </mtapp:statusmsg>
36    <mt:else>
37
38    <mt:if name="no_cache_path">
39        <mtapp:statusmsg
40            id="no-cache-path"
41            class="error">
42            <__trans phrase="Error: Movable Type was not able to create a directory to cache your dynamic templates. You should create a directory called <code>[_1]</code> underneath your blog directory." params="cache">
43        </mtapp:statusmsg>
44    <mt:else>
45
46    <mt:if name="no_write_cache_path">
47        <mtapp:statusmsg
48            id="no-write-cache-path"
49            class="error">
50            <__trans phrase="Error: Movable Type cannot write to the template cache directory. Please check the permissions for the directory called <code>[_1]</code> underneath your blog directory." params="cache">
51        </mtapp:statusmsg>
52
53    <mt:else>
54
55    <mt:if name="saved">
56        <mt:if name="archives_changed">
57            <mtapp:statusmsg
58                id="saved"
59                class="success"
60                rebuild="all">
61                <__trans phrase="Your blog's archive configuration has been saved.">
62            </mtapp:statusmsg>
63        <mt:else>
64            <mtapp:statusmsg
65                id="saved"
66                class="success">
67                <__trans phrase="Your blog's archive configuration has been saved.">
68            </mtapp:statusmsg>
69        </mt:if>
70    </mt:if>
71    </mt:if>
72    </mt:if>
73    </mt:if>
74    </mt:if>
75
76    <mt:if name="saved_added">
77        <mtapp:statusmsg
78            id="saved"
79            class="success"
80            rebuild="all">
81            <__trans phrase="You have successfully added a new archive-template association.">
82            <mt:if name="archives_changed">
83                <__trans phrase="You may need to update your 'Master Archive Index' template to account for your new archive configuration.">
84            </mt:if>
85            <mt:if name="saved_deleted">
86                <__trans phrase="The selected archive-template associations have been deleted.">
87            </mt:if>
88        </mtapp:statusmsg>
89    </mt:if>
90    </mt:if>
91</mt:setvarblock>
92<mt:setvarblock name="content_nav">
93    <mt:include name="include/cfg_content_nav.tmpl">
94</mt:setvarblock>
95<mt:setvarblock name="html_head" append="1">
96<script type="text/javascript" src="<mt:var name="static_uri">js/tc/client.js"></script>
97<script type="text/javascript">
98/* <![CDATA[ */
99function validate (f) {
100    if (!f.site_path.value) {
101        alert('<__trans phrase="You must set your Local Site Path." escape="singlequotes">');
102        return false;
103    } else if (!is_valid_url(f.site_url.value)){
104        alert('<__trans phrase="You must set a valid Site URL." escape="singlequotes">');
105        return false;
106    } else if (!is_valid_path(f.site_path.value)){
107        alert('<__trans phrase="You must set a valid Local Site Path." escape="singlequotes">');
108        return false;
109    }
110    f.site_url.disabled = false;
111    f.site_path.disabled = false;
112    f.archive_path.disabled = false;
113    f.archive_url.disabled = false;
114    return true;
115}
116function is_valid_url(url_){
117    return url_.match( /^https?:\/\/[A-Za-z0-9!$%()=_.:,;@~-]+/ );
118}
119function is_valid_path(path_){
120    for(i = 0; i < path_.length; i++){
121        var buf = escape(path_.substr(i, 1));
122        if (buf.match(/^%u.*/)){
123            return false;
124        }
125        if (buf.match(/(%.{2}){2}?/)){
126                return false;
127        }
128    }
129    return true;
130}
131
132function disableFields(path1,path2) {
133    var url_is = "<mt:var name="site_url" encode_js="1">";
134    var path_is = "<mt:var name="site_path" encode_js="1">";
135    if (url_is.match(/BLOG-NAME/)) {
136        var daURL = getByID(path1);
137        var lock = path1 +"-lock";
138        var lock_img = getByID(lock);
139        daURL.disabled = false;
140        lock_img.style.display = 'none';
141    }
142    if (path_is.match(/BLOG-NAME/)) {
143        var daPath = getByID(path2);
144        var lock = path2 +"-lock";
145        var lock_img = getByID(lock);
146        daPath.disabled = false;
147        lock_img.style.display = 'none';
148    }
149    return;
150}
151
152function toggleFile(path) {
153    var fld = getByID(path);
154    if (fld) {
155        fld.disabled = false;
156        fld.focus();
157        var which_warning = path + "-warning";
158        var urlwarn = getByID(which_warning);
159        if (urlwarn) urlwarn.style.display = "block";
160    }
161    var which_lock = path + "-lock";
162    var img = getByID(which_lock);
163    if (img)
164        img.style.display = 'none';
165    return false;
166}
167
168function toggleDynamicOptions(selection) {
169    var fld = getByID('dynamic_options_area');
170    if (fld) {
171        if (selection.value == 'none') {
172            fld.style.display = 'none';
173        } else {
174            fld.style.display = 'block';
175        }
176    }
177    return false;
178}
179
180function init() {
181    // conditionally disables
182    disableFields('site_url','site_path');
183}
184
185TC.attachLoadEvent( init );
186/* ]]> */
187</script>
188</mt:setvarblock>
189
190<mt:include name="include/header.tmpl">
191
192<div id="cfg-archives">
193
194<form name="cfg_form" id="cfg_form" method="post" action="<mt:var name="script_url">"<mt:if name="can_set_publish_paths">  onsubmit="return validate(this)"</mt:if>>
195<input type="hidden" name="blog_id" value="<mt:var name="blog_id">" />
196<input type="hidden" name="__mode" value="save" />
197<input type="hidden" name="_type" value="blog" />
198<input type="hidden" name="id" value="<mt:var name="blog_id">" />
199<input type="hidden" name="cfg_screen" value="cfg_archives" />
200<input type="hidden" name="return_args" value="<mt:var name="return_args" escape="html">" />
201<input type="hidden" name="magic_token" value="<mt:var name="magic_token">" />
202
203<mt:if name="can_set_publish_paths">
204<h3><__trans phrase="Publishing Paths"></h3>
205<fieldset>
206
207    <mtapp:setting
208        id="site_url"
209        label="<__trans phrase="Site URL">"
210        hint="<__trans phrase="The URL of your website. Do not include a filename (i.e. exclude index.html). Example: http://www.example.com/blog/">"
211        show_hint="1"
212        help_page="blog_settings_publishing"
213        help_section="site_url">
214        <input name="site_url" id="site_url" <mt:if name="site_url">disabled="disabled"</mt:if> value="<mt:var name="site_url" escape="html" default="$suggested_site_url">" size="50" /><mt:if name="site_url"> <a href="javascript:void(0)" title="<__trans phrase="Unlock this blog&rsquo;s site URL for editing">" onclick="return toggleFile('site_url')"><img src="<mt:var name="static_uri">images/locked.gif" alt="Site URL Lock" id="site_url-lock" height="14" width="14" /></a></mt:if>
215
216        <p class="alert-warning-inline icon-left icon-warning" id="site_url-warning" style="display: none"><__trans phrase="Warning: Changing the site URL can result in breaking all the links in your blog."></p>
217    </mtapp:setting>
218
219    <mtapp:setting
220        id="site_path"
221        label="<__trans phrase="Site Root">"
222        hint="<__trans phrase="The path where your index files will be published. An absolute path (starting with '/') is preferred, but you can also use a path relative to the Movable Type directory. Example: /home/melody/public_html/blog">"
223        show_hint="1"
224        help_page="blog_settings_publishing"
225        help_section="site_root">
226        <input name="site_path" id="site_path" <mt:if name="site_path">disabled="disabled"</mt:if> value="<mt:var name="site_path" escape="html" default="$suggested_site_path">" size="50" /><mt:if name="site_path"> <a href="javascript:void(0)" title="<__trans phrase="Unlock this blog&rsquo;s site path for editing">" onclick="return toggleFile('site_path')"><img src="<mt:var name="static_uri">images/locked.gif" alt="Site Root Lock" id="site_path-lock" height="14" width="14" /></a></mt:if>
227
228        <p class="alert-warning-inline icon-left icon-warning" id="site_path-warning" style="display: none"><__trans phrase="Note: Changing your site root requires a complete publish of your site."></p>
229    </mtapp:setting>
230
231    <mtapp:setting
232        id="enable_archive_paths"
233        label="<__trans phrase="Advanced Archive Publishing">"
234        content_class="field-content-text"
235        show_label="0"
236        hint="<__trans phrase="Select this option only if you need to publish your archives outside of your Site Root.">"
237        help_page="blog_settings_publishing"
238        help_section="advanced_archive_publishing">
239            <input type="checkbox" name="enable_archive_paths" id="enable_archive_paths" value="1" onclick="toggleSubPrefs(this); return true"<mt:if name="enable_archive_paths"> checked="checked"</mt:if> class="cb" /> <__trans phrase="Publish archives outside of Site Root">
240    </mtapp:setting>
241
242<div id="enable_archive_paths_prefs"<mt:unless name="enable_archive_paths"> class="hidden"</mt:unless>>
243
244    <mtapp:setting
245        id="archive_url"
246        label="<__trans phrase="Archive URL">"
247        hint="<__trans phrase="Enter the URL of the archives section of your website. Example: http://archives.example.com/">"
248        show_hint="1"
249        help_page="blog_settings_publishing"
250        help_section="archive_url">
251        <input name="archive_url" id="archive_url" <mt:if name="archive_url">disabled="disabled"</mt:if> value="<$mt:var name="archive_url" escape="html"$>" size="50" />
252        <mt:if name="archive_url">
253            <a href="javascript:void(0)" title="<__trans phrase="Unlock this blog&rsquo;s archive url for editing">" onclick="return toggleFile('archive_url')"><img src="<mt:var name="static_uri">images/locked.gif" alt="Archive URL Lock" id="archive_url-lock" height="14" width="14" /></a>
254            <p class="alert-warning-inline icon-left icon-warning" id="archive_url-warning" style="display: none"><__trans phrase="Warning: Changing the archive URL can result in breaking all the links in your blog."></p>
255        </mt:if>
256    </mtapp:setting>
257
258    <mtapp:setting
259        id="archive_path"
260        label="<__trans phrase="Archive Root">"
261        hint="<__trans phrase="Enter the path where your archive files will be published. Example: /home/melody/public_html/archives">"
262        show_hint="1"
263        help_page="blog_settings_publishing"
264        help_section="archive_path">
265            <input name="archive_path" id="archive_path" <mt:if name="archive_path">disabled="disabled"</mt:if> value="<mt:var name="archive_path" escape="html">" size="50" />
266            <mt:if name="archive_path">
267                <a href="javascript:void(0)" title="<__trans phrase="Unlock this blog&rsquo;s site path for editing">" onclick="return toggleFile('archive_path')"><img src="<mt:var name="static_uri">images/locked.gif" alt="Archive Path Lock" id="archive_path-lock" height="14" width="14" /></a>
268                <p class="alert-warning-inline icon-left icon-warning" id="archive_path-warning" style="display: none"><__trans phrase="Warning: Changing the archive path can result in breaking all the links in your blog."></p>
269            </mt:if>
270    </mtapp:setting>
271
272</div>
273
274</fieldset>
275</mt:if>
276
277<h3><__trans phrase="Publishing Options"></h3>
278<fieldset>
279
280<mtapp:setting
281    id="preferred_archive_type"
282    label="<__trans phrase="Preferred Archive Type">"
283    hint="<__trans phrase="Used for creating links to an archived entry (permalink). Select from the archive types used in this blogs archive templates.">"
284    show_hint="1"
285    help_page="blog_settings_publishing"
286    help_section="preferred_archive_type">
287
288    <mt:loop name="entry_archive_types">
289        <mt:if name="__first__">
290<select name="preferred_archive_type" id="preferred_archive_type">
291        </mt:if>
292    <option value="<mt:var name="archive_type" escape="html">"<mt:if name="archive_type_is_preferred">selected="selected"</mt:if>><mt:var name="archive_type_translated" escape="html"></option>
293        <mt:if name="__last__">
294</select>
295        </mt:if>
296    </mt:loop>
297    <mt:unless name="entry_archive_types">
298<p><span class="alert-warning-inline"><__trans phrase="No archives are active"></span></p>
299    </mt:unless>
300</mtapp:setting>
301<mt:unless name="hide_build_option">
302<mtapp:setting
303    id="dynamicity"
304    label="<__trans phrase="Publishing Method">"
305    help_page="blog_settings_publishing"
306    help_section="dynamic_publishing">
307<select name="dynamicity" id="dynamicity" onchange="return toggleDynamicOptions(this)">
308    <option value="none"<mt:if name="dynamic_none"> selected="selected"</mt:if>><__trans phrase="Publish all templates statically"></option>
309    <option value="archives"<mt:if name="dynamic_archives"> selected="selected"</mt:if>><__trans phrase="Publish only Archive Templates dynamically"></option>
310    <option value="custom"<mt:if name="dynamic_custom"> selected="selected"</mt:if>><__trans phrase="Set each template's Publish Options separately"></option>
311    <option value="all"<mt:if name="dynamic_all"> selected="selected"</mt:if>><__trans phrase="Publish all templates dynamically"></option>
312</select>
313
314</mtapp:setting>
315</mt:unless>
316
317<mtapp:setting
318    id="publish_queue"
319    label="<__trans phrase="Use Publishing Queue">"
320    content_class="field-content-text"
321    help_page="blog_settings_publishing"
322    help_section="publish_queue"
323    show_hint="1"
324    hint="<__trans phrase="Requires the use of a cron job to publish pages in the background.">">
325    <input id="publish_queue" type="checkbox" name="publish_queue" value="1"<mt:if name="publish_queue"> checked="checked"</mt:if>> <label for="publish_queue"><__trans phrase="Use background publishing queue for publishing static pages for this blog"></label>
326</mtapp:setting>
327
328<mt:unless name="hide_build_option">
329<div id="dynamic_options_area"<mt:if name="dynamic_none"> style="display:none;"</mt:if>>
330
331    <mtapp:setting
332        id="dynamic_cache"
333        label="<__trans phrase="Enable Dynamic Cache">"
334        hint="<__trans phrase="Turn on caching.">">
335            <input type="checkbox" id="dynamic_cache" name="dynamic_cache" <mt:if name="dynamic_caching">checked="checked"</mt:if>/>
336                <label for="dynamic_cache"><__trans phrase="Enable caching"></label>
337    </mtapp:setting>
338    <mtapp:setting
339        id="dynamic_conditional"
340        label="<__trans phrase="Enable Conditional Retrieval">"
341        hint="<__trans phrase="Turn on conditional retrieval of cached content.">">
342            <input type="checkbox" id="dynamic_conditional" name="dynamic_conditional" <mt:if name="dynamic_conditional">checked="checked"</mt:if>/>
343                <label for="dynamic_conditional"><__trans phrase="Enable conditional retrieval"></label>
344    </mtapp:setting>
345
346</div>
347</mt:unless>
348    <mtapp:setting
349        id="file_extension"
350        label="<__trans phrase="File Extension for Archive Files">"
351        hint="<__trans phrase="Enter the archive file extension. This can take the form of 'html', 'shtml', 'php', etc. Note: Do not enter the leading period ('.').">"
352        help_page="blog_setting_publishing"
353        help_section="archive_file_extension">
354<input name="file_extension" id="file_extension" size="5" value="<mt:var name="file_extension" escape="html">" />
355    </mtapp:setting>
356
357</fieldset>
358
359
360<mt:setvarblock name="action_buttons">
361    <button
362        type="submit"
363        accesskey="s"
364        title="<__trans phrase="Save changes to these settings (s)">"
365        class="primary-button"
366        ><__trans phrase="Save Changes"></button>
367</mt:setvarblock>
368<mt:include name="include/actions_bar.tmpl" bar_position="bottom" hide_pager="1" settings_bar="1">
369</form>
370
371</div>
372
373<mt:include name="include/footer.tmpl">
Note: See TracBrowser for help on using the browser.