Use Config helper (#10339)

remove usage of global variable
This commit is contained in:
Tony Murray
2019-06-23 00:29:12 -05:00
committed by GitHub
parent 342acf50f1
commit f3ba8947f7
367 changed files with 1589 additions and 1857 deletions

View File

@@ -1,12 +1,14 @@
<?php
use LibreNMS\Config;
if ($int_colour) {
$row_colour = $int_colour;
} else {
if (!is_integer($i / 2)) {
$row_colour = $config['list_colour']['even'];
$row_colour = Config::get('list_colour.even');
} else {
$row_colour = $config['list_colour']['odd'];
$row_colour = Config::get('list_colour.odd');
}
}
@@ -14,7 +16,7 @@ if ($int_colour) {
$text = $ap['name'].' '.$ap['type'];
$ap['text'] = $text;
echo "<tr style=\"background-color: $row_colour;\" valign=top onmouseover=\"this.style.backgroundColor='{$config['list_colour']['highlight']}';\" onmouseout=\"this.style.backgroundColor='$row_colour';\" onclick=\"location.href='".generate_ap_url($ap)."/'\" style='cursor: pointer;'>
echo "<tr style=\"background-color: $row_colour;\" valign=top onmouseover=\"this.style.backgroundColor='" . Config::get('list_colour.highlight') . "';\" onmouseout=\"this.style.backgroundColor='$row_colour';\" onclick=\"location.href='" . generate_ap_url($ap) . "/'\" style='cursor: pointer;'>
<td valign=top width=350>";
echo ' <span class=list-large> '.generate_ap_link($ap, " $text </span><br />");
echo '<span class=interface-desc>';
@@ -26,13 +28,13 @@ echo '</td><td width=100>';
echo '</td><td width=150>';
$ap['graph_type'] = 'accesspoints_numasoclients';
echo generate_ap_link($ap, "<img src='graph.php?type=$ap[graph_type]&amp;id=".$ap['accesspoint_id'].'&amp;from='.$config['time']['day'].'&amp;to='.$config['time']['now'].'&amp;width=100&amp;height=20&amp;legend=no&amp;bg='.str_replace('#', '', $row_colour)."'>");
echo generate_ap_link($ap, "<img src='graph.php?type=$ap[graph_type]&amp;id=" . $ap['accesspoint_id'] . '&amp;from=' . Config::get('time.day') . '&amp;to=' . Config::get('time.now') . '&amp;width=100&amp;height=20&amp;legend=no&amp;bg=' . str_replace('#', '', $row_colour) . "'>");
echo "<br>\n";
$ap['graph_type'] = 'accesspoints_radioutil';
echo generate_ap_link($ap, "<img src='graph.php?type=$ap[graph_type]&amp;id=".$ap['accesspoint_id'].'&amp;from='.$config['time']['day'].'&amp;to='.$config['time']['now'].'&amp;width=100&amp;height=20&amp;legend=no&amp;bg='.str_replace('#', '', $row_colour)."'>");
echo generate_ap_link($ap, "<img src='graph.php?type=$ap[graph_type]&amp;id=" . $ap['accesspoint_id'] . '&amp;from=' . Config::get('time.day') . '&amp;to=' . Config::get('time.now') . '&amp;width=100&amp;height=20&amp;legend=no&amp;bg=' . str_replace('#', '', $row_colour) . "'>");
echo "<br>\n";
$ap['graph_type'] = 'accesspoints_interference';
echo generate_ap_link($ap, "<img src='graph.php?type=$ap[graph_type]&amp;id=".$ap['accesspoint_id'].'&amp;from='.$config['time']['day'].'&amp;to='.$config['time']['now'].'&amp;width=100&amp;height=20&amp;legend=no&amp;bg='.str_replace('#', '', $row_colour)."'>");
echo generate_ap_link($ap, "<img src='graph.php?type=$ap[graph_type]&amp;id=" . $ap['accesspoint_id'] . '&amp;from=' . Config::get('time.day') . '&amp;to=' . Config::get('time.now') . '&amp;width=100&amp;height=20&amp;legend=no&amp;bg=' . str_replace('#', '', $row_colour) . "'>");
echo "<br>\n";
echo '</td><td width=120>';