From aa82505e6577c28894150a6fb53c58f914930331 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 15 Dec 2015 16:44:40 +0545 Subject: Code style g-i --- src/usr/local/www/guiconfig.inc | 75 ++++++++++++--------- src/usr/local/www/head.inc | 27 ++++---- src/usr/local/www/index.php | 42 ++++++------ src/usr/local/www/interfaces.php | 68 +++++++++---------- src/usr/local/www/interfaces_assign.php | 11 ++-- src/usr/local/www/interfaces_bridge.php | 11 ++-- src/usr/local/www/interfaces_bridge_edit.php | 29 ++++---- src/usr/local/www/interfaces_gif.php | 3 +- src/usr/local/www/interfaces_gif_edit.php | 23 ++++--- src/usr/local/www/interfaces_gre.php | 3 +- src/usr/local/www/interfaces_gre_edit.php | 14 ++-- src/usr/local/www/interfaces_groups.php | 5 +- src/usr/local/www/interfaces_groups_edit.php | 8 +-- src/usr/local/www/interfaces_lagg.php | 3 +- src/usr/local/www/interfaces_lagg_edit.php | 14 ++-- src/usr/local/www/interfaces_ppps.php | 5 +- src/usr/local/www/interfaces_ppps_edit.php | 91 +++++++++++++++----------- src/usr/local/www/interfaces_qinq.php | 3 +- src/usr/local/www/interfaces_qinq_edit.php | 23 ++++--- src/usr/local/www/interfaces_vlan.php | 4 +- src/usr/local/www/interfaces_vlan_edit.php | 9 ++- src/usr/local/www/interfaces_wireless.php | 3 +- src/usr/local/www/interfaces_wireless_edit.php | 16 +++-- 23 files changed, 280 insertions(+), 210 deletions(-) (limited to 'src/usr/local') diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc index 7c9c7d8..8df884e 100644 --- a/src/usr/local/www/guiconfig.inc +++ b/src/usr/local/www/guiconfig.inc @@ -304,8 +304,9 @@ function verify_gzip_file($fname) { function print_info_box_np($msg, $name="apply", $value="", $showapply=false, $class="alert-warning") { global $g; - if (strpos($class, "alert-") !== 0) + if (strpos($class, "alert-") !== 0) { $class = 'alert-' . $class; + } if (empty($value)) { $value = gettext("Apply changes"); @@ -316,12 +317,14 @@ function print_info_box_np($msg, $name="apply", $value="", $showapply=false, $cl if (stristr($msg, gettext("apply")) != false || stristr($msg, gettext("save")) != false || stristr($msg, gettext("create")) != false || $showapply) { $msg .= '
'; - if ($_POST['if']) + if ($_POST['if']) { $msg .= ""; + } $msg .= '
'; - } else + } else { $msg = ''. $msg; + } echo ''; } @@ -523,18 +526,20 @@ function gentitle($title) { } function genhtmltitle($title) { - if (!is_array($title)) + if (!is_array($title)) { return '

' . $title . '

'; + } $heading = '

' . end($title) . '

'; // If the array contains only one element, there are no breadcrumbs, so don't // add anything else - if(count($title) > 1) { + if (count($title) > 1) { $bc = ''; } else { @@ -599,10 +604,12 @@ function dump_clog_no_table($logfile, $tail, $withorig = true, $grepfor = "", $g if ($config['syslog'][$specific_log]['cronorder'] == 'reverse') $sor = "-r"; $logarr = ""; $grepline = " "; - if (is_array($grepfor)) + if (is_array($grepfor)) { $grepline .= " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor)); - if (is_array($grepinvert)) + } + if (is_array($grepinvert)) { $grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert)); + } if (is_dir($logfile)) { $logarr = array("File $logfile is a directory."); } elseif (file_exists($logfile) && filesize($logfile) == 0) { @@ -611,10 +618,11 @@ function dump_clog_no_table($logfile, $tail, $withorig = true, $grepfor = "", $g if ($config['system']['disablesyslogclog']) { exec("cat " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr); } else { - if (isset($config['system']['usefifolog'])) + if (isset($config['system']['usefifolog'])) { exec("/usr/sbin/fifolog_reader " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr); - else + } else { exec("/usr/local/sbin/clog " . escapeshellarg($logfile) . "{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr); + } } } echo "\n"; @@ -626,7 +634,7 @@ function dump_clog_no_table($logfile, $tail, $withorig = true, $grepfor = "", $g if ($withorig) { if (isset($config['system']['usefifolog'])) { - $entry_date_time = htmlspecialchars(date("F j, Y, g:i a","" . $logent[1] . "")); + $entry_date_time = htmlspecialchars(date("F j, Y, g:i a", "" . $logent[1] . "")); $entry_text = htmlspecialchars($logent[5]); } else { $entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3))); @@ -1048,8 +1056,9 @@ function display_top_tabs(& $tab_array, $no_drop_down = false, $type = 'pills') $font_color = "white"; $tabcharcount = 0; - foreach ($tab_array as $ta) + foreach ($tab_array as $ta) { $tabcharcount = $tabcharcount + strlen($ta[0]); + } if ($no_drop_down == true) { $tabcharcount = 0; @@ -1063,10 +1072,11 @@ function display_top_tabs(& $tab_array, $no_drop_down = false, $type = 'pills') echo "