diff options
author | Scott Ullrich <sullrich@pfSense.org> | 2010-02-01 17:53:54 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@pfSense.org> | 2010-02-01 17:53:54 -0500 |
commit | c5b5f501b8d17827790fb47b64e610a7764b7329 (patch) | |
tree | b61d70ee3aece21d7cee8b7ae480c522a9f75b69 | |
parent | f70466e68456d472e15a10ea779daef61402d92a (diff) | |
download | pfsense-c5b5f501b8d17827790fb47b64e610a7764b7329.zip pfsense-c5b5f501b8d17827790fb47b64e610a7764b7329.tar.gz |
Show a 3G icon when item is a serial type interface
-rw-r--r-- | etc/inc/interfaces.inc | 16 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/interfaces.widget.php | 26 |
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"/> - <? } ?> + <?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"/> + <? } ?> <strong><u> <span onClick="location.href='/interfaces.php?if=<?=$ifdescr; ?>'" style="cursor:pointer"> <?=htmlspecialchars($ifname);?></span></u></strong> |