5 <script type="text/javascript" src="/planetlab/minitabs/minitabs.js"></script>
6 <link href="/planetlab/minitabs/minitabs.css" rel="stylesheet" type="text/css" />
10 // the expected argument is an (ordered) associative array
11 // ( label => todo , ...)
12 // label is expected to be the string to display in the menu
14 // (*) a string : it is then taken to be a URL to move to
15 // (*) or an associative array with the following keys
16 // (*) 'method': 'POST' or 'GET' -- default is 'GET'
17 // (*) 'url': where to go
18 // (*) 'values': an associative array of (key,value) pairs to send to the URL; values are strings
19 // (*) 'active': if set, this entry is the default one on startup
20 // (not supported yet)
23 function plc_tabs($array) {
24 print '<div id="minitabs_container">';
25 print '<ul id="miniflex">';
27 foreach ($array as $label=>$todo) {
28 print '<li class="minitabs">';
29 // in case we have a string, rewrite it as an array
30 if (is_string ($todo)) $todo=array('method'=>'GET','url'=>$todo);
32 if ( ! $todo['method'] ) $todo['method']='GET';
34 printf ('<form name="%s" action="%s" method="%s">',$label,$todo['url'],$todo['method']);
36 if ( $todo['values'] ) {
37 foreach ($todo['values'] as $key=>$value) {
38 printf('<input class="minitabs" type=hidden name="%s" value="%s" />',$key,$value);
41 $class_value="minitabs";
42 if ($todo['active']) $class_value += ' active';
43 // onmouseover="over()" onmouseout="out()"
44 printf('<input class="%s" value="%s" type=submit />',$class_value,$label);
45 printf("</form></li>\n");