diff options
author | Phil Davis <phil.davis@inf.org> | 2015-05-24 11:08:55 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-05-24 11:08:55 +0545 |
commit | 5fcc3079bb0f540f252477dbe26a09d0f0f712c6 (patch) | |
tree | 4939c846a2c3e53dc4ac701b7396ec0681b241f2 /usr/local/www/services_captiveportal_zones.php | |
parent | 88cbd0049b78bd731648be68c13e08161e5e943c (diff) | |
download | pfsense-5fcc3079bb0f540f252477dbe26a09d0f0f712c6.zip pfsense-5fcc3079bb0f540f252477dbe26a09d0f0f712c6.tar.gz |
Code style www services captive portal
Diffstat (limited to 'usr/local/www/services_captiveportal_zones.php')
-rw-r--r-- | usr/local/www/services_captiveportal_zones.php | 128 |
1 files changed, 71 insertions, 57 deletions
diff --git a/usr/local/www/services_captiveportal_zones.php b/usr/local/www/services_captiveportal_zones.php index 8974167..5eb9742 100644 --- a/usr/local/www/services_captiveportal_zones.php +++ b/usr/local/www/services_captiveportal_zones.php @@ -44,8 +44,9 @@ require("captiveportal.inc"); global $cpzone; global $cpzoneid; -if (!is_array($config['captiveportal'])) +if (!is_array($config['captiveportal'])) { $config['captiveportal'] = array(); +} $a_cp = &$config['captiveportal']; if ($_GET['act'] == "del" && !empty($_GET['zone'])) { @@ -55,15 +56,16 @@ if ($_GET['act'] == "del" && !empty($_GET['zone'])) { unset($a_cp[$cpzone]['enable']); captiveportal_configure_zone($a_cp[$cpzone]); unset($a_cp[$cpzone]); - if (isset($config['voucher'][$cpzone])) + if (isset($config['voucher'][$cpzone])) { unset($config['voucher'][$cpzone]); + } write_config(); header("Location: services_captiveportal_zones.php"); exit; } } -$pgtitle = array(gettext("Captive Portal"),gettext("Zones")); +$pgtitle = array(gettext("Captive Portal"), gettext("Zones")); $shortcut_section = "captiveportal"; include("head.inc"); @@ -78,61 +80,73 @@ include("head.inc"); <?php endif; ?> <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="captive portal"> -<tr> - <td width="15%" class="listhdrr"><?=gettext("Zone");?></td> - <td width="30%" class="listhdrr"><?=gettext("Interfaces");?></td> - <td width="10%" class="listhdrr"><?=gettext("Number of users");?></td> - <td width="40%" class="listhdrr"><?=gettext("Description");?></td> - <td width="5%" class="list"> - <table border="0" cellspacing="0" cellpadding="1" summary="icons"> - <tr> - <td valign="middle" width="17"> </td> - <td valign="middle"><a href="services_captiveportal_zones_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new captiveportal instance");?>" alt="add" /></a></td> - </tr> - </table> - </td> -</tr> - <?php foreach ($a_cp as $cpzone => $cpitem): - if (!is_array($cpitem)) + <tr> + <td width="15%" class="listhdrr"><?=gettext("Zone");?></td> + <td width="30%" class="listhdrr"><?=gettext("Interfaces");?></td> + <td width="10%" class="listhdrr"><?=gettext("Number of users");?></td> + <td width="40%" class="listhdrr"><?=gettext("Description");?></td> + <td width="5%" class="list"> + <table border="0" cellspacing="0" cellpadding="1" summary="icons"> + <tr> + <td valign="middle" width="17"> </td> + <td valign="middle"> + <a href="services_captiveportal_zones_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new captiveportal instance");?>" alt="add" /></a> + </td> + </tr> + </table> + </td> + </tr> +<?php + foreach ($a_cp as $cpzone => $cpitem): + if (!is_array($cpitem)) { continue; - ?> -<tr> - <td class="listlr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';"> - <?=htmlspecialchars($cpitem['zone']);?> - </td> - <td class="listlr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';"> - <?php $cpifaces = explode(",", $cpitem['interface']); - foreach ($cpifaces as $cpiface) - echo convert_friendly_interface_to_friendly_descr($cpiface) . " "; - ?> - </td> - <td class="listr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';"> - <?=count(captiveportal_read_db());?> - </td> - <td class="listbg" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';"> - <?=htmlspecialchars($cpitem['descr']);?> - </td> - <td valign="middle" class="list nowrap"> - <table border="0" cellspacing="0" cellpadding="1" summary="icons"> - <tr> - <td valign="middle"><a href="services_captiveportal.php?zone=<?=$cpzone?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit captiveportal instance"); ?>" alt="edit" /></a></td> - <td><a href="services_captiveportal_zones.php?act=del&zone=<?=$cpzone;?>" onclick="return confirm('<?=gettext("Do you really want to delete this entry?");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete captiveportal instance");?>" alt="delete" /></a></td> - </tr> - </table> - </td> -</tr> - <?php endforeach; ?> -<tr> - <td class="list" colspan="4"></td> - <td class="list"> - <table border="0" cellspacing="0" cellpadding="1" summary="add"> - <tr> - <td valign="middle" width="17"> </td> - <td valign="middle"><a href="services_captiveportal_zones_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new captiveportal instance");?>" alt="add" /></a></td> - </tr> - </table> - </td> -</tr> + } +?> + <tr> + <td class="listlr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';"> + <?=htmlspecialchars($cpitem['zone']);?> + </td> + <td class="listlr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';"> +<?php + $cpifaces = explode(",", $cpitem['interface']); + foreach ($cpifaces as $cpiface) { + echo convert_friendly_interface_to_friendly_descr($cpiface) . " "; + } +?> + </td> + <td class="listr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';"> + <?=count(captiveportal_read_db());?> + </td> + <td class="listbg" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';"> + <?=htmlspecialchars($cpitem['descr']);?> + </td> + <td valign="middle" class="list nowrap"> + <table border="0" cellspacing="0" cellpadding="1" summary="icons"> + <tr> + <td valign="middle"><a href="services_captiveportal.php?zone=<?=$cpzone?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit captiveportal instance"); ?>" alt="edit" /></a></td> + <td> + <a href="services_captiveportal_zones.php?act=del&zone=<?=$cpzone;?>" onclick="return confirm('<?=gettext("Do you really want to delete this entry?");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete captiveportal instance");?>" alt="delete" /></a> + </td> + </tr> + </table> + </td> + </tr> +<?php + endforeach; +?> + <tr> + <td class="list" colspan="4"></td> + <td class="list"> + <table border="0" cellspacing="0" cellpadding="1" summary="add"> + <tr> + <td valign="middle" width="17"> </td> + <td valign="middle"> + <a href="services_captiveportal_zones_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new captiveportal instance");?>" alt="add" /></a> + </td> + </tr> + </table> + </td> + </tr> </table> </form> <?php include("fend.inc"); ?> |