| 1 | <$mt:setvar name="page_title" value="<__trans phrase="Confirm Publishing Configuration">"$> |
|---|
| 2 | <$mt:setvar name="screen_type" value="restore-confirm-publishing-config"$> |
|---|
| 3 | <mt:setvarblock name="html_head" append="1"> |
|---|
| 4 | <script type="text/javascript"> |
|---|
| 5 | /* <![CDATA[ */ |
|---|
| 6 | function validate (f) { |
|---|
| 7 | var items = TC.getElementsByClassName('path_field'); |
|---|
| 8 | for (var i = 0; i < items.length; ++i) { |
|---|
| 9 | if ((items[i].name.match(/_url/)) && ('' != items[i].value)) { |
|---|
| 10 | if (!is_valid_url(items[i].value)) { |
|---|
| 11 | alert('<__trans phrase="URL is not valid." escape="singlequotes">'); |
|---|
| 12 | return false; |
|---|
| 13 | } else if (checkUrlSpaces(items[i].value)){ |
|---|
| 14 | alert('<__trans phrase="You can not have spaces in the URL." escape="singlequotes">'); |
|---|
| 15 | return false; |
|---|
| 16 | } |
|---|
| 17 | } else if ((items[i].name.match(/_path/)) && ('' != items[i].value)) { |
|---|
| 18 | if (checkPathSpaces(items[i].value)){ |
|---|
| 19 | alert('<__trans phrase="You can not have spaces in the path." escape="singlequotes">'); |
|---|
| 20 | return false; |
|---|
| 21 | } else if (!is_valid_path(items[i].value)){ |
|---|
| 22 | alert('<__trans phrase="Path is not valid." escape="singlequotes">'); |
|---|
| 23 | return false; |
|---|
| 24 | } |
|---|
| 25 | } |
|---|
| 26 | } |
|---|
| 27 | return true; |
|---|
| 28 | } |
|---|
| 29 | function checkUrlSpaces(url_){ |
|---|
| 30 | if (url_.match(/\s+/)){ |
|---|
| 31 | return true; |
|---|
| 32 | } |
|---|
| 33 | } |
|---|
| 34 | function is_valid_url(url_){ |
|---|
| 35 | return url_.match( /^https?:\/\/[A-Za-z0-9!$%()=_.:,;@~-]+/ ); |
|---|
| 36 | } |
|---|
| 37 | function checkPathSpaces(path_){ |
|---|
| 38 | if (path_.match(/\s+/)){ |
|---|
| 39 | return true; |
|---|
| 40 | } |
|---|
| 41 | } |
|---|
| 42 | function is_valid_path(path_){ |
|---|
| 43 | for(i = 0; i < path_.length; i++){ |
|---|
| 44 | var buf = escape(path_.substr(i, 1)); |
|---|
| 45 | if (buf.match(/^%u.*/)){ |
|---|
| 46 | return false; |
|---|
| 47 | } |
|---|
| 48 | if (buf.match(/(%.{2}){2}?/)){ |
|---|
| 49 | return false; |
|---|
| 50 | } |
|---|
| 51 | } |
|---|
| 52 | return true; |
|---|
| 53 | } |
|---|
| 54 | /* ]]> */ |
|---|
| 55 | </script> |
|---|
| 56 | </mt:setvarblock> |
|---|
| 57 | <mt:include name="dialog/header.tmpl"> |
|---|
| 58 | <form name="adjust_sitepath" id="adjust_sitepath" method="post" action="<mt:var name="script_url">" onsubmit="return validate(this)"> |
|---|
| 59 | <input type="hidden" name="__mode" value="adjust_sitepath" /> |
|---|
| 60 | <input type="hidden" name="magic_token" value="<mt:var name="magic_token">" /> |
|---|
| 61 | <input type="hidden" name="tmp_dir" value="<mt:var name="tmp_dir" escape="html">" /> |
|---|
| 62 | <input type="hidden" name="restore_upload" value="<mt:var name="restore_upload">" /> |
|---|
| 63 | <input type="hidden" name="error" value="<mt:var name="error" escape="html">" /> |
|---|
| 64 | <input type="hidden" name="asset_ids" value="<mt:var name="asset_ids">" /> |
|---|
| 65 | <input type="hidden" name="files" value="<mt:var name="files">" /> |
|---|
| 66 | <input type="hidden" name="assets" value="<mt:var name="assets" escape="html">" /> |
|---|
| 67 | <input type="hidden" name="current_file" value="<mt:var name="name">" /> |
|---|
| 68 | <input type="hidden" name="last" value="<mt:var name="last">" /> |
|---|
| 69 | <input type="hidden" name="redirect" value="<mt:var name="redirect">" /> |
|---|
| 70 | <input type="hidden" name="is_dirty" value="<mt:var name="is_dirty">" /> |
|---|
| 71 | <input type="hidden" name="is_asset" value="<mt:var name="is_asset">" /> |
|---|
| 72 | <input type="hidden" name="objects_json" value="<mt:var name="objects_json" escape="html">" /> |
|---|
| 73 | <input type="hidden" name="deferred_json" value="<mt:var name="deferred_json" escape="html">" /> |
|---|
| 74 | <input type="hidden" name="blogs_meta" value="<mt:var name="blogs_meta" escape="html">" /> |
|---|
| 75 | |
|---|
| 76 | <div class="restore-publishing-paths"> |
|---|
| 77 | <mt:loop name="blogs_loop"> |
|---|
| 78 | <fieldset> |
|---|
| 79 | <h3><$mt:var name="name" escape="html"$> (<$mt:var name="id"$>)</h3> |
|---|
| 80 | <mtapp:setting |
|---|
| 81 | id="site_path" |
|---|
| 82 | label="Site Path"> |
|---|
| 83 | <mt:if name="old_site_path"> |
|---|
| 84 | <input type="hidden" name="old_site_path_<mt:var name="id">" id="old_site_path_<mt:var name="id">" value="<mt:var name="old_site_path" escape="html">" /> |
|---|
| 85 | </mt:if> |
|---|
| 86 | <div class="textarea-wrapper"> |
|---|
| 87 | <input name="site_path_<mt:var name="id">" id="site_path_<mt:var name="id">" class="path_field full-width" value="<$mt:var name="old_site_path" escape="html"$>" /> |
|---|
| 88 | </div> |
|---|
| 89 | </mtapp:setting> |
|---|
| 90 | <mtapp:setting |
|---|
| 91 | id="site_url" |
|---|
| 92 | label="Site URL"> |
|---|
| 93 | <mt:if name="old_site_url"> |
|---|
| 94 | <input type="hidden" name="old_site_url_<mt:var name="id">" id="old_site_url_<mt:var name="id">" value="<mt:var name="old_site_url" escape="html">" /> |
|---|
| 95 | </mt:if> |
|---|
| 96 | <div class="textarea-wrapper"> |
|---|
| 97 | <input name="site_url_<mt:var name="id">" id="site_url_<mt:var name="id">" class="site_url full-width" value="<mt:var name="old_site_url" escape="html">" /> |
|---|
| 98 | </div> |
|---|
| 99 | </mtapp:setting> |
|---|
| 100 | <mt:if name="old_archive_path"> |
|---|
| 101 | <mtapp:setting |
|---|
| 102 | id="archive_path" |
|---|
| 103 | label="Archive Path"> |
|---|
| 104 | <input type="hidden" name="old_archive_path_<mt:var name="id">" id="old_archive_path_<mt:var name="id">" value="<mt:var name="old_archive_path" escape="html">" /> |
|---|
| 105 | <div class="textarea-wrapper"> |
|---|
| 106 | <input name="archive_path_<mt:var name="id">" id="archive_path_<mt:var name="id">" class="path_field full-width" value="<mt:var name="old_archive_path" escape="html">" /> |
|---|
| 107 | </div> |
|---|
| 108 | </mtapp:setting> |
|---|
| 109 | </mt:if> |
|---|
| 110 | <mt:if name="old_archive_url"> |
|---|
| 111 | <mtapp:setting |
|---|
| 112 | id="archive_url" |
|---|
| 113 | label="<__trans phrase="Archive URL">"> |
|---|
| 114 | <input type="hidden" name="old_archive_url_<mt:var name="id">" id="old_archive_url_<mt:var name="id">" value="<mt:var name="old_archive_url" escape="html">" /> |
|---|
| 115 | <div class="textarea-wrapper"> |
|---|
| 116 | <input name="archive_url_<mt:var name="id">" id="archive_url_<mt:var name="id">" class="archive_url full-width" value="<mt:var name="old_archive_url" escape="html">" /> |
|---|
| 117 | </div> |
|---|
| 118 | </mtapp:setting> |
|---|
| 119 | </mt:if> |
|---|
| 120 | </fieldset> |
|---|
| 121 | </mt:loop> |
|---|
| 122 | </div> |
|---|
| 123 | <div class="actions-bar"> |
|---|
| 124 | <div class="actions-bar-inner pkg actions"> |
|---|
| 125 | <button |
|---|
| 126 | value="<__trans phrase="Continue">" |
|---|
| 127 | type="submit" |
|---|
| 128 | accesskey="s" |
|---|
| 129 | title="<__trans phrase="Continue (s)">" |
|---|
| 130 | class="primary-button" |
|---|
| 131 | ><__trans phrase="Continue"></button> |
|---|
| 132 | </div> |
|---|
| 133 | </div> |
|---|
| 134 | </form> |
|---|
| 135 | |
|---|
| 136 | <mt:include name="dialog/footer.tmpl"> |
|---|