droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 1 | <div id="maincontent"> |
| 2 | <div id="midcolumn"> |
| 3 | |
| 4 | <h1><?= $pageTitle ?></h1> |
droy | 4e8fc0e | 2008-02-04 14:42:30 +0000 | [diff] [blame] | 5 | <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> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 7 | <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> |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 29 | <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> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 30 | <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][2] ?></td> |
| 31 | </tr> |
| 32 | <tr> |
| 33 | <td> </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> |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 51 | <script language="javascript"> |
| 52 | function fnSetVersionList() { |
| 53 | document.form1.version.options.length = 0; |
| 54 | |
droy | 80e86bc | 2008-02-04 16:05:41 +0000 | [diff] [blame^] | 55 | 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 | } |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 64 | } |
| 65 | } |
droy | 80e86bc | 2008-02-04 16:05:41 +0000 | [diff] [blame^] | 66 | 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 | } |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 72 | fnUpdateFileList(); |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 73 | } |
| 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/)) { |
gobrien | 1a8e02f | 2008-01-30 01:46:26 +0000 | [diff] [blame] | 82 | alert("The ViewCVS URL must contain view=co"); |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 83 | document.form1.submit.disabled = "disabled"; |
droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame] | 84 | } |
| 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> |