From b6ba10772b37f14d9bc2d5d73b9bdb0e6bee52fe Mon Sep 17 00:00:00 2001 From: Sascha Linke Date: Tue, 14 Jul 2015 15:32:11 +0200 Subject: [PATCH] Added hide/show feature for settings Widget now translatable --- src/www/widgets/widgets/system_log.widget.php | 115 ++++++++++++------ 1 file changed, 77 insertions(+), 38 deletions(-) diff --git a/src/www/widgets/widgets/system_log.widget.php b/src/www/widgets/widgets/system_log.widget.php index ec934a0f3..cf81ddcfb 100644 --- a/src/www/widgets/widgets/system_log.widget.php +++ b/src/www/widgets/widgets/system_log.widget.php @@ -1,52 +1,91 @@ + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + require_once("guiconfig.inc"); -require_once('notices.inc'); -include_once("includes/functions.inc.php"); -require_once("script/load_phalcon.php"); +require_once("pfsense-utils.inc"); +require_once("functions.inc");; $system_logfile = '/var/log/system.log'; -if (!$config['widgets']['systemlogfiltercount']) -{ - $syslogEntriesToFetch = $config['syslog']['nentries']; - if (!$syslogEntriesToFetch) { $syslogEntriesToFetch = 20; } -} -else -{ -$syslogEntriesToFetch = $config['widgets']['systemlogfiltercount']; + +if (!$config['widgets']['systemlogfiltercount']){ + $syslogEntriesToFetch = $config['syslog']['nentries']; + if (!$syslogEntriesToFetch) { + $syslogEntriesToFetch = 20; + } +} else { + $syslogEntriesToFetch = $config['widgets']['systemlogfiltercount']; } -if(is_numeric($_POST['logfiltercount'])) -{ - $countReceived = $_POST['logfiltercount']; - $config['widgets']['systemlogfiltercount'] = $countReceived; - write_config("Saved Widget System Log Filter Setting"); - Header("Location: /"); - exit(0); +if(is_numeric($_POST['logfiltercount'])) { + $countReceived = $_POST['logfiltercount']; + $config['widgets']['systemlogfiltercount'] = $countReceived; + write_config("Saved Widget System Log Filter Setting"); + Header("Location: /index.php"); + exit(0); } - ?> -
- - -
- + - - +
Number of Log lines to display:
+ + - - + + + +
: - - - - - + + +
+
+ +
+ + +
+ +
+ + + \ No newline at end of file