r3717 renderIndex(): use external index layout, which the user can override
authorDenis Ovsienko <infrastation@yandex.ru>
Mon, 31 May 2010 22:27:46 +0000 (22:27 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 31 May 2010 22:27:46 +0000 (22:27 +0000)
inc/interface.php
inc/navigation.php

index 4d02cb6..aa8b5e2 100644 (file)
@@ -337,30 +337,25 @@ function renderIndexItem ($ypageno) {
 
 function renderIndex ()
 {
+       global $indexlayout;
 ?>
 <table border=0 cellpadding=0 cellspacing=0 width='100%'>
        <tr>
                <td>
                        <div style='text-align: center; margin: 10px; '>
                        <table width='100%' cellspacing=0 cellpadding=20 class=mainmenu border=0>
-                               <tr>
 <?php
-renderIndexItem('rackspace');
-renderIndexItem('depot');
-renderIndexItem('ipv4space');
-renderIndexItem('files');
-renderIndexItem('8021q');
-?>          
-                               </tr>
-                               <tr>
-<?php
-renderIndexItem('config');
-renderIndexItem('reports');
-renderIndexItem('ipv4slb');
-print "          <td>&nbsp;</td>";
-print "          <td>&nbsp;</td>";
-?>          
-                               </tr>
+foreach ($indexlayout as $row)
+{
+       echo '<tr>';
+       foreach ($row as $column)
+               if ($column === NULL)
+                       echo '<td>&nbsp;</td>';
+               else
+                       renderIndexItem ($column);
+       echo '</tr>';
+}
+?>
                        </table>
                        </div>
                </td>
index 53bc95c..c5ae570 100644 (file)
@@ -12,6 +12,12 @@ $ophandler = array();
 $tabhandler = array();
 $delayauth = array();
 
+$indexlayout = array
+(
+       array ('rackspace', 'depot', 'ipv4space', 'files', '8021q'),
+       array ('config', 'reports', 'ipv4slb', NULL, NULL),
+);
+
 $page['index']['title'] = 'Main page';
 $page['index']['handler'] = 'renderIndex';