forked from cms-sw/cmsdoxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
versionList.php
63 lines (46 loc) · 1.25 KB
/
versionList.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<html>
<head>
<script type="text/javascript">
function setSelected(){
var l = parent.location.href;
var l_array=l.split("/");
for(var i=0; i < l_array.length; i++) {
var value = l_array[i];
if (value.indexOf('CMSSW_') != -1){
var vers = document.getElementById(value);
vers.selected = true;
}
}
}
function redir(version){
var l = parent.location.href;
var l_array=l.split("/");
var newUrl=l;
for(var i=0; i < l_array.length; i++) {
var value = l_array[i];
if (value.indexOf('CMSSW_') != -1){
newUrl = l.replace(value, version);
}
}
parent.location.href = newUrl;
}
</script>
</head>
<body bgcolor="#b7cade" onload="setSelected()">
<font face="Arial" size="2">Current Version:</font>
<select onchange="redir(this.value);" >
<?php
$DOXYDIR = dirname($_SERVER['SCRIPT_FILENAME']);
$output = trim(shell_exec("ls ".$DOXYDIR."/cmssw/ | grep CMSSW_ | sed 's|\.zip$||' | tr '\n' ':'"), ":");
$arr = explode(":", $output);
for ($i=0; $i<count($arr); $i++)
{
// for XCMSSW
if(strpos($arr[$i], "CMSSW_") != 0) continue;
echo "<option id=\"".$arr[$i]."\">".$arr[$i]."</option>\n";
}
include("log/log.php");
?>
</select>
</body>
</html>