| 1 | <mt:setvar name="page_title" value="<__trans phrase="Create Blog">"> |
|---|
| 2 | <$mt:setvar name="position_actions_bottom" value="1"$> |
|---|
| 3 | <mt:setvarblock name="related_content"> |
|---|
| 4 | <$mtapp:PageActions$> |
|---|
| 5 | </mt:setvarblock> |
|---|
| 6 | <mt:setvarblock name="system_msg"> |
|---|
| 7 | <mt:if name="error"> |
|---|
| 8 | <mtapp:statusmsg |
|---|
| 9 | id="generic-error" |
|---|
| 10 | class="error"> |
|---|
| 11 | <mt:var name="error"> |
|---|
| 12 | </mtapp:statusmsg> |
|---|
| 13 | </mt:if> |
|---|
| 14 | <mt:if name="saved"> |
|---|
| 15 | <mtapp:statusmsg |
|---|
| 16 | id="saved" |
|---|
| 17 | class="success" |
|---|
| 18 | rebuild="all"> |
|---|
| 19 | <__trans phrase="Your blog configuration has been saved."> |
|---|
| 20 | </mtapp:statusmsg> |
|---|
| 21 | </mt:if> |
|---|
| 22 | </mt:setvarblock> |
|---|
| 23 | <mt:setvarblock name="html_head" append="1"> |
|---|
| 24 | <script type="text/javascript"> |
|---|
| 25 | /* <![CDATA[ */ |
|---|
| 26 | var orig_site_url = "<mt:var name="site_url" _default="$suggested_site_url" escape="js">"; |
|---|
| 27 | var orig_site_path = "<mt:var name="site_path" _default="$suggested_site_path" escape="js">"; |
|---|
| 28 | function dirify_blog_name(fld) { |
|---|
| 29 | var dir_blog_name = dirify(fld.value); |
|---|
| 30 | if (!dir_blog_name.length) return; |
|---|
| 31 | var url = fld.form['site_url']; |
|---|
| 32 | var path = fld.form['site_path']; |
|---|
| 33 | /* detect linux/mac or windows path separator */ |
|---|
| 34 | var slash = orig_site_path.match( /(\\|\/)/ )[ 0 ]; |
|---|
| 35 | var basic_site_url = orig_site_url.replace(/\/BLOG-NAME\/$/, '/'); |
|---|
| 36 | var basic_site_path = orig_site_path.replace(/(\/|\\)BLOG-NAME(\/|\\)?$/, slash); |
|---|
| 37 | if (basic_site_url && (url.value.indexOf(basic_site_url) == 0)) |
|---|
| 38 | url.value = basic_site_url + dir_blog_name + '/'; |
|---|
| 39 | if (basic_site_path && (path.value.indexOf(basic_site_path) == 0)) |
|---|
| 40 | path.value = basic_site_path + dir_blog_name; |
|---|
| 41 | } |
|---|
| 42 | function validate (f) { |
|---|
| 43 | <mt:if name="can_edit_config"> |
|---|
| 44 | if (!f.name.value) { |
|---|
| 45 | alert('<__trans phrase="You must set your Blog Name." escape="singlequotes">'); |
|---|
| 46 | return false; |
|---|
| 47 | } else if (f.server_offset.value == '') { |
|---|
| 48 | alert('<__trans phrase="You did not select a timezone." escape="singlequotes">'); |
|---|
| 49 | return false; |
|---|
| 50 | </mt:if> |
|---|
| 51 | <mt:if name="can_set_publish_paths"> |
|---|
| 52 | <mt:if name="can_edit_config"> |
|---|
| 53 | } else if (!f.site_path.value) { |
|---|
| 54 | <mt:else> |
|---|
| 55 | if (!f.site_path.value) { |
|---|
| 56 | </mt:if> |
|---|
| 57 | alert('<__trans phrase="You must set your Local Site Path." escape="singlequotes">'); |
|---|
| 58 | return false; |
|---|
| 59 | } else if (!f.site_url.value) { |
|---|
| 60 | alert('<__trans phrase="You must set your Site URL." escape="singlequotes">'); |
|---|
| 61 | return false; |
|---|
| 62 | } else if (f.server_offset.value == '') { |
|---|
| 63 | alert('<__trans phrase="You did not select a timezone." escape="singlequotes">'); |
|---|
| 64 | return false; |
|---|
| 65 | } else if (!is_valid_url(f.site_url.value)){ |
|---|
| 66 | alert('<__trans phrase="Your Site URL is not valid." escape="singlequotes">'); |
|---|
| 67 | return false; |
|---|
| 68 | } else if (checkUrlSpaces(f.site_url.value)){ |
|---|
| 69 | alert('<__trans phrase="You can not have spaces in your Site URL." escape="singlequotes">'); |
|---|
| 70 | return false; |
|---|
| 71 | } else if (checkPathSpaces(f.site_path.value)){ |
|---|
| 72 | alert('<__trans phrase="You can not have spaces in your Local Site Path." escape="singlequotes">'); |
|---|
| 73 | return false; |
|---|
| 74 | } else if (!is_valid_path(f.site_path.value)){ |
|---|
| 75 | alert('<__trans phrase="Your Local Site Path is not valid." escape="singlequotes">'); |
|---|
| 76 | return false; |
|---|
| 77 | </mt:if> |
|---|
| 78 | } |
|---|
| 79 | return true; |
|---|
| 80 | } |
|---|
| 81 | function init() { |
|---|
| 82 | <mt:if name="new_object"> |
|---|
| 83 | getByID("name").focus(); |
|---|
| 84 | </mt:if> |
|---|
| 85 | } |
|---|
| 86 | function checkUrlSpaces(url_){ |
|---|
| 87 | if (url_.match(/\s+/)){ |
|---|
| 88 | return true; |
|---|
| 89 | } |
|---|
| 90 | } |
|---|
| 91 | function is_valid_url(url_){ |
|---|
| 92 | return url_.match( /^https?:\/\/[A-Za-z0-9!$%()=_.:,;@~-]+/ ); |
|---|
| 93 | } |
|---|
| 94 | function checkPathSpaces(path_){ |
|---|
| 95 | if (path_.match(/\s+/)){ |
|---|
| 96 | return true; |
|---|
| 97 | } |
|---|
| 98 | } |
|---|
| 99 | function is_valid_path(path_){ |
|---|
| 100 | for(i = 0; i < path_.length; i++){ |
|---|
| 101 | var buf = escape(path_.substr(i, 1)); |
|---|
| 102 | if (buf.match(/^%u.*/)){ |
|---|
| 103 | return false; |
|---|
| 104 | } |
|---|
| 105 | if (buf.match(/(%.{2}){2}?/)){ |
|---|
| 106 | return false; |
|---|
| 107 | } |
|---|
| 108 | } |
|---|
| 109 | return true; |
|---|
| 110 | } |
|---|
| 111 | |
|---|
| 112 | TC.attachLoadEvent(init); |
|---|
| 113 | |
|---|
| 114 | /* ]]> */ |
|---|
| 115 | </script> |
|---|
| 116 | </mt:setvarblock> |
|---|
| 117 | |
|---|
| 118 | <mt:include name="include/header.tmpl"> |
|---|
| 119 | |
|---|
| 120 | <form method="post" action="<mt:var name="script_url">" onsubmit="return validate(this)"> |
|---|
| 121 | <mt:unless name="new_object"> |
|---|
| 122 | <input type="hidden" name="id" value="<mt:var name="id">" /> |
|---|
| 123 | </mt:unless> |
|---|
| 124 | <input type="hidden" name="__mode" value="save" /> |
|---|
| 125 | <input type="hidden" name="_type" value="blog" /> |
|---|
| 126 | <input type="hidden" name="blog_id" value="<mt:var name="blog_id">" /> |
|---|
| 127 | <input type="hidden" name="return_args" value="<mt:var name="return_args" escape="html">" /> |
|---|
| 128 | <input type="hidden" name="magic_token" value="<mt:var name="magic_token">" /> |
|---|
| 129 | |
|---|
| 130 | <fieldset> |
|---|
| 131 | <h3><__trans phrase="Blog Details"></h3> |
|---|
| 132 | <mt:if name="can_edit_config"> |
|---|
| 133 | |
|---|
| 134 | <mtapp:setting |
|---|
| 135 | id="name" |
|---|
| 136 | label="<__trans phrase="Blog Name">" |
|---|
| 137 | hint="<__trans phrase="Name your blog. The blog name can be changed at any time.">" |
|---|
| 138 | help_page="blog_settings_general" |
|---|
| 139 | help_section="blog_name"> |
|---|
| 140 | <input name="name" id="name" value="<mt:var name="name" escape="html">" size="50" onkeyup="dirify_blog_name(this)" /> |
|---|
| 141 | </mtapp:setting> |
|---|
| 142 | <mt:if name="template_set_index"> |
|---|
| 143 | <mtapp:setting |
|---|
| 144 | id="template_set" |
|---|
| 145 | label="<__trans phrase="Template Set">" |
|---|
| 146 | hint="<__trans phrase="Select the templates you wish to use for this new blog.">" |
|---|
| 147 | help_page="blog_settings_general" |
|---|
| 148 | help_section="template_set"> |
|---|
| 149 | <select name="template_set"> |
|---|
| 150 | <mt:loop name="template_set_loop"> |
|---|
| 151 | <option value="<mt:var name="key" escape="html">"<mt:if name="selected"> selected="selected"</mt:if>><mt:var name="label" escape="html"></option> |
|---|
| 152 | </mt:loop> |
|---|
| 153 | </select> |
|---|
| 154 | </mtapp:setting> |
|---|
| 155 | </mt:if> |
|---|
| 156 | </mt:if> |
|---|
| 157 | <mt:if name="can_set_publish_paths"> |
|---|
| 158 | <mtapp:setting |
|---|
| 159 | id="site_url" |
|---|
| 160 | label="<__trans phrase="Site URL">" |
|---|
| 161 | hint="<__trans phrase="Enter the URL of your public website. Do not include a filename (i.e. exclude index.html). Example: http://www.example.com/weblog/">" |
|---|
| 162 | help_page="blog_settings_publishing" |
|---|
| 163 | help_section="site_url"> |
|---|
| 164 | <input name="site_url" id="site_url" value="<mt:var name="site_url" _default="$suggested_site_url" escape="html">" size="50" /> |
|---|
| 165 | </mtapp:setting> |
|---|
| 166 | |
|---|
| 167 | <mtapp:setting |
|---|
| 168 | id="site_path" |
|---|
| 169 | label="<__trans phrase="Site Root">" |
|---|
| 170 | hint="<__trans phrase="Enter the path where your main index file will be located. 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/weblog">" |
|---|
| 171 | help_page="blog_settings_publishing" |
|---|
| 172 | help_section="site_root"> |
|---|
| 173 | <input name="site_path" id="site_path" value="<mt:var name="site_path" _default="$suggested_site_path" escape="html">" size="50" /> |
|---|
| 174 | </mtapp:setting> |
|---|
| 175 | </mt:if> |
|---|
| 176 | <mt:if name="can_edit_config"> |
|---|
| 177 | <mtapp:setting |
|---|
| 178 | id="server_offset" |
|---|
| 179 | label="<__trans phrase="Timezone">" |
|---|
| 180 | hint="<__trans phrase="Select your timezone from the pulldown menu.">" |
|---|
| 181 | help_page="blog_settings_general" |
|---|
| 182 | help_section="blog_timezone"> |
|---|
| 183 | <select name="server_offset" id="server_offset"> |
|---|
| 184 | <option value=""><__trans phrase="Time zone not selected"></option> |
|---|
| 185 | <option value="13"<mt:if name="SERVER_OFFSET_13"> selected="selected"</mt:if>><__trans phrase="UTC+13 (New Zealand Daylight Savings Time)"></option> |
|---|
| 186 | <option value="12"<mt:if name="SERVER_OFFSET_12"> selected="selected"</mt:if>><__trans phrase="UTC+12 (International Date Line East)"></option> |
|---|
| 187 | <option value="11"<mt:if name="SERVER_OFFSET_11"> selected="selected"</mt:if>><__trans phrase="UTC+11"></option> |
|---|
| 188 | <option value="10"<mt:if name="SERVER_OFFSET_10"> selected="selected"</mt:if>><__trans phrase="UTC+10 (East Australian Time)"></option> |
|---|
| 189 | <option value="9.5"<mt:if name="SERVER_OFFSET_9_5"> selected="selected"</mt:if>><__trans phrase="UTC+9.5 (Central Australian Time)"></option> |
|---|
| 190 | <option value="9"<mt:if name="SERVER_OFFSET_9"> selected="selected"</mt:if>><__trans phrase="UTC+9 (Japan Time)"></option> |
|---|
| 191 | <option value="8"<mt:if name="SERVER_OFFSET_8"> selected="selected"</mt:if>><__trans phrase="UTC+8 (China Coast Time)"></option> |
|---|
| 192 | <option value="7"<mt:if name="SERVER_OFFSET_7"> selected="selected"</mt:if>><__trans phrase="UTC+7 (West Australian Time)"></option> |
|---|
| 193 | <option value="6.5"<mt:if name="SERVER_OFFSET_6_5"> selected="selected"</mt:if>><__trans phrase="UTC+6.5 (North Sumatra)"></option> |
|---|
| 194 | <option value="6"<mt:if name="SERVER_OFFSET_6"> selected="selected"</mt:if>><__trans phrase="UTC+6 (Russian Federation Zone 5)"></option> |
|---|
| 195 | <option value="5.5"<mt:if name="SERVER_OFFSET_5_5"> selected="selected"</mt:if>><__trans phrase="UTC+5.5 (Indian)"></option> |
|---|
| 196 | <option value="5"<mt:if name="SERVER_OFFSET_5"> selected="selected"</mt:if>><__trans phrase="UTC+5 (Russian Federation Zone 4)"></option> |
|---|
| 197 | <option value="4"<mt:if name="SERVER_OFFSET_4"> selected="selected"</mt:if>><__trans phrase="UTC+4 (Russian Federation Zone 3)"></option> |
|---|
| 198 | <option value="3.5"<mt:if name="SERVER_OFFSET_3_5"> selected="selected"</mt:if>><__trans phrase="UTC+3.5 (Iran)"></option> |
|---|
| 199 | <option value="3"<mt:if name="SERVER_OFFSET_3"> selected="selected"</mt:if>><__trans phrase="UTC+3 (Baghdad Time/Moscow Time)"></option> |
|---|
| 200 | <option value="2"<mt:if name="SERVER_OFFSET_2"> selected="selected"</mt:if>><__trans phrase="UTC+2 (Eastern Europe Time)"></option> |
|---|
| 201 | <option value="1"<mt:if name="SERVER_OFFSET_1"> selected="selected"</mt:if>><__trans phrase="UTC+1 (Central European Time)"></option> |
|---|
| 202 | <option value="0"<mt:if name="SERVER_OFFSET_0"> selected="selected"</mt:if>><__trans phrase="UTC+0 (Universal Time Coordinated)"></option> |
|---|
| 203 | <option value="-1"<mt:if name="SERVER_OFFSET__1"> selected="selected"</mt:if>><__trans phrase="UTC-1 (West Africa Time)"></option> |
|---|
| 204 | <option value="-2"<mt:if name="SERVER_OFFSET__2"> selected="selected"</mt:if>><__trans phrase="UTC-2 (Azores Time)"></option> |
|---|
| 205 | <option value="-3"<mt:if name="SERVER_OFFSET__3"> selected="selected"</mt:if>><__trans phrase="UTC-3 (Atlantic Time)"></option> |
|---|
| 206 | <option value="-3.5"<mt:if name="SERVER_OFFSET__3_5"> selected="selected"</mt:if>><__trans phrase="UTC-3.5 (Newfoundland)"></option> |
|---|
| 207 | <option value="-4"<mt:if name="SERVER_OFFSET__4"> selected="selected"</mt:if>><__trans phrase="UTC-4 (Atlantic Time)"></option> |
|---|
| 208 | <option value="-5"<mt:if name="SERVER_OFFSET__5"> selected="selected"</mt:if>><__trans phrase="UTC-5 (Eastern Time)"></option> |
|---|
| 209 | <option value="-6"<mt:if name="SERVER_OFFSET__6"> selected="selected"</mt:if>><__trans phrase="UTC-6 (Central Time)"></option> |
|---|
| 210 | <option value="-7"<mt:if name="SERVER_OFFSET__7"> selected="selected"</mt:if>><__trans phrase="UTC-7 (Mountain Time)"></option> |
|---|
| 211 | <option value="-8"<mt:if name="SERVER_OFFSET__8"> selected="selected"</mt:if>><__trans phrase="UTC-8 (Pacific Time)"></option> |
|---|
| 212 | <option value="-9"<mt:if name="SERVER_OFFSET__9"> selected="selected"</mt:if>><__trans phrase="UTC-9 (Alaskan Time)"></option> |
|---|
| 213 | <option value="-10"<mt:if name="SERVER_OFFSET__10"> selected="selected"</mt:if>><__trans phrase="UTC-10 (Aleutians-Hawaii Time)"></option> |
|---|
| 214 | <option value="-11"<mt:if name="SERVER_OFFSET__11"> selected="selected"</mt:if>><__trans phrase="UTC-11 (Nome Time)"></option> |
|---|
| 215 | </select> |
|---|
| 216 | </mtapp:setting> |
|---|
| 217 | </mt:if> |
|---|
| 218 | |
|---|
| 219 | <mt:setvarblock name="action_buttons"> |
|---|
| 220 | <button |
|---|
| 221 | type="submit" |
|---|
| 222 | accesskey="s" |
|---|
| 223 | title="<__trans phrase="Create Blog (s)">" |
|---|
| 224 | class="primary-button" |
|---|
| 225 | ><__trans phrase="Create Blog"></button> |
|---|
| 226 | </mt:setvarblock> |
|---|
| 227 | <mt:include name="include/actions_bar.tmpl" bar_position="bottom" hide_pager="1" settings_bar="1"> |
|---|
| 228 | </fieldset> |
|---|
| 229 | </form> |
|---|
| 230 | |
|---|
| 231 | <mt:include name="include/footer.tmpl"> |
|---|