summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfSense.org>2010-02-01 17:53:54 -0500
committerScott Ullrich <sullrich@pfSense.org>2010-02-01 17:53:54 -0500
commitc5b5f501b8d17827790fb47b64e610a7764b7329 (patch)
treeb61d70ee3aece21d7cee8b7ae480c522a9f75b69
parentf70466e68456d472e15a10ea779daef61402d92a (diff)
downloadpfsense-c5b5f501b8d17827790fb47b64e610a7764b7329.zip
pfsense-c5b5f501b8d17827790fb47b64e610a7764b7329.tar.gz
Show a 3G icon when item is a serial type interface
-rw-r--r--etc/inc/interfaces.inc16
-rw-r--r--usr/local/www/widgets/widgets/interfaces.widget.php26
2 files changed, 31 insertions, 11 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index eb90ab6..da7c0d1 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -2767,6 +2767,22 @@ function is_altq_capable($int) {
return false;
}
+/****f* interfaces/is_interface_ppp
+ * NAME
+ * is_interface_ppp - Returns if an interface is ppp
+ * RESULT
+ * $tmp - Returns if an interface is ppp
+ ******/
+function is_interface_ppp($interface) {
+ global $config, $g;
+
+ $friendly = convert_real_interface_to_friendly_interface_name($interface);
+ if(!isset($config['interfaces'][$friendly]['serialport']))
+ return true;
+
+ return false;
+}
+
/****f* interfaces/is_interface_wireless
* NAME
* is_interface_wireless - Returns if an interface is wireless
diff --git a/usr/local/www/widgets/widgets/interfaces.widget.php b/usr/local/www/widgets/widgets/interfaces.widget.php
index e529b57..58a2c1c 100644
--- a/usr/local/www/widgets/widgets/interfaces.widget.php
+++ b/usr/local/www/widgets/widgets/interfaces.widget.php
@@ -42,20 +42,24 @@ require_once("/usr/local/www/widgets/include/interfaces.inc");
<table bgcolor="#990000" width="100%" border="0" cellspacing="0" cellpadding="0">
<?php
foreach ($ifdescrs as $ifdescr => $ifname) {
- $ifinfo = get_interface_info($ifdescr);
- $iswireless = is_interface_wireless($ifdescr);
+ $ifinfo = get_interface_info($ifdescr);
+ $iswireless = is_interface_wireless($ifdescr);
+ $isserial = is_interface_ppp($ifdescr);
?>
<tr>
<td class="vncellt" width="40%">
- <?php if($iswireless) {
- if($ifinfo['status'] == "associated") { ?>
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_wlan.gif" />
- <? } else { ?>
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_wlan_d.gif" />
- <? } ?>
- <? } else { ?>
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_cablenic.gif"/>
- <? } ?>&nbsp;
+ <?php
+ if($isserial) {
+ echo "<img src='./themes/{$g['theme']}/images/icons/icon_3g.gif' />";
+ } else if($iswireless) {
+ if($ifinfo['status'] == "associated") { ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_wlan.gif" />
+ <? } else { ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_wlan_d.gif" />
+ <? } ?>
+ <? } else { ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_cablenic.gif"/>
+ <? } ?>&nbsp;
<strong><u>
<span onClick="location.href='/interfaces.php?if=<?=$ifdescr; ?>'" style="cursor:pointer">
<?=htmlspecialchars($ifname);?></span></u></strong>
OpenPOWER on IntegriCloud