root/branches/release-36/tmpl/cms/cfg_archives.tmpl @ 2127

Revision 2127, 17.2 kB (checked in by takayama, 19 months ago)

Implemented BugId:71811
* When SSI was not PHP, and Dynamic Publishing is enabled, show alert message

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