use $interface_requires for the RackCode report
authorDenis Ovsienko <denis@ovsienko.info>
Mon, 7 Dec 2015 00:54:17 +0000 (00:54 +0000)
committerDenis Ovsienko <denis@ovsienko.info>
Mon, 7 Dec 2015 00:54:17 +0000 (00:54 +0000)
Remove custom handling from renderRackCodeReports() and renderReports()
in favour of the recently implemented device.

wwwroot/inc/interface-reports.php
wwwroot/inc/navigation.php

index af60e70..b83d59e 100644 (file)
@@ -47,14 +47,12 @@ function renderRackCodeReports ()
                        'title' => 'Stats',
                        'type' => 'counters',
                        'func' => 'getRackCodeStats',
-                       'include' => 'code.php',
                ),
                array
                (
                        'title' => 'Warnings',
                        'type' => 'messages',
                        'func' => 'getRackCodeWarnings',
-                       'include' => 'code.php',
                ),
        );
        renderReports ($tmp);
@@ -175,9 +173,6 @@ function renderReports ($what)
        echo "<table align=center>\n";
        foreach ($what as $item)
        {
-               if (isset ($item['include']))
-                       require_once $item['include'];
-
                echo "<tr><th colspan=2><h3>${item['title']}</h3></th></tr>\n";
                switch ($item['type'])
                {
index 9797c1d..2d7218a 100644 (file)
@@ -724,6 +724,7 @@ $tabhandler['reports']['8021q'] = 'render8021QReport';
 $tabhandler['reports']['warranty'] = 'renderExpirations';
 $tabhandler['reports']['integrity'] = 'renderDataIntegrityReport';
 $tabhandler['reports']['local'] = 'renderLocalReports';
+$interface_requires['reports-rackcode'] = 'code.php';
 $interface_requires['reports-*'] = 'interface-reports.php';
 
 $page['files']['title'] = 'Files';