blob: cc350067cab974ca250d72a3c68d4cb8220807cb [file] [log] [blame]
droyebd025c2009-10-08 20:42:48 +00001<script src="js/mapFiles.js" type='text/javascript'></script>
2<script src="js/train.js" type='text/javascript'></script>
droy8aedeec2008-01-25 19:04:14 +00003<div id="maincontent">
4<div id="midcolumn">
droy8aedeec2008-01-25 19:04:14 +00005<h1><?= $pageTitle ?></h1>
kitlod66aa992010-01-22 17:18:19 +00006<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>
droy8aedeec2008-01-25 19:04:14 +00007<form name="form1" method="post">
droy82130d32008-12-17 16:56:46 +00008<table cellspacing=4 cellpadding=0 border=0>
kitlod66aa992010-01-22 17:18:19 +00009<tr><td "width:100px; color:red;"><?= $GLOBALS['g_ERRSTRS'][0] ?></td></tr>
droy8aedeec2008-01-25 19:04:14 +000010<tr>
kitlod66aa992010-01-22 17:18:19 +000011 <td>Project:</td><td><select name="project_id" onchange="fnSetVersionList();" style="width:100px">
droy8aedeec2008-01-25 19:04:14 +000012<?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>
kitlod66aa992010-01-22 17:18:19 +000021 <td style="width:100px; color:red;"><?= $GLOBALS['g_ERRSTRS'][1] ?></td>
droy8aedeec2008-01-25 19:04:14 +000022</tr>
23<tr>
kitlod66aa992010-01-22 17:18:19 +000024 <td>Release Version:</td>
25 <td><select name="version" onchange="fnUpdateFileList();" style="width:100px"></select> * Indicates map files or update sites present</td>
droy8aedeec2008-01-25 19:04:14 +000026 <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][4] ?></td>
27</tr>
28<tr>
kitlod66aa992010-01-22 17:18:19 +000029 <td>Release Train:</td>
30 <td><select name="train_id" style="width:100px"><?php
droy0a2317a2008-12-17 16:25:15 +000031 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 }
kitlod66aa992010-01-22 17:18:19 +000038 ?></select></td>
droy0a2317a2008-12-17 16:25:15 +000039 <td></td>
40</tr>
41<tr>
kitlod66aa992010-01-22 17:18:19 +000042 <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>
kitloe8ed9b22009-02-24 19:33:37 +000048</tr>
49<tr>
kitlod66aa992010-01-22 17:18:19 +000050 <td colspan=3><textarea id="files-area" name="fileFld" onclick="fnClickTextFilesArea();" rows=5 cols="100"></textarea></td>
droy0a2317a2008-12-17 16:25:15 +000051</tr>
52<tr>
kitlod66aa992010-01-22 17:18:19 +000053 <td colspan=2>Plugin Exclude Patterns:</td>
54 <td style="width:100px; color:red;"><?= $GLOBALS['g_ERRSTRS'][2] ?></td>
droy8aedeec2008-01-25 19:04:14 +000055</tr>
56<tr>
kitlod66aa992010-01-22 17:18:19 +000057 <td colspan=3><textarea id="patterns-area" name="patterns" onclick="fnClickTextPatternsArea();" rows="5" cols="100"></textarea></td>
droy8aedeec2008-01-25 19:04:14 +000058</tr>
59<tr>
kitlod66aa992010-01-22 17:18:19 +000060 <td><input type="submit" name="submit" value="Save" style="font-size:14px;" /></td>
61 <td></td>
62 <td></td>
droy0cf9cb72008-07-23 20:55:02 +000063</tr>
droy82130d32008-12-17 16:56:46 +000064</table>
droy8aedeec2008-01-25 19:04:14 +000065</form>
droy8aedeec2008-01-25 19:04:14 +000066<script language="javascript">
67 function fnSetVersionList() {
68 document.form1.version.options.length = 0;
69
droy80e86bc2008-02-04 16:05:41 +000070 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 }
droy8aedeec2008-01-25 19:04:14 +000079 }
80 }
droy80e86bc2008-02-04 16:05:41 +000081 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 }
droy0a2317a2008-12-17 16:25:15 +000087
droy8aedeec2008-01-25 19:04:14 +000088 fnUpdateFileList();
droy8aedeec2008-01-25 19:04:14 +000089 }
droy6e22cf52009-10-09 17:11:49 +000090
91 function cleanVersion(_value) {
92 return _value.replace(/^\* /, "");
93 }
94
kitlod66aa992010-01-22 17:18:19 +000095 function fnClickTextFilesArea() {
96 if(document.form1.fileFld.value.substr(0,12) == "No map files") {
droy6e22cf52009-10-09 17:11:49 +000097 document.form1.fileFld.value = "";
98 }
99 }
droy8aedeec2008-01-25 19:04:14 +0000100
kitlod66aa992010-01-22 17:18:19 +0000101 function fnClickTextPatternsArea() {
102 if(document.form1.patterns.value.substr(0,26) == "No plugin exclude patterns") {
103 document.form1.patterns.value = "";
104 }
105 }
106
droy8aedeec2008-01-25 19:04:14 +0000107 function fnUpdateFileList() {
kitlod66aa992010-01-22 17:18:19 +0000108 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);
droy0a2317a2008-12-17 16:25:15 +0000113 fnSetTrain();
114 }
115
116 function fnSetTrain() {
117 <?# Update train according to selected project/version ?>
droyb394abc2009-10-19 15:27:15 +0000118 if(typeof(project_trains[document.form1.project_id.value][cleanVersion(document.form1.version.options[document.form1.version.selectedIndex].value)]) != "undefined") {
droy0a2317a2008-12-17 16:25:15 +0000119 for(i = 0; i < document.form1.train_id.length; i++) {
120 document.form1.train_id.options[i].selected = "";
droyb394abc2009-10-19 15:27:15 +0000121 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)]) {
droy0a2317a2008-12-17 16:25:15 +0000122 document.form1.train_id.options[i].selected = "selected";
123 }
124 }
125 }
droy8aedeec2008-01-25 19:04:14 +0000126 }
droyb394abc2009-10-19 15:27:15 +0000127
atoulmedbe670e2009-01-27 11:23:51 +0000128<?php
129global $addon;
130echo $addon->callHook('validate_map_file_url');
131?>
droy8aedeec2008-01-25 19:04:14 +0000132
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 }
droy6e22cf52009-10-09 17:11:49 +0000150 $str = "";
151 if($myrow['map_count'] > 0) {
152 $str = "* ";
153 }
154
155 echo "\"$str" . $myrow['version'] . "\"";
droy8aedeec2008-01-25 19:04:14 +0000156 $count++;
157 $prev_project = $myrow['project_id'];
158 }
159 echo "];";
160 ?>
161
droy0a2317a2008-12-17 16:25:15 +0000162
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 }
droy6e22cf52009-10-09 17:11:49 +0000180
droy0a2317a2008-12-17 16:25:15 +0000181 echo "'" . $myrow['version'] . "' : '" . $myrow['train_id'] . "'";
182 $count++;
183 $prev_project = $myrow['project_id'];
184 }
185 echo "};";
186 ?>
187 fnSetVersionList();
kitlod66aa992010-01-22 17:18:19 +0000188 </script>