r1979 + allow a comment to end RackCode text
[racktables] / index.php
CommitLineData
b325120a 1<?php
e673ee24
DO
2
3require 'inc/init.php';
4authorize();
5
6echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
7echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
8echo '<head><title>' . getTitle ($pageno, $tabno) . "</title>\n";
21fd978f 9echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
e673ee24
DO
10echo "<link rel=stylesheet type='text/css' href=pi.css />\n";
11echo "<link rel=icon href='" . getFaviconURL() . "' type='image/x-icon' />";
12echo "<style type='text/css'>\n";
13// Print style information
9c0b0016 14foreach (array ('F', 'A', 'U', 'T', 'Th', 'Tw', 'Thw') as $statecode)
e673ee24
DO
15{
16 echo "td.state_${statecode} {\n";
2a201216 17 echo "\ttext-align: center;\n";
9c0b0016 18 echo "\tbackground-color: #" . (getConfigVar ('color_' . $statecode)) . ";\n";
2a201216 19 echo "\tfont: bold 10px Verdana, sans-serif;\n";
e673ee24
DO
20 echo "}\n\n";
21}
22?>
2a201216
DY
23.validation-error {
24 border:1px solid red;
25}
26
27.validation-success {
28 border:1px solid green;
29}
e673ee24 30 </style>
a30489ac 31 <script language='javascript' type='text/javascript' src='js/live_validation.js'></script>
2a201216
DY
32 <script type="text/javascript">
33 function init() {
34 document.add_new_range.range.setAttribute('match', "^\\d\\d?\\d?\\.\\d\\d?\\d?\\.\\d\\d?\\d?\\.\\d\\d?\\d?\\/\\d\\d?$");
35
36 Validate.init();
37 }
38 window.onload=init;
39 </script>
e673ee24
DO
40 </head>
41<body>
42 <table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%' class=maintable>
43 <tr class=mainheader>
c4d215e8 44 <td colspan=2>
e673ee24
DO
45 <table width='100%' cellspacing=0 cellpadding=2 border=0>
46 <tr>
1db97c25 47 <td valign=top><a href='http://racktables.org/'><?php printImageHREF ('logo'); ?></a></td>
b325120a 48 <td valign=top><div class=greeting><?php printGreeting(); ?></div></td>
e673ee24
DO
49 </tr>
50 </table>
51 </td>
52 </tr>
53
54 <tr>
c4d215e8 55 <td class="menubar" colspan=2>
e673ee24
DO
56 <table border="0" width="100%" cellpadding="3" cellspacing="0">
57 <tr>
b325120a 58<?php showPathAndSearch ($pageno); ?>
e673ee24
DO
59 </tr>
60 </table>
61 </td>
62 </tr>
63
64 <tr>
b325120a 65<?php
e673ee24
DO
66 showTabs ($pageno, $tabno);
67?>
68 </tr>
69
70 <tr>
c4d215e8 71 <td colspan=2>
b325120a 72<?php
e45a78d7
DO
73if (isset ($tabhandler[$pageno][$tabno]))
74{
3bebaebd
DO
75 if (isset ($page[$pageno]['bypass']) && isset ($page[$pageno]['bypass_type']))
76 {
77 switch ($page[$pageno]['bypass_type'])
78 {
79 case 'uint':
2c6c7645 80 assertUIntArg ($page[$pageno]['bypass'], 'index');
3bebaebd 81 break;
105cea6e 82 case 'uint0':
2c6c7645 83 assertUIntArg ($page[$pageno]['bypass'], 'index', TRUE);
105cea6e 84 break;
3bebaebd
DO
85 default:
86 showError ("Dispatching error for bypass parameter");
87 break;
88 }
89 $tabhandler[$pageno][$tabno] ($_REQUEST[$page[$pageno]['bypass']]);
90 }
e45a78d7
DO
91 else
92 $tabhandler[$pageno][$tabno] ();
93}
94elseif (isset ($page[$pageno]['handler']))
e673ee24
DO
95 $page[$pageno]['handler'] ($tabno);
96else
b43ee65d 97 showError ("Failed to find handler for page '${pageno}', tab '${tabno}'");
e673ee24
DO
98?>
99 </td>
100 </tr>
101 </table>
102</body>
103</html>