root/branches/release-34/tmpl/cms/cfg_archives.tmpl @ 1822

Revision 1822, 19.6 kB (checked in by fumiakiy, 20 months ago)

Added Scalar::Util in the list of optional modules in mt-check.cgi. Check and hide appropriately if the required module for Async Job Queue feature is not available. BugId:77208

  • 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<fieldset>
205    <h3><__trans phrase="Publishing Paths"></h3>
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<mt:if name="can_use_publish_queue">
278<fieldset>
279    <h3><__trans phrase="Asynchronous Job Queue"></h3>
280
281<mtapp:setting
282    id="publish_queue"
283    label="<__trans phrase="Use Publishing Queue">"
284    content_class="field-content-text"
285    help_page="blog_settings_publishing"
286    help_section="publish_queue"
287    show_label="0"
288    show_hint="1"
289    hint="<__trans phrase="Requires the use of a cron job to publish pages in the background.">">
290    <input id="publish_queue" type="checkbox" name="publish_queue" value="1" <mt:if name="publish_queue"> checked="checked"</mt:if>/>
291    <label for="publish_queue"><__trans phrase="Use background publishing queue for publishing static pages for this blog"></label>
292</mtapp:setting>
293
294</fieldset>
295</mt:if>
296
297<fieldset>
298    <h3><__trans phrase="Publishing Profile"></h3>
299
300<mtapp:setting
301    id="dynamicity"
302    label="<__trans phrase="Publishing Method">"
303    help_page="blog_settings_publishing"
304    help_section="dynamic_publishing">
305    <ul>
306        <li>
307            <input type="radio" id="dynamicity-sync" name="dynamicity" value="none" <mt:if name="dynamicity" eq="none"> checked="checked"</mt:if>/>
308            <label for="dynamicity-sync"><__trans phrase="Static Publishing"> <span class="hint"><__trans phrase="Publish all files statically."></span></label>
309        </li>
310    <mt:if name="publish_queue">
311        <li>
312            <input type="radio" id="dynamicity-async" name="dynamicity" value="async_all" <mt:if name="dynamicity" eq="async_all"> checked="checked"</mt:if>/>
313            <label for="dynamicity-async"><__trans phrase="Asynchronous Publishing"> <span class="hint"><__trans phrase="Publish all files via the asynchronous job queue."></span></label>
314        </li>
315        <li>
316            <input type="radio" id="dynamicity-partialasync" name="dynamicity" value="async_partial" <mt:if name="dynamicity" eq="async_partial"> checked="checked"</mt:if>/>
317            <label for="dynamicity-partialasync"><__trans phrase="High Priority Static Publishing"> <span class="hint"><__trans phrase="Publish main index template and all individual archive templates statically, and publish all other files asynchronously."></span></label>
318        </li>
319    </mt:if>
320        <li>
321            <input type="radio" id="dynamicity-dynamic" name="dynamicity" value="all" <mt:if name="dynamicity" eq="all"> checked="checked"</mt:if>/>
322            <label for="dynamicity-dynamic"><__trans phrase="Dynamic Publishing"> <span class="hint"><__trans phrase="Publish all files dynamically."></span></label>
323        </li>
324        <li>
325            <input type="radio" id="dynamicity-archives" name="dynamicity" value="archives" <mt:if name="dynamicity" eq="archives"> checked="checked"</mt:if>/>
326            <label for="dynamicity-archives"><__trans phrase="Dynamic Archives Only"> <span class="hint"><__trans phrase="Publish all archives dynamically. Publish all other files statically."></span></label>
327        </li>
328        <li>
329            <input type="radio" id="dynamicity-custom" name="dynamicity" value="custom" <mt:if name="dynamicity" eq="custom"> checked="checked"</mt:if>/>
330            <label for="dynamicity-custom"><__trans phrase="Custom"> <span class="hint"><__trans phrase="Publishing options are configured on a template-by-template basis."></span></label>
331        </li>
332    </ul>
333</mtapp:setting>
334
335<mt:unless name="hide_build_option">
336<div id="dynamic_options_area"<mt:if name="dynamic_none"> style="display:none;"</mt:if>>
337
338    <mtapp:setting
339        id="dynamic_publishing_options"
340        label="<__trans phrase="Dynamic Publishing Options">">
341        <ul>
342            <li>
343                <input type="checkbox" id="dynamic_cache" name="dynamic_cache" <mt:if name="dynamic_caching">checked="checked"</mt:if>/>
344                <label for="dynamic_cache"><__trans phrase="Enable dynamic cache"></label>
345            </li>
346            <li>
347                <input type="checkbox" id="dynamic_conditional" name="dynamic_conditional" <mt:if name="dynamic_conditional">checked="checked"</mt:if>/>
348                <label for="dynamic_conditional"><__trans phrase="Enable conditional retrieval"></label>
349            </li>
350        </ul>
351    </mtapp:setting>
352
353</div>
354</mt:unless>
355
356</fieldset>
357
358<fieldset>
359    <h3><__trans phrase="Archive Options"></h3>
360
361<mtapp:setting
362    id="file_extension"
363    label="<__trans phrase="File Extension">"
364    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 ('.').">"
365    help_page="blog_setting_publishing"
366    help_section="archive_file_extension">
367    <input name="file_extension" id="file_extension" size="5" value="<mt:var name="file_extension" escape="html">" />
368</mtapp:setting>
369
370<mtapp:setting
371    id="preferred_archive_type"
372    label="<__trans phrase="Preferred Archive">"
373    hint="<__trans phrase="Used for creating links to an archived entry (permalink). Select from the archive types used in this blogs archive templates.">"
374    show_hint="1"
375    help_page="blog_settings_publishing"
376    help_section="preferred_archive_type">
377
378    <mt:loop name="entry_archive_types">
379        <mt:if name="__first__">
380    <select name="preferred_archive_type" id="preferred_archive_type">
381        </mt:if>
382        <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>
383        <mt:if name="__last__">
384    </select>
385        </mt:if>
386    </mt:loop>
387    <mt:unless name="entry_archive_types">
388    <p><span class="alert-warning-inline"><__trans phrase="No archives are active"></span></p>
389    </mt:unless>
390</mtapp:setting>
391
392</fieldset>
393
394<fieldset>
395    <h3><__trans phrase="Module Options"></h3>
396
397<mtapp:setting
398    id="include_cache"
399    label="<__trans phrase="Module Caching">"
400    content_class="field-content-text"
401    help_page="blog_settings_publishing"
402    help_section="include_cache">
403    <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>
404</mtapp:setting>
405
406<mtapp:setting
407    id="ssi"
408    label="<__trans phrase="Server Side Includes">"
409    content_class="field-content-text"
410    help_page="blog_settings_publishing"
411    help_section="ssi">
412    <select name="include_system">
413      <option value=""<mt:unless name="include_system"> selected="selected"</mt:unless>><__trans phrase="None (disabled)"></option>
414      <option value="php"<mt:if name="include_system" eq="php"> selected="selected"</mt:if>><__trans phrase="PHP Includes"></option>
415      <option value="shtml"<mt:if name="include_system" eq="shtml"> selected="selected"</mt:if>><__trans phrase="Apache Server-Side Includes"></option>
416      <option value="asp"<mt:if name="include_system" eq="asp"> selected="selected"</mt:if>><__trans phrase="Active Server Page Includes"></option>
417      <option value="jsp"<mt:if name="include_system" eq="jsp"> selected="selected"</mt:if>><__trans phrase="Java Server Page Includes"></option>
418    </select>
419</mtapp:setting>
420
421</fieldset>
422
423
424<mt:setvarblock name="action_buttons">
425    <button
426        type="submit"
427        accesskey="s"
428        title="<__trans phrase="Save changes to these settings (s)">"
429        class="primary-button"
430        ><__trans phrase="Save Changes"></button>
431</mt:setvarblock>
432<mt:include name="include/actions_bar.tmpl" bar_position="bottom" hide_pager="1" settings_bar="1">
433</form>
434
435</div>
436
437<mt:include name="include/footer.tmpl">
Note: See TracBrowser for help on using the browser.