r4096 reduce msgcode array in a way, and justify some functions respectively
[racktables] / index.php
CommitLineData
b325120a 1<?php
90a3d6d8
DY
2ob_start();
3try {
f77323f1 4require 'inc/interface.php';
e673ee24 5require 'inc/init.php';
329ec966 6prepareNavigation();
da958e52
DO
7// no ctx override is necessary
8fixContext();
750d26d2 9redirectIfNecessary();
da958e52 10if (!permitted())
da958e52 11 renderAccessDenied();
878512c6 12header ('Content-Type: text/html; charset=UTF-8');
b0348307 13// Only store the tab name after clearance is got. Any failure is unhandleable.
fa5b2764
AA
14if (isset ($_REQUEST['tab']) and ! isset ($_SESSION['RTLT'][$pageno]['dont_remember']))
15 $_SESSION['RTLT'][$pageno] = array ('tabname' => $tabno, 'time' => time());
e673ee24 16
e45a78d7 17if (isset ($tabhandler[$pageno][$tabno]))
08408472 18 call_user_func ($tabhandler[$pageno][$tabno], getBypassValue());
e45a78d7 19elseif (isset ($page[$pageno]['handler']))
e673ee24
DO
20 $page[$pageno]['handler'] ($tabno);
21else
3a089a44 22 throw new RackTablesError ("Failed to find handler for page '${pageno}', tab '${tabno}'", RackTablesError::INTERNAL);
08408472
AA
23
24$content = ob_get_clean();
25ob_start();
e673ee24 26?>
08408472
AA
27<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
28<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
29<head><title><?php echo getTitle ($pageno); ?></title>
30<?php printPageHeaders(); ?>
31</head>
32<body>
33<table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" class="maintable">
34 <tr class="mainheader"><td>
35 <table width="100%" cellspacing="0" cellpadding="2" border="0">
36 <tr>
37 <td valign=top><a href="http://racktables.org/"><?php printImageHREF ('logo'); ?></a></td>
38 <td valign=top><div class=greeting><?php printGreeting(); ?></div></td>
39 </tr>
40 </table>
41 </td></tr>
42 <tr><td class="menubar">
43 <table border="0" width="100%" cellpadding="3" cellspacing="0">
44 <tr><?php showPathAndSearch ($pageno); ?></tr>
45 </table>
46 </td></tr>
47 <tr><td><?php showTabs ($pageno, $tabno); ?></td></tr>
48 <tr><td><?php $output_is_buffered = FALSE; showMessageOrError(); ?></td></tr>
49 <tr><td><?php echo $content; ?></td></tr>
50</table>
51</body>
52</html>
53<?
65e557dd 54 ob_flush();
90a3d6d8
DY
55} catch (Exception $e) {
56 ob_end_clean();
57 printException($e);
58}