summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/functions.inc51
-rwxr-xr-xusr/local/www/fbegin.inc85
-rwxr-xr-xusr/local/www/index.php15
-rwxr-xr-xusr/local/www/javascript/ticker.js109
4 files changed, 128 insertions, 132 deletions
diff --git a/etc/inc/functions.inc b/etc/inc/functions.inc
index 2eb2682..83be27f 100644
--- a/etc/inc/functions.inc
+++ b/etc/inc/functions.inc
@@ -72,6 +72,57 @@ if(!function_exists("pfSenseHeader")) {
}
/* END compatibility goo with HEAD */
+/*fetch menu notices function*/
+function get_menu_messages(){
+ global $g,$config;
+ if (are_notices_pending()) {
+ $notices = get_notices();
+ $requests=array();
+
+ ## Get Query Arguments from URL ###
+ foreach ($_REQUEST as $key => $value) {
+ if ($key != "PHPSESSID")
+ $requests[] = $key.'='.$value;
+ }
+ if(is_array($requests))
+ $request_string = implode("&", $requests);
+
+ if(is_array($notices)) {
+ $notice_msgs = "<table colspan=6 id=notice_table>";
+ $alert_style="style=\'color:#ffffff; filter:Glow(color=#ff0000, strength=12);\' ";
+ $notice = "<a href=# onClick=notice_action(\'acknowledge\',\'all\');domTT_close(this); {$alert_style}>".gettext("Acknowledge All Notices")."</a>";
+ $alert_link="title=\'".gettext("Click to Acknowledge")."\' {$alert_style}";
+ $domtt_width=500;
+ foreach ($notices as $key => $value) {
+ $date = date("m-d-y H:i:s", $key);
+ $noticemsg = ($value['notice'] != "" ? $value['notice'] : $value['id']);
+ $noticemsg = preg_replace("/(\"|\'|\n|<.?\w+>)/i","",$noticemsg);
+ if ((strlen($noticemsg)* 8) > $domtt_width)
+ $domtt_width=(strlen($noticemsg) *8);
+ if ((strlen($noticemsg)* 8) > 900)
+ $domtt_width= 900;
+ $alert_action ="onClick=notice_action(\'acknowledge\',\'{$key}\');domTT_close(this);jQuery(this).parent().parent().remove();";
+ $notice_msgs .= "<tr><td valign=\'top\' width=\'120\'><a href=# {$alert_link} {$alert_action}>{$date}</a></td><td valign=\'top\'><a href=# {$alert_link} {$alert_action}>[ ".htmlspecialchars($noticemsg)."]</a></td><tr>";
+ }
+ $notice_msgs .="</table>";
+
+ $domtt= "onclick=\"domTT_activate(this, event, 'caption', '{$notice}','content', '<br>{$notice_msgs}', 'trail', false, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle','width','{$domtt_width}','y',5,'type', 'sticky');\"";
+ $menu_messages="<div id='alerts' style='z-index:500'; >\n";
+ if(count($notices)==1)
+ $msg= sprintf("%1$02d",count($notices))." ".gettext("unread notice");
+ else
+ $msg= sprintf("%1$02d",count($notices))." ".gettext("unread notices");
+ $menu_messages.="<div id='marquee-text' ><a href=# {$domtt}>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b> .:. {$msg} .:. </b></a></div>\n";
+ $menu_messages.="</div>\n";
+ }
+ } else {
+ $menu_messages='<div id="hostname">';
+ $menu_messages.=$config['system']['hostname'] . "." . $config['system']['domain'];
+ $menu_messages.='</div>';
+ }
+ return ($menu_messages);
+ }
+
/* include all configuration functions */
require_once("interfaces.inc");
require_once("gwlb.inc");
diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc
index e6a4b31..34ebc09 100755
--- a/usr/local/www/fbegin.inc
+++ b/usr/local/www/fbegin.inc
@@ -1,10 +1,11 @@
<script src="/javascript/sorttable.js"></script>
+<script src="/javascript/ticker.js"></script>
<style id="antiClickjack">body{display:none}</style> <script type="text/JavaScript">
if (self === top) { var antiClickjack = document.getElementById("antiClickjack"); antiClickjack.parentNode.removeChild(antiClickjack);
} else { top.location = self.location;
-}</script>
-
+}
+</script>
<?php
/*
pfSense_MODULE: header
@@ -249,88 +250,25 @@ if(! $g['disablehelpmenu']) {
$help_menu = msort(array_merge($help_menu, return_ext_menu("Help")),0);
}
-/* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */
-if ($_REQUEST['noticeaction'] == 'acknowledge') {
- $notice_id = htmlspecialchars($_REQUEST['noticeid']);
- close_notice($notice_id);
-}
-/**********************************************/
-
?>
<div id="wrapper">
- <div id="header">
+ <div id="header" style="height:40px;">
<div id="header-left"><a href="/index.php" id="status-link"><img src="/themes/<?= $g['theme']; ?>/images/transparent.gif" border="0"></a></div>
- <div id="header-right">
+ <div id="header-right" style="height:30px;" >
<div class="container">
<div class="left">webConfigurator</div>
- <div class="right">
-<?
- if (are_notices_pending()) {
- $notices = get_notices();
-
- $requests=array();
-
- ## Get Query Arguments from URL ###
- foreach ($_REQUEST as $key => $value) {
- if ($key != "PHPSESSID")
- $requests[] = $key.'='.$value;
- }
- if(is_array($requests))
- $request_string = implode("&", $requests);
-
- if(is_array($notices)) {
- foreach ($notices as $key => $value) {
- $date = date("m-d-y H:i:s", $key);
- $noticemsg = str_replace("'", "", $value['notice']);
- $noticemsg = str_replace('"', "", $noticemsg);
- $noticemsg = str_replace("\n", "", $noticemsg);
- $noticemsg = str_replace("<p>", "", $noticemsg);
- $noticemsg = str_replace("<pre>", "", $noticemsg);
- $noticemsg = str_replace("</pre>", "", $noticemsg);
- $noticemsg = str_replace("</p>", "", $noticemsg);
- $noticemsg = str_replace("<br>", "", $noticemsg);
- $extra_args = "";
- if($_GET['xml'])
- $extraargs="&xml=" . htmlspecialchars($_GET['xml']);
- if($_POST['xml'])
- $extraargs="&xml=" . htmlspecialchars($_POST['xml']);
- if($_GET['id'])
- $extraargs="&xml=" . htmlspecialchars($_GET['id']);
- if($_POST['id'])
- $extraargs="&xml=" . htmlspecialchars($_POST['id']);
- $notice_msgs = '<a href="?noticeaction=acknowledge&noticeid=all' . $extraargs . '">Acknowledge All</a> &nbsp;&nbsp;&nbsp;&nbsp;.:.&nbsp;&nbsp;&nbsp;&nbsp; ';
- if ($value['url']) {
- $notice_msgs .= $date.' - <a href="'.$url.'?' . htmlspecialchars($request_string) . '&noticeaction=acknowledge&noticeid='.$key.'">['.$value['id'].']</a>';
- } else {
- $notice_msgs .= $date.' - <a href="?' . htmlspecialchars($request_string) . '&noticeaction=acknowledge&noticeid='.$key.'">['.$value['id'].']'.htmlspecialchars($noticemsg).'</a>';
- }
- $notice_msgs .= " &nbsp;&nbsp;&nbsp;&nbsp;.:.&nbsp;&nbsp;&nbsp;&nbsp; ";
- }
- }
-?>
- <div id="alerts">
- <script type="text/javascript">
- var content='<div id="marquee-text"><?= $notice_msgs; ?></div>'
- </script>
- <script type="text/javascript" src="/javascript/ticker.js"></script>
- </div>
+ <div class="right" id="menu_messages">
<?
- } else {
+ echo get_menu_messages();
?>
- <div id="hostname">
- <? print $config['system']['hostname'] . "." . $config['system']['domain']; ?>
- </div>
-<?
- }
-?>
- </div>
+ </div>
</div>
</div>
</div> <!-- Header DIV -->
<div id="content">
<div id="left">
- <div id="navigation" style="z-index:1000">
+ <div id="navigation" style="z-index:1000;width:750px;" >
<ul id="menu">
<li class="firstdrop">
<div><?php echo gettext("System"); ?></div>
@@ -406,7 +344,10 @@ if ($_REQUEST['noticeaction'] == 'acknowledge') {
<div id="right">
<?php
-
+echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/domLib.js\"></script>\n";
+echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/domTT.js\"></script>\n";
+echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/behaviour.js\"></script>\n";
+echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/fadomatic.js\"></script>\n";
/* display a top alert bar if need be */
$need_alert_display = false;
$found_notices = are_notices_pending();
diff --git a/usr/local/www/index.php b/usr/local/www/index.php
index a59a652..c9efd0c 100755
--- a/usr/local/www/index.php
+++ b/usr/local/www/index.php
@@ -2,7 +2,7 @@
/* $Id$ */
/*
index.php
- Copyright (C) 2004, 2005 Scott Ullrich
+ Copyright (C) 2004-2012 Scott Ullrich
All rights reserved.
Originally part of m0n0wall (http://m0n0.ch/wall)
@@ -51,11 +51,19 @@ ini_set('output_buffering','true');
// Start buffering with a cache size of 100000
ob_start(null, "1000");
+
## Load Essential Includes
require_once('functions.inc');
require_once('guiconfig.inc');
require_once('notices.inc');
+if(isset($_REQUEST['closenotice'])){
+ include("functions.inc");
+ close_notice($_REQUEST['closenotice']);
+ echo get_menu_messages();
+ exit;
+}
+
if($g['disablecrashreporter'] != true) {
// Check to see if we have a crash report
$x = 0;
@@ -446,11 +454,6 @@ $closehead = false;
$pgtitle = array(gettext("Status: Dashboard"));
include("head.inc");
-echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/domLib.js\"></script>\n";
-echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/domTT.js\"></script>\n";
-echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/behaviour.js\"></script>\n";
-echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/fadomatic.js\"></script>\n";
-
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
diff --git a/usr/local/www/javascript/ticker.js b/usr/local/www/javascript/ticker.js
index 3e32e33..3c8b6cc 100755
--- a/usr/local/www/javascript/ticker.js
+++ b/usr/local/www/javascript/ticker.js
@@ -1,58 +1,59 @@
-<!--
-
-var width="310px";
-
-var speed=2;
-var pauseit=1;
-
-var divonclick=speed=(document.all)? speed : Math.max(1, speed-1);
-var copyspeed=speed;
-var pausespeed=(pauseit==0)? copyspeed: 0;
-var iedom=document.all||document.getElementById;
-
-if (iedom&&content)
- document.write('<span id="marquee-container">'+content+'</span>');
-
-var actualwidth='';
-var scroller;
-
-try {
- if (window.addEventListener)
- window.addEventListener("load", populatescroller, false);
- else if (window.attachEvent)
- window.attachEvent("onload", populatescroller);
- else if (document.all || document.getElementById)
- window.onload=populatescroller;
-}catch(e){}
-
-function populatescroller(){
- try {
- scroller=document.getElementById? document.getElementById("scroller") : document.all.scroller;
- scroller.style.left=parseInt(width)+8+"px";
- scroller.style.width = parseInt(document.getElementById("marquee-text").offsetWidth) + 40 + "px";
- scroller.innerHTML=content;
- document.getElementById("marquee-text");
- actualwidth=document.all? document.getElementById("marquee-text").offsetWidth : document.getElementById("marquee-text").offsetWidth;
- lefttime=setInterval("scrollmarquee()",20);
- }catch(e){}
+/* $Id$ */
+/*
+ functions.inc
+ Copyright (C) 2012 Marcello Coutinho
+ Copyright (C) 2012 Carlos Cesario - carloscesario@gmail.com
+ All rights reserved.
+
+ originally part of m0n0wall (http://m0n0.ch/wall)
+ Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ 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.
+
+ pfSense_MODULE: utils
+
+*/
+function notice_action(action,msgid) {
+ jQuery.ajax({
+ type: 'post',
+ cache: false,
+ url: 'index.php',
+ data: {closenotice: msgid},
+ success: function(response) {
+ jQuery('#menu_messages').html(response);
+ }
+ });
}
-function scrollmarquee(){
-
- try {
- if (parseInt(scroller.style.left)>(actualwidth*(-1)+8))
- scroller.style.left=parseInt(scroller.style.left)-copyspeed+"px";
- else
- scroller.style.left=parseInt(width)+8+"px";
- }catch(e){}
+function pulsateText(elem) {
+ jQuery(elem).effect("pulsate", { times:12 }, 500);
+ jQuery(elem).effect("pulsate", { times:6 }, 1500);
+ jQuery(elem).effect("pulsate", { times:3 }, 2500);
}
-if (iedom){
- document.write('<table id="marquee"><tr><td>');
- document.write('<div id="container" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=speed">');
- document.write('<div id="scroller"></div>');
- document.write('</div>');
- document.write('</td></tr></table>');
-}
-
-//-->
+jQuery(document).ready(function() {
+ pulsateText('#marquee-text');
+ jQuery('#marquee-text a').hover(function () {
+ jQuery(this).css('cursor','pointer');
+ });
+});
OpenPOWER on IntegriCloud