Upstream tarball 20080522
[amule.git] / src / webserver / litoral / stats_tree.php
blob29aa6367b8ffddd082bd70ae108eb7c55247824c
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3 <html>
4 <head>
5 <title>amule preferences page</title>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf8">
7 <meta http-equiv="pragmas" content="no-cache">
8 <?php
9 if ( $_SESSION["auto_refresh"] > 0 ) {
10 echo "<meta http-equiv=\"refresh\" content=\"", $_SESSION["auto_refresh"], '">';
13 <style type="text/css">
14 .trigger{
15 cursor: pointer;
16 cursor: hand;
17 font-family: Tahoma;
18 font-size: small;
20 .branch{
21 display: block;
22 margin-left: 16px;
23 font-family: Tahoma;
24 font-size: small;
26 <!--
27 body {
28 margin-left: 0px;
29 margin-top: 0px;
30 margin-right: 0px;
31 margin-bottom: 0px;
32 background-color: #ffffff;
34 -->
35 </style>
36 </head>
37 <script language="JavaScript" type="text/JavaScript">
38 var openImg = new Image();
39 openImg.src = "tree-open.gif";
40 var closedImg = new Image();
41 closedImg.src = "tree-closed.gif";
43 function showBranch(branch){
44 var objBranch = document.getElementById(branch).style;
45 if(objBranch.display!="none")
46 objBranch.display="none";
47 else
48 objBranch.display="block";
51 function swapFolder(img){
52 objImg = document.getElementById(img);
53 if(objImg.src.indexOf('tree-closed.gif')>-1)
54 objImg.src = openImg.src;
55 else
56 objImg.src = closedImg.src;
59 </script>
60 <body onLoad="showBranch('br_Stats');swapFolder('fl_Stats')">
61 <?php
63 function print_ident($i)
65 while($i != 0) {
66 echo "\t";
67 $i--;
71 function print_item($it, $ident)
73 print_ident($ident);
74 echo "<img src=\"tree-leaf.gif\">", $it, "<br>\n";
77 function print_folder($key, &$arr, $ident)
79 print_ident($ident);
80 echo "<span class=\"trigger\" onClick=\"showBranch('br_",
81 $key, "');swapFolder('fl_", $key, "')\">\n";
82 print_ident($ident+1);
83 echo "<img src=\"tree-open.gif\" border=\"0\" id=\"fl_", $key, "\">\n";
84 print_ident($ident+1);
85 echo $key, "<br>\n";
86 print_ident($ident);
87 echo "</span>\n";
88 print_ident($ident);
89 echo "<span class=\"branch\" id=\"br_", $key, "\">\n";
91 foreach ($arr as $k => $v) {
92 if ( count(&$v) ) {
93 print_folder($k, $v, $ident+1);
94 } else {
95 print_item($k, $ident+1);
99 print_ident($ident);
100 echo "</span>\n";
103 $stattree = amule_load_vars("stats_tree");
105 foreach ($stattree as $k => $v) {
106 if ( count(&$v) ) {
107 print_folder($k, $v, $ident+1);
108 } else {
109 print_item($k, $ident+1);
113 </body>
114 </html>