root/tags/RackTables-0.15.1/index.php

Revision 1838, 2.7 kB (checked in by pilot, 10 months ago)

+ pass and handle caller function name for assertions

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