From d302d1a4cef1e09f06939774d1f78b240c202b84 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Wed, 30 Mar 2011 12:07:08 +0000 Subject: [PATCH] cosmetic change to print channel type for ADSL git-svn-id: http://www.observium.org/svn/observer/trunk@1994 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/print-interface-adsl.inc.php | 2 +- html/includes/print-interface.inc.php | 4 ++-- includes/rewrites.php | 22 +++++++++++++++++++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/html/includes/print-interface-adsl.inc.php b/html/includes/print-interface-adsl.inc.php index 031b58468..36e9c5984 100644 --- a/html/includes/print-interface-adsl.inc.php +++ b/html/includes/print-interface-adsl.inc.php @@ -142,4 +142,4 @@ if ($graph_type && is_file($graph_file)) } -?> \ No newline at end of file +?> diff --git a/html/includes/print-interface.inc.php b/html/includes/print-interface.inc.php index 3e31905a7..e2344d13f 100644 --- a/html/includes/print-interface.inc.php +++ b/html/includes/print-interface.inc.php @@ -101,7 +101,7 @@ if ($device['os'] == "ios" || $device['os'] == "iosxe") if ($port_adsl['adslLineCoding']) { echo(""); - echo($port_adsl['adslLineCoding']."/".$port_adsl['adslLineType']); + echo($port_adsl['adslLineCoding']."/" . rewrite_adslLineType($port_adsl['adslLineType'])); echo("
"); echo("Sync:".formatRates($port_adsl['adslAtucChanCurrTxRate']) . "/". formatRates($port_adsl['adslAturChanCurrTxRate'])); echo("
"); @@ -274,4 +274,4 @@ if ($graph_type && is_file($graph_file)) } -?> \ No newline at end of file +?> diff --git a/includes/rewrites.php b/includes/rewrites.php index 2e48036c6..3f0e24232 100644 --- a/includes/rewrites.php +++ b/includes/rewrites.php @@ -950,4 +950,24 @@ function array_preg_replace($array, $string) return $string; } -?> \ No newline at end of file + + +function rewrite_adslLineType($adslLineType) +{ + $adslLineTypes = array ('noChannel' => 'No Channel', + 'fastOnly' => 'Fastpath', + 'interleavedOnly' => 'Interleaved', + 'fastOrInterleaved' => 'Fast/Interleaved', + 'fastAndInterleaved' => 'Fast+Interleaved'); + + foreach($adslLineTypes as $type => $text) + { + if($adslLineType == $type) + { + $adslLineType = $text; + } + } + return($adslLineType); +} + +?>