mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
more code cleanup (last commit for now)
git-svn-id: http://www.observium.org/svn/observer/trunk@2520 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -27,7 +27,7 @@ function makeTextBlock($text, $fontfile, $fontsize, $width) {
|
||||
$currentLine = 0;
|
||||
foreach ($words as $word) {
|
||||
$lineSize = imagettfbbox($fontsize, 0, $fontfile, $lines[$currentLine] . ' ' . $word);
|
||||
if($lineSize[2] - $lineSize[0] < $width) {
|
||||
if ($lineSize[2] - $lineSize[0] < $width) {
|
||||
$lines[$currentLine] .= ' ' . $word;
|
||||
} else {
|
||||
$currentLine++;
|
||||
@@ -47,6 +47,7 @@ function makeTextBlock($text, $fontfile, $fontsize, $width) {
|
||||
*/
|
||||
function error($code, $code_msg, $title, $msg) {
|
||||
global $config;
|
||||
|
||||
header(sprintf("HTTP/1.0 %d %s", $code, $code_msg));
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: Mon, 01 Jan 2008 00:00:00 CET");
|
||||
@@ -197,9 +198,9 @@ if (isset($MetaGraphDefs[$type])) {
|
||||
|
||||
if(isset($rrd_cmd))
|
||||
{
|
||||
if($config['rrdcached']) { $rrd_cmd .= " --daemon ".$config['rrdcached'] . " "; }
|
||||
if($_GET['from']) { $from = mres($_GET['from']); }
|
||||
if($_GET['to']) { $to = mres($_GET['to']); }
|
||||
if ($config['rrdcached']) { $rrd_cmd .= " --daemon ".$config['rrdcached'] . " "; }
|
||||
if ($_GET['from']) { $from = mres($_GET['from']); }
|
||||
if ($_GET['to']) { $to = mres($_GET['to']); }
|
||||
$rrd_cmd .= " -s " . $from . " -e " . $to;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ foreach($stats as $stat => $colour)
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_replace("icmp", "", $stat);
|
||||
$rrd_list[$i]['rra'] = $stat;
|
||||
if(strpos($stat, "Out") !== FALSE)
|
||||
if (strpos($stat, "Out") !== FALSE)
|
||||
{
|
||||
$rrd_list[$i]['invert'] = TRUE;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ foreach($stats as $stat => $array)
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_replace("icmp", "", $stat);
|
||||
$rrd_list[$i]['rra'] = $stat;
|
||||
if(strpos($stat, "Out") !== FALSE)
|
||||
if (strpos($stat, "Out") !== FALSE)
|
||||
{
|
||||
$rrd_list[$i]['invert'] = TRUE;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ foreach($stats as $stat => $array)
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_replace("ip", "", $stat);
|
||||
$rrd_list[$i]['rra'] = $stat;
|
||||
if(strpos($stat, "Out") !== FALSE)
|
||||
if (strpos($stat, "Out") !== FALSE)
|
||||
{
|
||||
$rrd_list[$i]['invert'] = TRUE;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ foreach($stats as $stat)
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_replace("snmp", "", $stat);
|
||||
$rrd_list[$i]['rra'] = $stat;
|
||||
if(strpos($stat, "Out") !== FALSE)
|
||||
if (strpos($stat, "Out") !== FALSE)
|
||||
{
|
||||
$rrd_list[$i]['invert'] = TRUE;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ foreach($stats as $stat)
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_replace("snmp", "", $stat);
|
||||
$rrd_list[$i]['rra'] = $stat;
|
||||
if(strpos($stat, "Out") !== FALSE)
|
||||
if (strpos($stat, "Out") !== FALSE)
|
||||
{
|
||||
$rrd_list[$i]['invert'] = TRUE;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ foreach($stats as $stat)
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_replace("tcp", "", $stat);
|
||||
$rrd_list[$i]['rra'] = $stat;
|
||||
if(strpos($stat, "Out") !== FALSE || strpos($stat, "Retrans") !== FALSE || strpos($stat, "Attempt") !== FALSE)
|
||||
if (strpos($stat, "Out") !== FALSE || strpos($stat, "Retrans") !== FALSE || strpos($stat, "Attempt") !== FALSE)
|
||||
{
|
||||
$rrd_list[$i]['invert'] = TRUE;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ foreach($stats as $stat)
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = str_replace("udp", "", $stat);
|
||||
$rrd_list[$i]['rra'] = $stat;
|
||||
if(strpos($stat, "Out") !== FALSE || strpos($stat, "Retrans") !== FALSE || strpos($stat, "Attempt") !== FALSE)
|
||||
if (strpos($stat, "Out") !== FALSE || strpos($stat, "Retrans") !== FALSE || strpos($stat, "Attempt") !== FALSE)
|
||||
{
|
||||
$rrd_list[$i]['invert'] = TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user