blob: aae3056a21cf4df93091b1dab558b756548e5f0c [file] [log] [blame]
droy8aedeec2008-01-25 19:04:14 +00001<div id="maincontent">
2<div id="midcolumn">
3
4<h1><?= $pageTitle ?></h1>
droy4e8fc0e2008-02-04 14:42:30 +00005<p>Use this form to define the map files for your project. The map files are read nightly, and any .properties files (except build.properties) contained in the plugins they reference will be parsed and imported into Babel, allowing the community to translate the externalized strings.</p>
6<p>This page is only accessible by Eclipse committers.</p>
droy8aedeec2008-01-25 19:04:14 +00007<form name="form1" method="post">
8<table cellspacing=4 cellpadding=0 border=0 width="950">
9<tr><td></td><td colspan=2 style="color:red;"><?= $GLOBALS['g_ERRSTRS'][0] ?></td></tr>
10<tr>
11 <td>Project:</td><td><select name="project_id" onchange="fnSetVersionList();">
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>
21 <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][1] ?></td>
22</tr>
23<tr>
24 <td>Release Version</td><td><select name="version" onchange="fnUpdateFileList();">
25</select></td>
26 <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][4] ?></td>
27</tr>
28<tr>
gobrien1a8e02f2008-01-30 01:46:26 +000029 <td><a href="http://dev.eclipse.org/viewcvs/index.cgi">ViewCVS</a> download URL to map file:</td><td><input type="text" name="location" value="<?= $LOCATION ?>" size="80" onchange="fnCheckUrl();" /></td>
droy8aedeec2008-01-25 19:04:14 +000030 <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][2] ?></td>
31</tr>
32<tr>
33 <td>&#160;</td><td>e.g. <a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core.map?view=co">http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core.map?view=co</a></td>
34</tr>
35<tr>
36 <td>File name: </td><td><input type="text" name="filename" value="<?= $FILENAME ?>" size="32" /></td>
37 <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][5] ?></td>
38</tr>
39
40<tr>
41 <td></td><td><input type="submit" name="submit" value="Save" style="font-size:14px;" /></td></tr>
42 <tr>
43 <td colspan="2"><iframe id="fileShow" name="somefiles" width="100%" height="200"
44 style="border: 1px black solid"
45 src="">
46 </iframe>
47 </td>
48 </tr>
49</table>
50</form>
droy8aedeec2008-01-25 19:04:14 +000051<script language="javascript">
52 function fnSetVersionList() {
53 document.form1.version.options.length = 0;
54
droy80e86bc2008-02-04 16:05:41 +000055 if(typeof(versions[document.form1.project_id.value]) != "undefined") {
56 for(i = 0; i < versions[document.form1.project_id.value].length; i++) {
57 var opt = document.createElement("OPTION");
58 document.form1.version.options.add(opt);
59 document.form1.version.options[i].text = versions[document.form1.project_id.value][i];
60 document.form1.version.options[i].value = versions[document.form1.project_id.value][i];
61 if(versions[document.form1.project_id.value][i] == "<?= $VERSION ?>") {
62 document.form1.version.options[i].selected = "selected";
63 }
droy8aedeec2008-01-25 19:04:14 +000064 }
65 }
droy80e86bc2008-02-04 16:05:41 +000066 else {
67 var opt = document.createElement("OPTION");
68 document.form1.version.options.add(opt);
69 document.form1.version.options[0].text = "unspecified";
70 document.form1.version.options[0].value = "unspecified";
71 }
droy8aedeec2008-01-25 19:04:14 +000072 fnUpdateFileList();
droy8aedeec2008-01-25 19:04:14 +000073 }
74
75 function fnUpdateFileList() {
76 source = "map_files.php?submit=showfiles&project_id=" + document.form1.project_id.value + "&version=" + document.form1.version.options[document.form1.version.selectedIndex].value;
77 document.getElementById("fileShow").src = source;
78 }
79
80 function fnCheckUrl() {
81 if(!document.form1.location.value.match(/view=co/)) {
gobrien1a8e02f2008-01-30 01:46:26 +000082 alert("The ViewCVS URL must contain view=co");
droy8aedeec2008-01-25 19:04:14 +000083 document.form1.submit.disabled = "disabled";
droy8aedeec2008-01-25 19:04:14 +000084 }
85 else {
86 document.form1.submit.disabled = "";
87
88 var re = /\/([A-Za-z0-9_-]+\.map)/;
89 var match = re.exec(document.form1.location.value)
90 document.form1.filename.value = match[1];
91 }
92 }
93
94 var versions = new Array();
95
96<?php
97 $prev_project = "";
98 $count = 0;
99 while($myrow = mysql_fetch_assoc($rs_version_list)) {
100 if($prev_project != $myrow['project_id']) {
101 if($count > 0) {
102 echo "];
103";
104 }
105 echo "versions['" . $myrow['project_id'] . "'] = [";
106 $count = 0;
107 }
108 if($count > 0) {
109 echo ",";
110 }
111 echo "\"" . $myrow['version'] . "\"";
112 $count++;
113 $prev_project = $myrow['project_id'];
114 }
115 echo "];";
116 ?>
117
118 fnSetVersionList();
119 document.form1.submit.disabled = "disabled";
120
121 </script>