blob: 3c0d812c2078fecaad5235933505fe8b3a36d2d2 [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>
droy0cf9cb72008-07-23 20:55:02 +000036 <td>&#160;</td><td><b>NOTE: </b>If you're defining map files for a Release, you must use the download link to the CVS TAG of that release. This is the pathrev=R3_4 parameter in this example:<br />
37 <a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core.map?view=co&pathrev=R3_4">http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core.map?view=co&pathrev=R3_4</a>
38 </td>
39</tr>
40<tr>
droy8aedeec2008-01-25 19:04:14 +000041 <td>File name: </td><td><input type="text" name="filename" value="<?= $FILENAME ?>" size="32" /></td>
42 <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][5] ?></td>
43</tr>
44
45<tr>
46 <td></td><td><input type="submit" name="submit" value="Save" style="font-size:14px;" /></td></tr>
47 <tr>
48 <td colspan="2"><iframe id="fileShow" name="somefiles" width="100%" height="200"
49 style="border: 1px black solid"
50 src="">
51 </iframe>
52 </td>
53 </tr>
54</table>
55</form>
droy8aedeec2008-01-25 19:04:14 +000056<script language="javascript">
57 function fnSetVersionList() {
58 document.form1.version.options.length = 0;
59
droy80e86bc2008-02-04 16:05:41 +000060 if(typeof(versions[document.form1.project_id.value]) != "undefined") {
61 for(i = 0; i < versions[document.form1.project_id.value].length; i++) {
62 var opt = document.createElement("OPTION");
63 document.form1.version.options.add(opt);
64 document.form1.version.options[i].text = versions[document.form1.project_id.value][i];
65 document.form1.version.options[i].value = versions[document.form1.project_id.value][i];
66 if(versions[document.form1.project_id.value][i] == "<?= $VERSION ?>") {
67 document.form1.version.options[i].selected = "selected";
68 }
droy8aedeec2008-01-25 19:04:14 +000069 }
70 }
droy80e86bc2008-02-04 16:05:41 +000071 else {
72 var opt = document.createElement("OPTION");
73 document.form1.version.options.add(opt);
74 document.form1.version.options[0].text = "unspecified";
75 document.form1.version.options[0].value = "unspecified";
76 }
droy8aedeec2008-01-25 19:04:14 +000077 fnUpdateFileList();
droy8aedeec2008-01-25 19:04:14 +000078 }
79
80 function fnUpdateFileList() {
81 source = "map_files.php?submit=showfiles&project_id=" + document.form1.project_id.value + "&version=" + document.form1.version.options[document.form1.version.selectedIndex].value;
82 document.getElementById("fileShow").src = source;
83 }
84
85 function fnCheckUrl() {
86 if(!document.form1.location.value.match(/view=co/)) {
gobrien1a8e02f2008-01-30 01:46:26 +000087 alert("The ViewCVS URL must contain view=co");
droy8aedeec2008-01-25 19:04:14 +000088 document.form1.submit.disabled = "disabled";
droy8aedeec2008-01-25 19:04:14 +000089 }
90 else {
91 document.form1.submit.disabled = "";
92
93 var re = /\/([A-Za-z0-9_-]+\.map)/;
94 var match = re.exec(document.form1.location.value)
95 document.form1.filename.value = match[1];
96 }
97 }
98
99 var versions = new Array();
100
101<?php
102 $prev_project = "";
103 $count = 0;
104 while($myrow = mysql_fetch_assoc($rs_version_list)) {
105 if($prev_project != $myrow['project_id']) {
106 if($count > 0) {
107 echo "];
108";
109 }
110 echo "versions['" . $myrow['project_id'] . "'] = [";
111 $count = 0;
112 }
113 if($count > 0) {
114 echo ",";
115 }
116 echo "\"" . $myrow['version'] . "\"";
117 $count++;
118 $prev_project = $myrow['project_id'];
119 }
120 echo "];";
121 ?>
122
123 fnSetVersionList();
124 document.form1.submit.disabled = "disabled";
125
126 </script>