droy | 8aedeec | 2008-01-25 19:04:14 +0000 | [diff] [blame^] | 1 | <div id="maincontent"> |
| 2 | <div id="midcolumn"> |
| 3 | |
| 4 | <h1><?= $pageTitle ?></h1> |
| 5 | <p>Use this form to define the map files for your project. This page is only accessible by Eclipse committers.</p> |
| 6 | <form name="form1" method="post"> |
| 7 | <table cellspacing=4 cellpadding=0 border=0 width="950"> |
| 8 | <tr><td></td><td colspan=2 style="color:red;"><?= $GLOBALS['g_ERRSTRS'][0] ?></td></tr> |
| 9 | <tr> |
| 10 | <td>Project:</td><td><select name="project_id" onchange="fnSetVersionList();"> |
| 11 | <?php |
| 12 | while($myrow = mysql_fetch_assoc($rs_project_list)) { |
| 13 | $selected = ""; |
| 14 | if($myrow['project_id'] == $PROJECT_ID) { |
| 15 | $selected = 'selected="selected"'; |
| 16 | } |
| 17 | echo "<option value='" . $myrow['project_id'] . "' $selected>" . $myrow['project_id'] . "</option>"; |
| 18 | } |
| 19 | ?></select></td> |
| 20 | <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][1] ?></td> |
| 21 | </tr> |
| 22 | <tr> |
| 23 | <td>Release Version</td><td><select name="version" onchange="fnUpdateFileList();"> |
| 24 | </select></td> |
| 25 | <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][4] ?></td> |
| 26 | </tr> |
| 27 | <tr> |
| 28 | <td><a href="http://dev.eclipse.org/viewcvs/index.cgi">ViewVC</a> download URL to map file:</td><td><input type="text" name="location" value="<?= $LOCATION ?>" size="80" onchange="fnCheckUrl();" /></td> |
| 29 | <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][2] ?></td> |
| 30 | </tr> |
| 31 | <tr> |
| 32 | <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> |
| 33 | </tr> |
| 34 | <tr> |
| 35 | <td>File name: </td><td><input type="text" name="filename" value="<?= $FILENAME ?>" size="32" /></td> |
| 36 | <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][5] ?></td> |
| 37 | </tr> |
| 38 | |
| 39 | <tr> |
| 40 | <td></td><td><input type="submit" name="submit" value="Save" style="font-size:14px;" /></td></tr> |
| 41 | <tr> |
| 42 | <td colspan="2"><iframe id="fileShow" name="somefiles" width="100%" height="200" |
| 43 | style="border: 1px black solid" |
| 44 | src=""> |
| 45 | </iframe> |
| 46 | </td> |
| 47 | </tr> |
| 48 | </table> |
| 49 | </form> |
| 50 | |
| 51 | |
| 52 | |
| 53 | <script language="javascript"> |
| 54 | function fnSetVersionList() { |
| 55 | document.form1.version.options.length = 0; |
| 56 | |
| 57 | for(i = 0; i < versions[document.form1.project_id.value].length; i++) { |
| 58 | var opt = document.createElement("OPTION"); |
| 59 | document.form1.version.options.add(opt); |
| 60 | document.form1.version.options[i].text = versions[document.form1.project_id.value][i]; |
| 61 | document.form1.version.options[i].value = versions[document.form1.project_id.value][i]; |
| 62 | if(versions[document.form1.project_id.value][i] == "<?= $VERSION ?>") { |
| 63 | document.form1.version.options[i].selected = "selected"; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | fnUpdateFileList(); |
| 68 | |
| 69 | } |
| 70 | |
| 71 | function fnUpdateFileList() { |
| 72 | source = "map_files.php?submit=showfiles&project_id=" + document.form1.project_id.value + "&version=" + document.form1.version.options[document.form1.version.selectedIndex].value; |
| 73 | document.getElementById("fileShow").src = source; |
| 74 | } |
| 75 | |
| 76 | function fnCheckUrl() { |
| 77 | if(!document.form1.location.value.match(/view=co/)) { |
| 78 | alert("The ViewVC URL must contain view=co"); |
| 79 | document.form1.submit.disabled = "disabled"; |
| 80 | |
| 81 | } |
| 82 | else { |
| 83 | document.form1.submit.disabled = ""; |
| 84 | |
| 85 | var re = /\/([A-Za-z0-9_-]+\.map)/; |
| 86 | var match = re.exec(document.form1.location.value) |
| 87 | document.form1.filename.value = match[1]; |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | var versions = new Array(); |
| 92 | |
| 93 | <?php |
| 94 | $prev_project = ""; |
| 95 | $count = 0; |
| 96 | while($myrow = mysql_fetch_assoc($rs_version_list)) { |
| 97 | if($prev_project != $myrow['project_id']) { |
| 98 | if($count > 0) { |
| 99 | echo "]; |
| 100 | "; |
| 101 | } |
| 102 | echo "versions['" . $myrow['project_id'] . "'] = ["; |
| 103 | $count = 0; |
| 104 | } |
| 105 | if($count > 0) { |
| 106 | echo ","; |
| 107 | } |
| 108 | echo "\"" . $myrow['version'] . "\""; |
| 109 | $count++; |
| 110 | $prev_project = $myrow['project_id']; |
| 111 | } |
| 112 | echo "];"; |
| 113 | ?> |
| 114 | |
| 115 | fnSetVersionList(); |
| 116 | document.form1.submit.disabled = "disabled"; |
| 117 | |
| 118 | </script> |