droy | ebd025c | 2009-10-08 20:42:48 +0000 | [diff] [blame] | 1 | <script src="js/mapFiles.js" type='text/javascript'></script> |
| 2 | <script src="js/train.js" type='text/javascript'></script> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 3 | <div id="maincontent"> |
| 4 | <div id="midcolumn"> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 5 | <h1><?= $pageTitle ?></h1> |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 6 | <p>Use this form to define the map files or update sites for your project. The map files or update sites are read nightly. Any .properties files except those listed in the plugin exclude patterns will be parsed and imported into Babel, allowing the community to translate the externalized strings.</p> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 7 | <form name="form1" method="post"> |
droy | 82130d3 | 2008-12-17 16:56:46 +0000 | [diff] [blame] | 8 | <table cellspacing=4 cellpadding=0 border=0> |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 9 | <tr><td "width:100px; color:red;"><?= $GLOBALS['g_ERRSTRS'][0] ?></td></tr> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 10 | <tr> |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 11 | <td>Project:</td><td><select name="project_id" onchange="fnSetVersionList();" style="width:100px"> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 12 | <?php |
| 13 | while($myrow = mysql_fetch_assoc($rs_project_list)) { |
| 14 | $selected = ""; |
| 15 | if($myrow['project_id'] == $PROJECT_ID) { |
| 16 | $selected = 'selected="selected"'; |
| 17 | } |
| 18 | echo "<option value='" . $myrow['project_id'] . "' $selected>" . $myrow['project_id'] . "</option>"; |
| 19 | } |
| 20 | ?></select></td> |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 21 | <td style="width:100px; color:red;"><?= $GLOBALS['g_ERRSTRS'][1] ?></td> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 22 | </tr> |
| 23 | <tr> |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 24 | <td>Release Version:</td> |
| 25 | <td><select name="version" onchange="fnUpdateFileList();" style="width:100px"></select> * Indicates map files or update sites present</td> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 26 | <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][4] ?></td> |
| 27 | </tr> |
| 28 | <tr> |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 29 | <td>Release Train:</td> |
| 30 | <td><select name="train_id" style="width:100px"><?php |
droy | 0a2317a | 2008-12-17 16:25:15 +0000 | [diff] [blame] | 31 | while($myrow = mysql_fetch_assoc($rs_train_list)) { |
| 32 | $selected = ""; |
| 33 | if($myrow['train_id'] == $TRAIN_ID) { |
| 34 | $selected = 'selected="selected"'; |
| 35 | } |
| 36 | echo "<option value='" . $myrow['train_id'] . "' $selected>" . $myrow['train_id'] . "</option>"; |
| 37 | } |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 38 | ?></select></td> |
droy | 0a2317a | 2008-12-17 16:25:15 +0000 | [diff] [blame] | 39 | <td></td> |
| 40 | </tr> |
| 41 | <tr> |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 42 | <td>URLs to Map Files or Update Sites:</td> |
| 43 | <td> |
| 44 | <input id="urlType-mapFiles" name="urlType" type="radio" value="mapFiles" checked>Map Files</input> |
| 45 | <input id="urlType-updateSites" name="urlType" type="radio" value="updateSites">Update Sites</input> |
| 46 | </td> |
| 47 | <td style="width:100px; color:red;"><?= $GLOBALS['g_ERRSTRS'][2] ?></td> |
kitlo | e8ed9b2 | 2009-02-24 19:33:37 +0000 | [diff] [blame] | 48 | </tr> |
| 49 | <tr> |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 50 | <td colspan=3><textarea id="files-area" name="fileFld" onclick="fnClickTextFilesArea();" rows=5 cols="100"></textarea></td> |
droy | 0a2317a | 2008-12-17 16:25:15 +0000 | [diff] [blame] | 51 | </tr> |
| 52 | <tr> |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 53 | <td colspan=2>Plugin Exclude Patterns:</td> |
| 54 | <td style="width:100px; color:red;"><?= $GLOBALS['g_ERRSTRS'][2] ?></td> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 55 | </tr> |
| 56 | <tr> |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 57 | <td colspan=3><textarea id="patterns-area" name="patterns" onclick="fnClickTextPatternsArea();" rows="5" cols="100"></textarea></td> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 58 | </tr> |
| 59 | <tr> |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 60 | <td><input type="submit" name="submit" value="Save" style="font-size:14px;" /></td> |
| 61 | <td></td> |
| 62 | <td></td> |
droy | 0cf9cb7 | 2008-07-23 20:55:02 +0000 | [diff] [blame] | 63 | </tr> |
droy | 82130d3 | 2008-12-17 16:56:46 +0000 | [diff] [blame] | 64 | </table> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 65 | </form> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 66 | <script language="javascript"> |
| 67 | function fnSetVersionList() { |
| 68 | document.form1.version.options.length = 0; |
| 69 | |
droy | 80e86bc | 2008-02-04 16:05:41 +0000 | [diff] [blame] | 70 | if(typeof(versions[document.form1.project_id.value]) != "undefined") { |
| 71 | for(i = 0; i < versions[document.form1.project_id.value].length; i++) { |
| 72 | var opt = document.createElement("OPTION"); |
| 73 | document.form1.version.options.add(opt); |
| 74 | document.form1.version.options[i].text = versions[document.form1.project_id.value][i]; |
| 75 | document.form1.version.options[i].value = versions[document.form1.project_id.value][i]; |
| 76 | if(versions[document.form1.project_id.value][i] == "<?= $VERSION ?>") { |
| 77 | document.form1.version.options[i].selected = "selected"; |
| 78 | } |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 79 | } |
| 80 | } |
droy | 80e86bc | 2008-02-04 16:05:41 +0000 | [diff] [blame] | 81 | else { |
| 82 | var opt = document.createElement("OPTION"); |
| 83 | document.form1.version.options.add(opt); |
| 84 | document.form1.version.options[0].text = "unspecified"; |
| 85 | document.form1.version.options[0].value = "unspecified"; |
| 86 | } |
droy | 0a2317a | 2008-12-17 16:25:15 +0000 | [diff] [blame] | 87 | |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 88 | fnUpdateFileList(); |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 89 | } |
droy | 6e22cf5 | 2009-10-09 17:11:49 +0000 | [diff] [blame] | 90 | |
| 91 | function cleanVersion(_value) { |
| 92 | return _value.replace(/^\* /, ""); |
| 93 | } |
| 94 | |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 95 | function fnClickTextFilesArea() { |
| 96 | if(document.form1.fileFld.value.substr(0,12) == "No map files") { |
droy | 6e22cf5 | 2009-10-09 17:11:49 +0000 | [diff] [blame] | 97 | document.form1.fileFld.value = ""; |
| 98 | } |
| 99 | } |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 100 | |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 101 | function fnClickTextPatternsArea() { |
| 102 | if(document.form1.patterns.value.substr(0,26) == "No plugin exclude patterns") { |
| 103 | document.form1.patterns.value = ""; |
| 104 | } |
| 105 | } |
| 106 | |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 107 | function fnUpdateFileList() { |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 108 | var project_id = document.form1.project_id.value; |
| 109 | var version = cleanVersion(document.form1.version.options[document.form1.version.selectedIndex].value); |
| 110 | showMapFiles(project_id, version); |
| 111 | showPluginExcludePatterns(project_id, version); |
| 112 | setUrlType(project_id, version); |
droy | 0a2317a | 2008-12-17 16:25:15 +0000 | [diff] [blame] | 113 | fnSetTrain(); |
| 114 | } |
| 115 | |
| 116 | function fnSetTrain() { |
| 117 | <?# Update train according to selected project/version ?> |
droy | b394abc | 2009-10-19 15:27:15 +0000 | [diff] [blame] | 118 | if(typeof(project_trains[document.form1.project_id.value][cleanVersion(document.form1.version.options[document.form1.version.selectedIndex].value)]) != "undefined") { |
droy | 0a2317a | 2008-12-17 16:25:15 +0000 | [diff] [blame] | 119 | for(i = 0; i < document.form1.train_id.length; i++) { |
| 120 | document.form1.train_id.options[i].selected = ""; |
droy | b394abc | 2009-10-19 15:27:15 +0000 | [diff] [blame] | 121 | if(document.form1.train_id.options[i].value == project_trains[document.form1.project_id.value][cleanVersion(document.form1.version.options[document.form1.version.selectedIndex].value)]) { |
droy | 0a2317a | 2008-12-17 16:25:15 +0000 | [diff] [blame] | 122 | document.form1.train_id.options[i].selected = "selected"; |
| 123 | } |
| 124 | } |
| 125 | } |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 126 | } |
droy | b394abc | 2009-10-19 15:27:15 +0000 | [diff] [blame] | 127 | |
atoulme | dbe670e | 2009-01-27 11:23:51 +0000 | [diff] [blame] | 128 | <?php |
| 129 | global $addon; |
| 130 | echo $addon->callHook('validate_map_file_url'); |
| 131 | ?> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 132 | |
| 133 | var versions = new Array(); |
| 134 | |
| 135 | <?php |
| 136 | $prev_project = ""; |
| 137 | $count = 0; |
| 138 | while($myrow = mysql_fetch_assoc($rs_version_list)) { |
| 139 | if($prev_project != $myrow['project_id']) { |
| 140 | if($count > 0) { |
| 141 | echo "]; |
| 142 | "; |
| 143 | } |
| 144 | echo "versions['" . $myrow['project_id'] . "'] = ["; |
| 145 | $count = 0; |
| 146 | } |
| 147 | if($count > 0) { |
| 148 | echo ","; |
| 149 | } |
droy | 6e22cf5 | 2009-10-09 17:11:49 +0000 | [diff] [blame] | 150 | $str = ""; |
| 151 | if($myrow['map_count'] > 0) { |
| 152 | $str = "* "; |
| 153 | } |
| 154 | |
| 155 | echo "\"$str" . $myrow['version'] . "\""; |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 156 | $count++; |
| 157 | $prev_project = $myrow['project_id']; |
| 158 | } |
| 159 | echo "];"; |
| 160 | ?> |
| 161 | |
droy | 0a2317a | 2008-12-17 16:25:15 +0000 | [diff] [blame] | 162 | |
| 163 | var project_trains = new Array(); |
| 164 | |
| 165 | <?php |
| 166 | $prev_project = ""; |
| 167 | $count = 0; |
| 168 | while($myrow = mysql_fetch_assoc($rs_train_project_list)) { |
| 169 | if($prev_project != $myrow['project_id']) { |
| 170 | if($count > 0) { |
| 171 | echo "}; |
| 172 | "; |
| 173 | } |
| 174 | echo "project_trains['" . $myrow['project_id'] . "'] = {"; |
| 175 | $count = 0; |
| 176 | } |
| 177 | if($count > 0) { |
| 178 | echo ","; |
| 179 | } |
droy | 6e22cf5 | 2009-10-09 17:11:49 +0000 | [diff] [blame] | 180 | |
droy | 0a2317a | 2008-12-17 16:25:15 +0000 | [diff] [blame] | 181 | echo "'" . $myrow['version'] . "' : '" . $myrow['train_id'] . "'"; |
| 182 | $count++; |
| 183 | $prev_project = $myrow['project_id']; |
| 184 | } |
| 185 | echo "};"; |
| 186 | ?> |
| 187 | fnSetVersionList(); |
kitlo | d66aa99 | 2010-01-22 17:18:19 +0000 | [diff] [blame^] | 188 | </script> |