r4288 renderInterfaceHTML(): new function to keep the HTML code from index.php
authorDenis Ovsienko <infrastation@yandex.ru>
Sat, 5 Mar 2011 11:16:57 +0000 (11:16 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Sat, 5 Mar 2011 11:16:57 +0000 (11:16 +0000)
wwwroot/inc/interface.php
wwwroot/index.php

index d7a00a3..8bd1f55 100644 (file)
@@ -329,6 +329,37 @@ $attrtypes = array
        'dict' => '[D] dictionary record'
 );
 
+function renderInterfaceHTML ($pageno, $tabno, $payload)
+{
+?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head><title><?php echo getTitle ($pageno); ?></title>
+<?php printPageHeaders(); ?>
+</head>
+<body>
+<table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" class="maintable">
+ <tr class="mainheader"><td>
+   <table width="100%" cellspacing="0" cellpadding="2" border="0">
+   <tr>
+    <td valign=top><a href="http://racktables.org/"><?php printImageHREF ('logo'); ?></a></td>
+    <td valign=top><div class=greeting><?php printGreeting(); ?></div></td>
+   </tr>
+   </table>
+ </td></tr>
+ <tr><td class="menubar">
+  <table border="0" width="100%" cellpadding="3" cellspacing="0">
+  <tr><?php showPathAndSearch ($pageno); ?></tr>
+  </table>
+ </td></tr>
+ <tr><td><?php showTabs ($pageno, $tabno); ?></td></tr>
+ <tr><td><?php showMessageOrError(); ?></td></tr>
+ <tr><td><?php echo $payload; ?></td></tr>
+</table>
+</body>
+</html>
+<?php
+}
+
 // Main menu.
 function renderIndexItem ($ypageno) {
   global $page;
index 5d8c52a..d7cf8b2 100644 (file)
@@ -157,34 +157,7 @@ $content = ob_get_clean();
 }
 
 ob_start();
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head><title><?php echo getTitle ($pageno); ?></title>
-<?php printPageHeaders(); ?>
-</head>
-<body>
-<table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" class="maintable">
- <tr class="mainheader"><td>
-   <table width="100%" cellspacing="0" cellpadding="2" border="0">
-   <tr>
-    <td valign=top><a href="http://racktables.org/"><?php printImageHREF ('logo'); ?></a></td>
-    <td valign=top><div class=greeting><?php printGreeting(); ?></div></td>
-   </tr>
-   </table>
- </td></tr>
- <tr><td class="menubar">
-  <table border="0" width="100%" cellpadding="3" cellspacing="0">
-  <tr><?php showPathAndSearch ($pageno); ?></tr>
-  </table>
- </td></tr>
- <tr><td><?php showTabs ($pageno, $tabno); ?></td></tr>
- <tr><td><?php showMessageOrError(); ?></td></tr>
- <tr><td><?php echo $content; ?></td></tr>
-</table>
-</body>
-</html>
-<?php
+renderInterfaceHTML ($pageno, $tabno, $content);
        ob_flush();
 } catch (Exception $e) {
        ob_end_clean();