root/trunk/tmpl/cms/cfg_archives.tmpl @ 3082

Revision 3082, 17.8 kB (checked in by bchoate, 14 months ago)

Merging fireball branch changes to-date to trunk: svn merge -r2974:3081 http://code.sixapart.com/svn/movabletype/branches/fireball .

  • 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
92    <mt:if name="warning_include">
93        <mtapp:statusmsg
94            id="warning_include"
95            class="alert">
96            <__trans phrase="Warning: one or more of your templates is set to publish dynamically using PHP, however your server side include method may not be compatible with dynamic publishing.">
97        </mtapp:statusmsg>
98   </mt:if>
99</mt:setvarblock>
100<mt:setvarblock name="content_nav">
101    <mt:include name="include/cfg_content_nav.tmpl">
102</mt:setvarblock>
103<mt:setvarblock name="html_head" append="1">
104<script type="text/javascript" src="<mt:var name="static_uri">js/tc/client.js"></script>
105<script type="text/javascript">
106/* <![CDATA[ */
107function validate (f) {
108    if (!f.site_path.value) {
109        alert('<__trans phrase="You must set your Local Site Path." escape="singlequotes">');
110        return false;
111    } else if (!is_valid_url(f.site_url.value)){
112        alert('<__trans phrase="You must set a valid Site URL." escape="singlequotes">');
113        return false;
114    } else if (!is_valid_path(f.site_path.value)){
115        alert('<__trans phrase="You must set a valid Local Site Path." escape="singlequotes">');
116        return false;
117    }
118    if (f.enable_archive_paths.checked) {
119        if (!f.archive_path.value) {
120            alert('<__trans phrase="You must set Local Archive Path." escape="singlequotes">');
121            return false;
122        } else if (!is_valid_url(f.archive_url.value)){
123            alert('<__trans phrase="You must set a valid Archive URL." escape="singlequotes">');
124            return false;
125        } else if (!is_valid_path(f.archive_path.value)){
126            alert('<__trans phrase="You must set a valid Local Archive Path." escape="singlequotes">');
127            return false;
128        }
129    }
130    f.site_url.disabled = false;
131    f.site_path.disabled = false;
132    f.archive_path.disabled = false;
133    f.archive_url.disabled = false;
134    return true;
135}
136function is_valid_url(url_){
137    return url_.match( /^https?:\/\/[A-Za-z0-9!$%()=_.:,;@~-]+/ );
138}
139function is_valid_path(path_){
140    var str = path_.replace(/[ "%<>\[\\\]\^`{\|}~]/g, "");
141    str = encodeURI(str);
142    if (str.indexOf('%') != -1) {
143        return false;
144    }
145    if (str.match(/\.\./)) {
146        return false;
147    }
148    return true;
149}
150
151function disableFields(path1,path2) {
152    var url_is = "<mt:var name="site_url" encode_js="1">";
153    var path_is = "<mt:var name="site_path" encode_js="1">";
154    if (url_is.match(/BLOG-NAME/)) {
155        var daURL = getByID(path1);
156        var lock = path1 +"-lock";
157        var lock_img = getByID(lock);
158        daURL.disabled = false;
159        lock_img.style.display = 'none';
160    }
161    if (path_is.match(/BLOG-NAME/)) {
162        var daPath = getByID(path2);
163        var lock = path2 +"-lock";
164        var lock_img = getByID(lock);
165        daPath.disabled = false;
166        lock_img.style.display = 'none';
167    }
168    return;
169}
170
171function toggleFile(path) {
172    var fld = getByID(path);
173    if (fld) {
174        fld.disabled = false;
175        fld.focus();
176        var which_warning = path + "-warning";
177        var urlwarn = getByID(which_warning);
178        if (urlwarn) urlwarn.style.display = "block";
179    }
180    var which_lock = path + "-lock";
181    var img = getByID(which_lock);
182    if (img)
183        img.style.display = 'none';
184    return false;
185}
186
187function init() {
188    // conditionally disables
189    disableFields('site_url','site_path');
190}
191
192TC.attachLoadEvent( init );
193/* ]]> */
194</script>
195</mt:setvarblock>
196
197<mt:include name="include/header.tmpl">
198
199<div id="cfg-archives">
200
201<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>>
202<input type="hidden" name="blog_id" value="<mt:var name="blog_id">" />
203<input type="hidden" name="__mode" value="save" />
204<input type="hidden" name="_type" value="blog" />
205<input type="hidden" name="id" value="<mt:var name="blog_id">" />
206<input type="hidden" name="cfg_screen" value="cfg_archives" />
207<input type="hidden" name="return_args" value="<mt:var name="return_args" escape="html">" />
208<input type="hidden" name="magic_token" value="<mt:var name="magic_token">" />
209
210<mt:if name="can_set_publish_paths">
211<fieldset>
212    <h3><__trans phrase="Publishing Paths"></h3>
213
214    <mtapp:setting
215        id="site_url"
216        label="<__trans phrase="Site URL">"
217        hint="<__trans phrase="The URL of your website. Do not include a filename (i.e. exclude index.html). Example: http://www.example.com/blog/">"
218        show_hint="1"
219        help_page="blog_settings_publishing"
220        help_section="site_url">
221        <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>
222
223        <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>
224    </mtapp:setting>
225
226    <mtapp:setting
227        id="site_path"
228        label="<__trans phrase="Site Root">"
229        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">"
230        show_hint="1"
231        help_page="blog_settings_publishing"
232        help_section="site_root">
233        <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>
234
235        <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>
236    </mtapp:setting>
237
238    <mtapp:setting
239        id="enable_archive_paths"
240        label="<__trans phrase="Advanced Archive Publishing">"
241        content_class="field-content-text"
242        show_label="0"
243        hint="<__trans phrase="Select this option only if you need to publish your archives outside of your Site Root.">"
244        help_page="blog_settings_publishing"
245        help_section="advanced_archive_publishing">
246            <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" /> <label for="enable_archive_paths"><__trans phrase="Publish archives outside of Site Root"></label>
247    </mtapp:setting>
248
249    <div id="enable_archive_paths_prefs"<mt:unless name="enable_archive_paths"> class="hidden"</mt:unless>>
250
251    <mtapp:setting
252        id="archive_url"
253        label="<__trans phrase="Archive URL">"
254        hint="<__trans phrase="Enter the URL of the archives section of your website. Example: http://archives.example.com/">"
255        show_hint="1"
256        help_page="blog_settings_publishing"
257        help_section="archive_url">
258        <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" />
259        <mt:if name="archive_url">
260            <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>
261            <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>
262        </mt:if>
263    </mtapp:setting>
264
265    <mtapp:setting
266        id="archive_path"
267        label="<__trans phrase="Archive Root">"
268        hint="<__trans phrase="Enter the path where your archive files will be published. Example: /home/melody/public_html/archives">"
269        show_hint="1"
270        help_page="blog_settings_publishing"
271        help_section="archive_path">
272            <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" />
273            <mt:if name="archive_path">
274                <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>
275                <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>
276            </mt:if>
277    </mtapp:setting>
278
279    </div>
280
281</fieldset>
282</mt:if>
283
284<mt:ignore>
285    <!-- to be enabled at a later date -->
286
287<mt:if name="can_use_publish_queue">
288
289<fieldset>
290    <h3><__trans phrase="Asynchronous Job Queue"></h3>
291
292<mtapp:setting
293    id="publish_queue"
294    label="<__trans phrase="Use Publishing Queue">"
295    content_class="field-content-text"
296    help_page="blog_settings_publishing"
297    help_section="publish_queue"
298    show_label="0"
299    show_hint="1"
300    hint="<__trans phrase="Requires the use of a cron job to publish pages in the background.">">
301    <input id="publish_queue" type="checkbox" name="publish_queue" value="1" <mt:if name="publish_queue"> checked="checked"</mt:if>/>
302    <label for="publish_queue"><__trans phrase="Use background publishing queue for publishing static pages for this blog"></label>
303</mtapp:setting>
304
305</fieldset>
306
307</mt:if>
308
309</mt:ignore>
310
311
312<mt:unless name="hide_build_option">
313<mt:if name="dynamic_enabled">
314<fieldset>
315    <h3><__trans phrase="Dynamic Publishing Options"></h3>
316
317    <mtapp:setting
318        id="dynamic_publishing_options"
319        label="<__trans phrase="Dynamic Publishing Options">"
320        show_label="0">
321    <ul>
322        <li>
323            <input type="checkbox" id="dynamic_cache" name="dynamic_cache" <mt:if name="dynamic_caching">checked="checked"</mt:if>/>
324            <label for="dynamic_cache"><__trans phrase="Enable dynamic cache"></label>
325        </li>
326        <li>
327            <input type="checkbox" id="dynamic_conditional" name="dynamic_conditional" <mt:if name="dynamic_conditional">checked="checked"</mt:if>/>
328            <label for="dynamic_conditional"><__trans phrase="Enable conditional retrieval"></label>
329        </li>
330    </ul>
331    </mtapp:setting>
332
333</fieldset>
334</mt:if>
335</mt:unless>
336
337<fieldset>
338    <h3><__trans phrase="Archive Options"></h3>
339
340<mtapp:setting
341    id="file_extension"
342    label="<__trans phrase="File Extension">"
343    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 ('.').">"
344    help_page="blog_setting_publishing"
345    help_section="archive_file_extension">
346    <input name="file_extension" id="file_extension" size="5" value="<mt:var name="file_extension" escape="html">" />
347</mtapp:setting>
348
349<mtapp:setting
350    id="preferred_archive_type"
351    label="<__trans phrase="Preferred Archive">"
352    hint="<__trans phrase="Used for creating links to an archived entry (permalink). Select from the archive types used in this blogs archive templates.">"
353    show_hint="1"
354    help_page="blog_settings_publishing"
355    help_section="preferred_archive_type">
356
357    <mt:loop name="entry_archive_types">
358        <mt:if name="__first__">
359    <select name="preferred_archive_type" id="preferred_archive_type">
360        </mt:if>
361        <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>
362        <mt:if name="__last__">
363    </select>
364        </mt:if>
365    </mt:loop>
366    <mt:unless name="entry_archive_types">
367    <p><span class="alert-warning-inline"><__trans phrase="No archives are active"></span></p>
368    </mt:unless>
369</mtapp:setting>
370
371</fieldset>
372
373<fieldset>
374    <h3><__trans phrase="Module Options"></h3>
375
376<mtapp:setting
377    id="include_cache"
378    label="<__trans phrase="Module Caching">"
379    content_class="field-content-text"
380    help_page="blog_settings_publishing"
381    help_section="include_cache">
382    <input id="include_cache" type="checkbox" name="include_cache" value="1"<mt:if name="include_cache"> checked="checked"</mt:if>/> <label for="include_cache"><__trans phrase="Enable template module caching"></label>
383</mtapp:setting>
384
385<mtapp:setting
386    id="include_system"
387    label="<__trans phrase="Server Side Includes">"
388    content_class="field-content-text"
389    help_page="blog_settings_publishing"
390    help_section="ssi">
391    <select id="include_system" name="include_system">
392      <option value=""<mt:unless name="include_system"> selected="selected"</mt:unless>><__trans phrase="None (disabled)"></option>
393      <option value="php"<mt:if name="include_system" eq="php"> selected="selected"</mt:if>><__trans phrase="PHP Includes"></option>
394      <option value="shtml"<mt:if name="include_system" eq="shtml"> selected="selected"</mt:if>><__trans phrase="Apache Server-Side Includes"></option>
395      <option value="asp"<mt:if name="include_system" eq="asp"> selected="selected"</mt:if>><__trans phrase="Active Server Page Includes"></option>
396      <option value="jsp"<mt:if name="include_system" eq="jsp"> selected="selected"</mt:if>><__trans phrase="Java Server Page Includes"></option>
397    </select>
398</mtapp:setting>
399
400</fieldset>
401
402
403<mt:setvarblock name="action_buttons">
404    <button
405        type="submit"
406        accesskey="s"
407        title="<__trans phrase="Save changes to these settings (s)">"
408        class="primary-button"
409        ><__trans phrase="Save Changes"></button>
410</mt:setvarblock>
411<mt:include name="include/actions_bar.tmpl" bar_position="bottom" hide_pager="1" settings_bar="1">
412</form>
413
414</div>
415
416<mt:include name="include/footer.tmpl">
Note: See TracBrowser for help on using the browser.