diff options
author | Stuart Wyatt <stuart@gogglespisano.com> | 2015-04-07 13:29:45 -0700 |
---|---|---|
committer | Stuart Wyatt <stuart@gogglespisano.com> | 2015-04-07 13:29:45 -0700 |
commit | 2b81eb361ef2074d8ce60484e4a41a426be2ab23 (patch) | |
tree | 83b84ef5f00cbf09e9d70ebd0871cc01d4daa1ef /config/bind/bind.widget.php | |
parent | e194ac796ff97ddde13eea2710cf07a83a1a2e58 (diff) | |
download | pfsense-packages-2b81eb361ef2074d8ce60484e4a41a426be2ab23.tar.gz pfsense-packages-2b81eb361ef2074d8ce60484e4a41a426be2ab23.tar.bz2 pfsense-packages-2b81eb361ef2074d8ce60484e4a41a426be2ab23.zip |
BIND package code clean up
Code cleanup to reflect coding style guidelines and consistency
Tabs only, always uses braces, spacing
C/C++ style comments
Use array_key_exists instead of key_exists
$config[] keys are always enclosed in quotes and use single quotes for literals
Diffstat (limited to 'config/bind/bind.widget.php')
-rw-r--r-- | config/bind/bind.widget.php | 94 |
1 files changed, 50 insertions, 44 deletions
diff --git a/config/bind/bind.widget.php b/config/bind/bind.widget.php index dc6b3bf0..1e8c0cc8 100644 --- a/config/bind/bind.widget.php +++ b/config/bind/bind.widget.php @@ -1,4 +1,4 @@ -<?php +<?php /* Copyright 2013 Marcello Coutinho Part of bind package for pfSense(www.pfsense.org) @@ -28,59 +28,65 @@ @require_once("pfsense-utils.inc"); @require_once("functions.inc"); -$uname=posix_uname(); -if ($uname['machine']=='amd64') - ini_set('memory_limit', '250M'); - -function open_table(){ +$uname = posix_uname(); +if ($uname['machine'] == 'amd64') { + ini_set('memory_limit', '250M'); +} + +function open_table() +{ echo "<table style=\"padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"; - echo" <tr>"; + echo " <tr>"; } -function close_table(){ - echo" </tr>"; - echo"</table>"; - + +function close_table() +{ + echo " </tr>"; + echo "</table>"; + } -$pfb_table=array(); -$img['Sick']="<img src ='/themes/{$g['theme']}/images/icons/icon_interface_down.gif'>"; -$img['Healthy']="<img src ='/themes/{$g['theme']}/images/icons/icon_interface_up.gif'>"; +$pfb_table = array(); +$img['Sick'] = "<img src ='/themes/{$g['theme']}/images/icons/icon_interface_down.gif'>"; +$img['Healthy'] = "<img src ='/themes/{$g['theme']}/images/icons/icon_interface_up.gif'>"; #var_dump($pfb_table); #exit; -?><div id='bind'><?php -global $config; -$rndc_bin="/usr/local/sbin/rndc"; +?> +<div id='bind'><?php + global $config; + $rndc_bin = "/usr/local/sbin/rndc"; -if (file_exists($rndc_bin)) - exec("$rndc_bin status",$status); + if (file_exists($rndc_bin)) { + exec("$rndc_bin status", $status); + } -open_table(); -foreach($status as $line){ - $fields=explode(":",$line); - print "<tr><td class=\"vncellt\"width=50%><strong>".ucfirst($fields[0])."</strong></td>\n"; - print "<td class=\"listlr\">{$fields[1]}</td>\n</tr>"; + open_table(); + foreach ($status as $line) { + $fields = explode(":", $line); + print "<tr><td class=\"vncellt\"width=50%><strong>" . ucfirst($fields[0]) . "</strong></td>\n"; + print "<td class=\"listlr\">{$fields[1]}</td>\n</tr>"; } -close_table(); -echo"</div>"; + close_table(); + echo "</div>"; -?> -<script type="text/javascript"> - function getstatus_bind() { - var url = "/widgets/widgets/bind.widget.php"; - var pars = 'getupdatestatus=yes'; - var myAjax = new Ajax.Request( - url, - { - method: 'get', - parameters: pars, - onComplete: activitycallback_bind - }); + ?> + <script type="text/javascript"> + function getstatus_bind() { + var url = "/widgets/widgets/bind.widget.php"; + var pars = 'getupdatestatus=yes'; + var myAjax = new Ajax.Request( + url, + { + method: 'get', + parameters: pars, + onComplete: activitycallback_bind + }); } - function activitycallback_bind(transport) { - $('bind').innerHTML = transport.responseText; - setTimeout('getstatus_postfix()', 5000); - } - getstatus_bind(); -</script> + function activitycallback_bind(transport) { + $('bind').innerHTML = transport.responseText; + setTimeout('getstatus_postfix()', 5000); + } + getstatus_bind(); + </script> |