diff options
42 files changed, 894 insertions, 241 deletions
@@ -1,5 +1,6 @@ Changes for 1.3.4: + - developed PopUp menu for overview (Eugene) - added events.source (Alexei) - renamed events.triggerid -> events.sourceid (Alexei) - new tables drules,dchecks,dhosts,dservices (Alexei) diff --git a/frontends/php/actionconf.php b/frontends/php/actionconf.php index 273e0493..64e6d74d 100644 --- a/frontends/php/actionconf.php +++ b/frontends/php/actionconf.php @@ -30,8 +30,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); - $_REQUEST["actiontype"] = get_request("actiontype",get_profile("web.actionconf.actiontype",0)); ?> <?php diff --git a/frontends/php/config.php b/frontends/php/config.php index 72f78f49..33d533e3 100644 --- a/frontends/php/config.php +++ b/frontends/php/config.php @@ -29,7 +29,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php $fields=array( diff --git a/frontends/php/css.css b/frontends/php/css.css index e23fe861..c538d0c9 100644 --- a/frontends/php/css.css +++ b/frontends/php/css.css @@ -278,13 +278,11 @@ table.screen_view tr td.right_bttm { text-align: right; vertical-align: bottom; table.tableinfo { - border-spacing: 1px; /* cellspacing */ - background-color: #AAAAAA; color: #000000; width: 100%; + background-color: #AAAAAA; + border-spacing: 1px; /* cellspacing */ border-width: 0px; - border-style: solid; - border-color: #0B198C; } table.tableinfo tr td { white-space: nowrap; @@ -292,10 +290,8 @@ table.tableinfo tr td { font-family:verdana, arial, helvetica, sans-serif; font-size:8pt; text-decoration: none; - border-width: 0px; - border-style: solid; - border-color: #0B198C; text-align: left; + border-width: 0px; } table.tableinfo tr td.message { text-align: center; @@ -305,6 +301,7 @@ table.tableinfo tr.header td { word-spacing: 0px; font-weight: bold; background-color:#CCCCCC; + border-width: 0px; } table.tableinfo tr.vertical_header td { padding-left: 0px; @@ -317,7 +314,6 @@ table.tableinfo tr.vertical_header td { font-weight: bold; background-color:#CCCCCC; vertical-align:text-top; -/* vertical-align:text-bottom; /**/ text-align: center; width: 20px; } @@ -331,72 +327,43 @@ table.tableinfo tr.footer td { color: #FFFFFF; background: #5C7099 url(images/gradients/table_head2.gif) repeat-x top left; background-color: #6d88ad; - border-color: #000000; - border-width:0px; - border-top-style: solid; - border-left-style: solid; - border-right-style: solid; - border-bottom-style: solid; vertical-align: middle; padding-right: 5px; padding-left: 5px; } -table.tableinfo tr.odd_row td { background-color: #DDDDDD; } -table.tableinfo tr.odd_row:hover td { background-color: #DDDDEE; } +table.tableinfo tr.odd_row td { background-color: #DDDDDD; border: 1px #DDDDDD solid; } +table.tableinfo tr.odd_row:hover td { background-color: #DDDDEE; border: 1px #DDDDEE solid; } -table.tableinfo tr.even_row td { background-color: #EEEEEE; } -table.tableinfo tr.even_row:hover td { background-color: #EEEEFE; } +table.tableinfo tr.even_row td { background-color: #EEEEEE; border: 1px #EEEEEE solid; } +table.tableinfo tr.even_row:hover td { background-color: #EEEEFE; border: 1px #EEEEFE solid; } table.tableinfo tr td.center {vertical-align: middle; text-align: center; } -table.tableinfo tr td.disaster { background-color: #FF0000; } -table.tableinfo tr td.disaster_blink1 { background: #FF0000 url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr td.disaster_blink2 { background: #FF0000 url(images/gradients/blink2.gif) repeat top left; } -table.tableinfo tr:hover td.disaster { background-color: #FA0000; } -table.tableinfo tr:hover td.disaster_blink1 { background: #FA0000 url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr:hover td.disaster_blink2 { background: #FA0000 url(images/gradients/blink2.gif) repeat top left; } - -table.tableinfo tr td.high { background-color: #FF8888; } -table.tableinfo tr td.high_blink1 { background: #FF8888 url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr td.high_blink2 { background: #FF8888 url(images/gradients/blink2.gif) repeat top left; } -table.tableinfo tr:hover td.high { background-color: #FA8388; } -table.tableinfo tr:hover td.high_blink1 { background: #FA8388 url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr:hover td.high_blink2 { background: #FA8388 url(images/gradients/blink2.gif) repeat top left; } - -table.tableinfo tr td.average { background-color: #DDAAAA; } -table.tableinfo tr td.average_blink1 { background: #DDAAAA url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr td.average_blink2 { background: #DDAAAA url(images/gradients/blink2.gif) repeat top left; } -table.tableinfo tr:hover td.average { background-color: #D8A5AA; } -table.tableinfo tr:hover td.average_blink1 { background: #D8A5AA url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr:hover td.average_blink2 { background: #D8A5AA url(images/gradients/blink2.gif) repeat top left; } - -table.tableinfo tr td.warning { background-color: #EFEFCC; } -table.tableinfo tr td.warning_blink1 { background: #EFEFCC url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr td.warning_blink2 { background: #EFEFCC url(images/gradients/blink2.gif) repeat top left; } -table.tableinfo tr:hover td.warning { background-color: #EAEACC; } -table.tableinfo tr:hover td.warning_blink1 { background: #EAEACC url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr:hover td.warning_blink2 { background: #EAEACC url(images/gradients/blink2.gif) repeat top left; } - -table.tableinfo tr td.information { background-color: #CCE2CC; } -table.tableinfo tr td.information_blink1 { background: #CCE2CC url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr td.information_blink2 { background: #CCE2CC url(images/gradients/blink2.gif) repeat top left; } -table.tableinfo tr:hover td.information { background-color: #C7DDCC; } -table.tableinfo tr:hover td.information_blink1 { background: #C7DDCC url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr:hover td.information_blink2 { background: #C7DDCC url(images/gradients/blink2.gif) repeat top left; } - -table.tableinfo tr td.unknown_trigger { background-color: #BCBCBC; } -table.tableinfo tr td.unknown_trigger_blink1 { background: #BCBCBC url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr td.unknown_trigger_blink2 { background: #BCBCBC url(images/gradients/blink2.gif) repeat top left; } -table.tableinfo tr:hover td.unknown_trigger { background-color: #BCBCBC; } -table.tableinfo tr:hover td.unknown_trigger_blink1 { background: #BCBCBC url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr:hover td.unknown_trigger_blink2 { background: #BCBCBC url(images/gradients/blink2.gif) repeat top left; } - -table.tableinfo tr td.normal { background-color: #AADDAA; } -table.tableinfo tr td.normal_blink1 { background: #AADDAA url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr td.normal_blink2 { background: #AADDAA url(images/gradients/blink2.gif) repeat top left; } -table.tableinfo tr:hover td.normal { background-color: #AADDAA; } -table.tableinfo tr:hover td.normal_blink1 { background: #AADDAA url(images/gradients/blink1.gif) repeat top left; } -table.tableinfo tr:hover td.normal_blink2 { background: #AADDAA url(images/gradients/blink2.gif) repeat top left; } +table.tableinfo tr td.disaster { background-color: #FF0000; border: 1px #FF0000 solid; } +table.tableinfo tr:hover td.disaster { background-color: #FA0000; border: 1px #FA0000 solid; } +table.tableinfo tr td.disaster:hover { cursor: pointer; border: 1px #0C0CF0 dotted; } + +table.tableinfo tr td.high { background-color: #FF8888; border: 1px #FF8888 solid; } +table.tableinfo tr:hover td.high { background-color: #FA8388; border: 1px #FA8388 solid; } +table.tableinfo tr td.high:hover { cursor: pointer; border: 1px #0C0CF0 dotted; } + +table.tableinfo tr td.average { background-color: #DDAAAA; border: 1px #DDAAAA solid; } +table.tableinfo tr:hover td.average { background-color: #D8A5AA; border: 1px #D8A5AA solid; } +table.tableinfo tr td.average:hover { cursor: pointer; border: 1px #0C0CF0 dotted; } + +table.tableinfo tr td.warning { background-color: #EFEFCC; border: 1px #EFEFCC solid; } +table.tableinfo tr:hover td.warning { background-color: #EAEACC; border: 1px #EAEACC solid; } +table.tableinfo tr td.warning:hover { cursor: pointer; border: 1px #0C0CF0 dotted; } + +table.tableinfo tr td.information { background-color: #CCE2CC; border: 1px #CCE2CC solid; } +table.tableinfo tr:hover td.information { background-color: #C7DDCC; border: 1px #C7DDCC solid; } +table.tableinfo tr td.information:hover { cursor: pointer; border: 1px #0C0CF0 dotted; } + +table.tableinfo tr td.unknown_trigger { background-color: #BCBCBC; border: 1px #BCBCBC solid; } +table.tableinfo tr:hover td.unknown_trigger { background-color: #BCB7BC; border: 1px #BCB7BC solid; } +table.tableinfo tr td.unknown_trigger:hover { cursor: pointer; border: 1px #0C0CF0 dotted; } + +table.tableinfo tr td.normal { background-color: #AADDAA; border: 1px #AADDAA solid; } /****** HEADER *********/ @@ -1053,6 +1020,45 @@ ul /************** END OF HINT BOX ************/ +/**************** POPUP MENU ***************/ + +/* default menu item */ +.pum_o_item { + font-family: sans-serif, Tahoma, Verdana, Geneva, Arial, Helvetica; + font-size: 12px; + text-decoration: none; + background-color: #ECECFF; + border: black 1px solid; + margin: 0px; +} +.pum_o_item:hover { + text-decoration: underline; + background-color: #FDFDFF; +} +.pum_i_item { + margin: 3px 0px 0px 8px; + +} + +/* menu group header */ +.pum_oheader { + cursor: default; + text-decoration: none; + border: black 1px solid; + background: #5C7099 url(images/gradients/table_head2.gif) repeat-x top left; + margin: 0px; +} +.pum_oheader:hover { + text-decoration: none; +} +.pum_iheader { + color: #FFFFFF; + font-weight: bold; + margin: 3px 0px 0px 8px; +} + +/************ END OF POPUP MENU ************/ + /************** COLOR PICKER ***************/ #color_picker { diff --git a/frontends/php/exp_imp.php b/frontends/php/exp_imp.php index 031425b8..8fef5f92 100644 --- a/frontends/php/exp_imp.php +++ b/frontends/php/exp_imp.php @@ -38,10 +38,6 @@ include_once "include/page_header.php"; $_REQUEST["config"] = get_request("config",get_profile("web.exp_imp.config",0)); - if(!isset($EXPORT_DATA)) - { - insert_confirm_javascript(); - } ?> <?php $fields=array( diff --git a/frontends/php/graphs.php b/frontends/php/graphs.php index 3d7f96e4..44329377 100644 --- a/frontends/php/graphs.php +++ b/frontends/php/graphs.php @@ -29,7 +29,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION diff --git a/frontends/php/history.php b/frontends/php/history.php index d7f106db..67764075 100644 --- a/frontends/php/history.php +++ b/frontends/php/history.php @@ -37,9 +37,6 @@ include_once "include/page_header.php"; - if(!isset($_REQUEST["plaintext"])) - insert_confirm_javascript(); - ?> <?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION diff --git a/frontends/php/hostprofiles.php b/frontends/php/hostprofiles.php index 3f8a49cb..f5751ffe 100644 --- a/frontends/php/hostprofiles.php +++ b/frontends/php/hostprofiles.php @@ -28,7 +28,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index 2ba690ec..b14f8798 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -28,8 +28,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); - $_REQUEST["config"] = get_request("config",get_profile("web.hosts.config",0)); $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_WRITE,null,PERM_RES_IDS_ARRAY,$ZBX_CURNODEID); diff --git a/frontends/php/httpconf.php b/frontends/php/httpconf.php index 0149ee0c..ec5b82b6 100644 --- a/frontends/php/httpconf.php +++ b/frontends/php/httpconf.php @@ -29,7 +29,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php diff --git a/frontends/php/httpdetails.php b/frontends/php/httpdetails.php index 24bd9b89..6be1fde3 100644 --- a/frontends/php/httpdetails.php +++ b/frontends/php/httpdetails.php @@ -30,7 +30,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php diff --git a/frontends/php/httpmon.php b/frontends/php/httpmon.php index 159e4b6b..35d87a01 100644 --- a/frontends/php/httpmon.php +++ b/frontends/php/httpmon.php @@ -30,7 +30,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php diff --git a/frontends/php/include/classes/ccolor.inc.php b/frontends/php/include/classes/ccolor.inc.php index 2e9d6ca9..3ebc2c28 100644 --- a/frontends/php/include/classes/ccolor.inc.php +++ b/frontends/php/include/classes/ccolor.inc.php @@ -209,7 +209,7 @@ else if (document.getElementById) $txt = new CTextBox($name,$value,7); $txt->AddOption('id', $name); - $txt->AddOption('onChange', 'set_color_by_name(\''.$name.'\',this.value)'); + $txt->AddAction('onChange', 'set_color_by_name(\''.$name.'\',this.value)'); $txt->AddOption('style', 'margin: 0px'); $this->AddItem(array($txt, $lbl)); diff --git a/frontends/php/include/classes/ccombobox.inc.php b/frontends/php/include/classes/ccombobox.inc.php index d05020d7..79d50f3d 100644 --- a/frontends/php/include/classes/ccombobox.inc.php +++ b/frontends/php/include/classes/ccombobox.inc.php @@ -177,8 +177,8 @@ inseret_javascript_for_editable_combobox(); parent::CComboBox($name,$value,$action); - parent::AddOption('onfocus','CEditableComboBoxInit(this);'); - parent::AddOption('onchange','CEditableComboBoxOnChange(this,'.$size.');'); + parent::AddAction('onfocus','CEditableComboBoxInit(this);'); + parent::AddAction('onchange','CEditableComboBoxOnChange(this,'.$size.');'); } function AddItem($value, $caption='', $selected=NULL, $enabled='yes') diff --git a/frontends/php/include/classes/cpumenu.inc.php b/frontends/php/include/classes/cpumenu.inc.php new file mode 100644 index 00000000..1b697941 --- /dev/null +++ b/frontends/php/include/classes/cpumenu.inc.php @@ -0,0 +1,53 @@ +<?php +/* +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +**/ +?> +<?php + class CPUMenu + { +/* private */ + /* + var $items = array(); + var $width; + */ +/* public */ + function CPUMenu($items=array(), $width=null) + { + $this->InsertJavaScript(); + $this->items = $items; + $this->width = $width; + } + + function GetOnActionJS() + { + if(count($this->items) <= 0) return NULL; + + return 'return show_popup_menu(event,'.zbx_jsvalue($this->items).','.zbx_jsvalue($this->width).');'; + } + + function InsertJavaScript() + { + if(defined('CPUMENU_INSERTJAVASCRIPT_INSERTED')) return; + define('CPUMENU_INSERTJAVASCRIPT_INSERTED', 1); +?> +<script language="JavaScript" type="text/javascript" src="js/menu.js"></script> +<?php + } + } +?> diff --git a/frontends/php/include/classes/ctag.inc.php b/frontends/php/include/classes/ctag.inc.php index 2b462617..df7d91ae 100644 --- a/frontends/php/include/classes/ctag.inc.php +++ b/frontends/php/include/classes/ctag.inc.php @@ -228,13 +228,21 @@ $code = "show_hint(this,event,'".$text."');"; } - $this->AddOption('onMouseOver', $code); - $this->AddOption('onMouseMove', $code); + $this->AddAction('onMouseOver', $code); + $this->AddAction('onMouseMove', $code); } function OnClick($handle_code) { - $this->AddOption('onClick', $handle_code); + $this->AddAction('onClick', $handle_code); + } + + function AddAction($name, $value) + { + if(isset($value)) + $this->options[$name] = str_replace("\n", '', strval($value)); + else + unset($this->options[$name]); } function AddOption($name, $value) @@ -244,6 +252,7 @@ else unset($this->options[$name]); } + function SetEnabled($value='yes') { if((is_string($value) && ($value == 'yes' || $value == 'enabled' || $value=='on') || $value=='1') diff --git a/frontends/php/include/classes/ctextbox.inc.php b/frontends/php/include/classes/ctextbox.inc.php index c1bd3134..a261f7dc 100644 --- a/frontends/php/include/classes/ctextbox.inc.php +++ b/frontends/php/include/classes/ctextbox.inc.php @@ -70,10 +70,10 @@ parent::CTextBox($name,$value,$size,$readonly); $this->AddOption('MaxLength', $size); $this->AddOption('Style', 'text-align: right;'); - $this->AddOption('OnKeyPress', + $this->AddAction('OnKeyPress', ' var c = (window.event) ? event.keyCode : event.which;'. ' if(event.ctrlKey || c <= 31 || (c >= 48 && c <= 57)) return true; else return false; '); - $this->AddOption('OnChange', + $this->AddAction('OnChange', ($allowempty ? ' if(this.value.length==0 || this.value==null) this.value = \'\'; else ' : ''). ' if(isNaN(parseInt(this.value))) this.value = 0; '. ' else this.value = parseInt(this.value);' @@ -101,10 +101,10 @@ if($i != 3) { $this->ip_parts[$i]->tag_end = ''; - $this->ip_parts[$i]->AddOption('OnKeyDown', + $this->ip_parts[$i]->AddAction('OnKeyDown', ' this.maxlength = this.getAttribute("maxlength"); '. ' this.oldlength = this.value.length; '); - $this->ip_parts[$i]->AddOption('OnKeyUp', + $this->ip_parts[$i]->AddAction('OnKeyUp', ' if(this.oldlength != this.value.length && this.value.length == this.maxlength) {'. ' var el = this.form.elements["'.$name.'['.($i+1).']'.'"];'. ' if(el) { el.focus(); el.select(); }}'); diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index fd1ee764..367a0d71 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -58,6 +58,7 @@ function VDP($var, $msg=null) { echo "DEBUG DUMP: "; if(isset($msg)) echo '"'.$m require_once("include/classes/cmap.inc.php"); require_once("include/classes/cflash.inc.php"); require_once("include/classes/ciframe.inc.php"); + require_once("include/classes/cpumenu.inc.php"); require_once("include/classes/graph.inc.php"); // Include Tactical Overview modules @@ -205,7 +206,41 @@ function VDP($var, $msg=null) { echo "DEBUG DUMP: "; if(isset($msg)) echo '"'.$m */ function zbx_jsstr($str) { - return htmlspecialchars(str_replace("\n", '\n', str_replace("\r", '', $str))); + return htmlspecialchars(str_replace("\n", '\n', str_replace("\r", '', $str))); + } + + /* function: + * zbx_jsvalue + * + * description: + * convert PHP variable to string version + * of JavaScrip style + * + * author: Eugene Grigorjev + */ + function zbx_jsvalue(&$value) + { + if(!is_array($value)) + { + if(is_object($value)) return unpack_object($value); + if(is_string($value)) return '\''.str_replace('\'','\\\'',zbx_jsstr($value)).'\''; + if(is_null($value)) return 'null'; + return strval($value); + } + + if(count($value) == 0) return '[]'; + + foreach($value as $id => $v) + { + if(!isset($is_object) && is_string($id)) $is_object = true; + + $value[$id] = (isset($is_object) ? '\''.$id.'\' : ' : '').zbx_jsvalue($v); + } + + if(isset($is_object)) + return '{'.implode(',',$value).'}'; + else + return '['.implode(',',$value).']'; } /* function: @@ -1456,25 +1491,6 @@ function GetPos(obj) var hint_box = null; -function get_cursor_position(e) -{ - e = e || window.event; - var cursor = {x:0, y:0}; - if (e.pageX || e.pageY) { - cursor.x = e.pageX; - cursor.y = e.pageY; - } - else { - var de = document.documentElement; - var b = document.body; - cursor.x = e.clientX + - (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0); - cursor.y = e.clientY + - (de.scrollTop || b.scrollTop) - (de.clientTop || 0); - } - return cursor; -} - function hide_hint() { if(!hint_box) return; @@ -1543,110 +1559,6 @@ else if (document.getElementById) <?php } - function insert_confirm_javascript() - { -?> -<script language="JavaScript" type="text/javascript"> -<!-- - function Redirect(url) { - window.location = url; - return false; - } - - function create_var(form_name, var_name, var_val, submit) - { - var frmForm = document.forms[form_name]; - - if(!frmForm) return false; - - var objVar = document.createElement('input'); - - if(!objVar) return false; - - objVar.setAttribute('type', 'hidden'); - objVar.setAttribute('name', var_name); - objVar.setAttribute('value', var_val); - - frmForm.appendChild(objVar); - if(submit) - frmForm.submit(); - - return false; - } - - function Confirm(msg) - { - if(confirm(msg,'title')) - return true; - else - return false; - } - function PopUp(url,width,height,form_name) - { - if(!width) width = 600; - if(!height) height = 450; - if(!form_name) form_name = 'zbx_popup'; - - var left = (screen.width-(width+150))/2; - var top = (screen.height-(height+150))/2; - - var popup = window.open(url,form_name,'width=' + width +',height=' + height + ',top='+ top +',left='+ left + - ',resizable=yes,scrollbars=yes,location=no,menubar=no'); - - popup.focus(); - - return false; - } - - function CheckAll(form_name, chkMain, shkName) - { - var frmForm = document.forms[form_name]; - var value = frmForm.elements[chkMain].checked; - for (var i=0; i < frmForm.length; i++) - { - name = frmForm.elements[i].name.split('[')[0]; - if(frmForm.elements[i].type != 'checkbox') continue; - if(name == chkMain) continue; - if(shkName && shkName != name) continue; - if(frmForm.elements[i].disabled == true) continue; - frmForm.elements[i].checked = value; - } - } - - function GetSelectedText(obj) - { - if (navigator.appName == "Microsoft Internet Explorer") - { - obj.focus(); - return document.selection.createRange().text; - } - else (obj.selectionStart) - { - if(obj.selectionStart != obj.selectionEnd) { - var s = obj.selectionStart; - var e = obj.selectionEnd; - return obj.value.substring(s, e); - } - } - return obj.value; - } - - function ScaleChartToParenElement(obj_name) - { - var obj = document.getElementsByName(obj_name); - - if(obj.length <= 0) throw "Can't find objects with name [" + obj_name +"]"; - - for(i = obj.length-1; i>=0; i--) - { - obj[i].src += "&width=" + (obj[i].parentNode.offsetWidth - obj[i].parentNode.offsetLeft - 10); - } - } -//--> -</script> -<?php - } - function Redirect($url) { zbx_flush_post_cookies(); diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php index 5245e24e..eab54baa 100644 --- a/frontends/php/include/locales/en_gb.inc.php +++ b/frontends/php/include/locales/en_gb.inc.php @@ -795,6 +795,9 @@ "S_OVERVIEW_BIG"=> "OVERVIEW", "S_EXCL"=> "!", "S_DATA"=> "Data", + "S_SHOW_GRAPH_OF_ITEM"=> "Show graph of item", + "S_SHOW_VALUES_OF_ITEM"=> "Show values of item", + "S_VALUES"=> "Values", // queue.php "S_QUEUE_BIG"=> "QUEUE", diff --git a/frontends/php/include/page_header.php b/frontends/php/include/page_header.php index 2704f8a0..5428a3f4 100644 --- a/frontends/php/include/page_header.php +++ b/frontends/php/include/page_header.php @@ -340,6 +340,7 @@ COpt::profiling_start("page"); <?php } ?> <link rel="stylesheet" href="css.css"> <meta name="Author" content="ZABBIX SIA"> + <script type="text/javascript" src="js/common.js"></script> </head> <body onLoad="zbxCallPostScripts();"> <?php diff --git a/frontends/php/include/triggers.inc.php b/frontends/php/include/triggers.inc.php index fffc4573..a2956927 100644 --- a/frontends/php/include/triggers.inc.php +++ b/frontends/php/include/triggers.inc.php @@ -1095,7 +1095,7 @@ $group_where = ' where'; } - $result=DBselect('select distinct t.description,t.value,t.priority,t.lastchange,h.hostid,h.host'. + $result=DBselect('select distinct t.triggerid,t.description,t.value,t.priority,t.lastchange,h.hostid,h.host'. ' from hosts h,items i,triggers t, functions f '.$group_where. ' h.status='.HOST_STATUS_MONITORED.' and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=t.triggerid'. ' and h.hostid in ('.get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY, null, null, $nodeid).') '. @@ -1107,6 +1107,8 @@ { $hosts[$row['host']] = $row['host']; $triggers[$row['description']][$row['host']] = array( + 'hostid' => $row['hostid'], + 'triggerid' => $row['triggerid'], 'value' => $row['value'], 'lastchange' => $row['lastchange'], 'priority' => $row['priority']); @@ -1130,6 +1132,7 @@ foreach($hosts as $hostname) { $style = NULL; + unset($tr_ov_menu); if(isset($trhosts[$hostname])) { switch($trhosts[$hostname]['value']) @@ -1143,10 +1146,82 @@ $style = 'unknown_trigger'; } - if((time(NULL)-$trhosts[$hostname]['lastchange'])<300) $style .= '_blink1'; - elseif((time(NULL)-$trhosts[$hostname]['lastchange'])<900) $style .= '_blink2'; + if((time(NULL)-$trhosts[$hostname]['lastchange'])<300) + $style_img = 'background-image: url(images/gradients/blink1.gif); '. + 'background-position: top left; '. + 'background-repeat: repeate;'; + elseif((time(NULL)-$trhosts[$hostname]['lastchange'])<900) + $style_img = 'background-image: url(images/gradients/blink2.gif); '. + 'background-position: top left; '. + 'background-repeat: repeate;'; + + unset($item_menu); + $tr_ov_menu = array( + /* name, url, (target [tw], statusbar [sb]), css, submenu */ + array(S_TRIGGER, null, null, + array('outer'=> array('pum_oheader'), 'inner'=>array('pum_iheader')) + ), + array(S_EVENTS, 'tr_events.php?triggerid='.$trhosts[$hostname]['triggerid'], array('tw'=>'_blank')) + ); + + $db_items = DBselect('select distinct i.itemid, i.description, i.key_, i.value_type '. + ' from items i, functions f '. + ' where f.itemid=i.itemid and f.triggerid='.$trhosts[$hostname]['triggerid']); + + while($item_data = DBfetch($db_items)) + { + $description = item_description($item_data['description'], $item_data['key_']); + switch($item_data['value_type']) + { + case ITEM_VALUE_TYPE_UINT64: + case ITEM_VALUE_TYPE_FLOAT: + $action = 'showgraph'; + $status_bar = S_SHOW_GRAPH_OF_ITEM.' \''.$description.'\''; + break; + case ITEM_VALUE_TYPE_LOG: + case ITEM_VALUE_TYPE_STR: + case ITEM_VALUE_TYPE_TEXT: + default: + $action = 'showlatest'; + $status_bar = S_SHOW_VALUES_OF_ITEM.' \''.$description.'\''; + break; + } + + if(strlen($description) > 25) $description = substr($description,0,22).'...'; + + $item_menu[$action][] = array( + $description, + 'history.php?action='.$action.'&itemid='.$item_data['itemid'].'&period=3600', + array('tw'=>'_blank', 'sb'=>$status_bar)); + } + if(isset($item_menu['showgraph'])) + { + $tr_ov_menu[] = array(S_GRAPHS, null, null, + array('outer'=> array('pum_oheader'), 'inner'=>array('pum_iheader')) + ); + $tr_ov_menu = array_merge($tr_ov_menu, $item_menu['showgraph']); + } + if(isset($item_menu['showlatest'])) + { + $tr_ov_menu[] = array(S_VALUES, null, null, + array('outer'=> array('pum_oheader'), 'inner'=>array('pum_iheader')) + ); + $tr_ov_menu = array_merge($tr_ov_menu, $item_menu['showlatest']); + } + + unset($item_menu); + } + + $status_col = new CCol(SPACE,$style); + if(isset($style_img)) + $status_col->AddOption('style', $style_img); + + if(isset($tr_ov_menu)) + { + $tr_ov_menu = new CPUMenu($tr_ov_menu,170); + $status_col->OnClick($tr_ov_menu->GetOnActionJS()); } - array_push($table_row,new CCol(SPACE,$style)); + array_push($table_row,$status_col); } $table->AddRow($table_row); } diff --git a/frontends/php/items.php b/frontends/php/items.php index 48921463..acfb1f83 100644 --- a/frontends/php/items.php +++ b/frontends/php/items.php @@ -29,7 +29,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION diff --git a/frontends/php/js/common.js b/frontends/php/js/common.js new file mode 100644 index 00000000..081e17c9 --- /dev/null +++ b/frontends/php/js/common.js @@ -0,0 +1,151 @@ +/* +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +**/ +function get_scroll_pos() +{ + var scrOfX = 0, scrOfY = 0; + if( typeof( window.pageYOffset ) == 'number' ) + { //Netscape compliant + scrOfY = window.pageYOffset; + scrOfX = window.pageXOffset; + } + else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) + { //DOM compliant + scrOfY = document.body.scrollTop; + scrOfX = document.body.scrollLeft; + } + else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) + { //IE6 standards compliant mode + scrOfY = document.documentElement.scrollTop; + scrOfX = document.documentElement.scrollLeft; + } + return [ scrOfX, scrOfY ]; +} +function get_cursor_position(e) +{ + e = e || window.event; + var cursor = {x:0, y:0}; + if (e.pageX || e.pageY) { + cursor.x = e.pageX; + cursor.y = e.pageY; + } + else { + var de = document.documentElement; + var b = document.body; + cursor.x = e.clientX + + (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0); + cursor.y = e.clientY + + (de.scrollTop || b.scrollTop) - (de.clientTop || 0); + } + return cursor; +} + +function Redirect(url) { + window.location = url; + return false; +} + +function create_var(form_name, var_name, var_val, submit) +{ + var frmForm = document.forms[form_name]; + + if(!frmForm) return false; + + var objVar = document.createElement('input'); + + if(!objVar) return false; + + objVar.setAttribute('type', 'hidden'); + objVar.setAttribute('name', var_name); + objVar.setAttribute('value', var_val); + + frmForm.appendChild(objVar); + if(submit) + frmForm.submit(); + + return false; +} + +function Confirm(msg) +{ + if(confirm(msg,'title')) + return true; + else + return false; +} +function PopUp(url,width,height,form_name) +{ + if(!width) width = 600; + if(!height) height = 450; + if(!form_name) form_name = 'zbx_popup'; + + var left = (screen.width-(width+150))/2; + var top = (screen.height-(height+150))/2; + + var popup = window.open(url,form_name,'width=' + width +',height=' + height + ',top='+ top +',left='+ left + + ',resizable=yes,scrollbars=yes,location=no,menubar=no'); + + popup.focus(); + + return false; +} + +function CheckAll(form_name, chkMain, shkName) +{ + var frmForm = document.forms[form_name]; + var value = frmForm.elements[chkMain].checked; + for (var i=0; i < frmForm.length; i++) + { + name = frmForm.elements[i].name.split('[')[0]; + if(frmForm.elements[i].type != 'checkbox') continue; + if(name == chkMain) continue; + if(shkName && shkName != name) continue; + if(frmForm.elements[i].disabled == true) continue; + frmForm.elements[i].checked = value; + } +} + +function GetSelectedText(obj) +{ + if (navigator.appName == "Microsoft Internet Explorer") + { + obj.focus(); + return document.selection.createRange().text; + } + else (obj.selectionStart) + { + if(obj.selectionStart != obj.selectionEnd) { + var s = obj.selectionStart; + var e = obj.selectionEnd; + return obj.value.substring(s, e); + } + } + return obj.value; +} + +function ScaleChartToParenElement(obj_name) +{ + var obj = document.getElementsByName(obj_name); + + if(obj.length <= 0) throw "Can't find objects with name [" + obj_name +"]"; + + for(i = obj.length-1; i>=0; i--) + { + obj[i].src += "&width=" + (obj[i].parentNode.offsetWidth - obj[i].parentNode.offsetLeft - 10); + } +} diff --git a/frontends/php/js/menu.js b/frontends/php/js/menu.js new file mode 100644 index 00000000..1824a5be --- /dev/null +++ b/frontends/php/js/menu.js @@ -0,0 +1,479 @@ +/* +** ZABBIX +** Copyright (C) 2000-2005 SIA Zabbix +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +**/ + +// Title: tigra menu +// Description: See the demo at url +// URL: http://www.softcomplex.com/products/tigra_menu/ +// Version: 2.0 (commented source) +// Date: 04-05-2003 (mm-dd-yyyy) +// Tech. Support: http://www.softcomplex.com/forum/forumdisplay.php?fid=40 +// Notes: This script is free. Visit official site for further details. +// This script adapted by Eugene Grigorjev for using as popup menu +// of ZABBIX software. See http://www.zabbix.com. + +function show_popup_menu(e, content, width) +{ + if(!width) width = 170; + + var pos = [ + {'block_top': -12, 'block_left': -5, 'width': width}, + {'block_top': 5, 'block_left': width-5, 'width': width} + ]; + + var cursor = get_cursor_position(e); + + new popup_menu (content, pos, cursor.x, cursor.y); +} + +// -------------------------------------------------------------------------------- +// global collection containing all menus on current page +var A_MENUS = []; + +// -------------------------------------------------------------------------------- +// menu class +function popup_menu (a_items, a_tpl, x, y) { + + // browser check + if (!document.body || !document.body.style) + return; + + this.n_scroll_left = get_scroll_pos()[0]; + this.n_scroll_top = get_scroll_pos()[1]; + + if(document.body.clientWidth) + { + this.n_scr_width = document.body.clientWidth; + this.n_scr_height = document.body.clientHeight; + } + else + { + this.n_scr_width = document.width; + this.n_scr_height = document.height; + } + + // store items structure + this.a_config = a_items; + + // store template structure + this.a_tpl = a_tpl; + + // get menu id + this.n_id = A_MENUS.length; + + // declare collections + this.a_index = []; + this.a_children = []; + + // assigh methods and event handlers + this.expand = menu_expand; + this.collapse = menu_collapse; + + this.onclick = menu_onclick; + this.onmouseout = menu_onmouseout; + this.onmouseover = menu_onmouseover; + this.onmousedown = menu_onmousedown; + + this.getstyle = mitem_getstyle; + + this.set_x_direction = mitem_set_x_direction; + this.get_x_direction = mitem_get_x_direction; + this.set_y_direction = mitem_set_y_direction; + this.get_y_direction = mitem_get_y_direction; + + // default level scope description structure + this.a_tpl_def = { + 'block_top' : 0, + 'block_left' : 0, + 'top' : 23, + 'left' : 0, + 'width' : 170, + 'height' : 24, + 'hide_delay' : 200, + 'expd_delay' : 200 + }; + + /* default css */ + this.a_css_def = { + 'outer' : ['pum_o_item'], + 'inner' : ['pum_i_item'] + }; + + + // assign methods and properties required to imulate parent item + this.getprop = function (s_key) { + return this.a_tpl_def[s_key]; + }; + + this.o_root = this; + this.n_depth = -1; + this.n_x = x; + this.n_y = y; + + // init items recursively + for (n_order = 0; n_order < a_items.length; n_order++) + new menu_item(this, n_order); + + // register self in global collection + A_MENUS[this.n_id] = this; + + // make root level visible + for (var n_order = 0; n_order < this.a_children.length; n_order++) + this.a_children[n_order].e_oelement.style.visibility = 'visible'; +} + +// -------------------------------------------------------------------------------- +function mitem_set_x_direction(n_val) { + this.n_x_direction = n_val; +} + +function mitem_get_x_direction() { + return (this.n_x_direction ? this.n_x_direction : null); +} + +function mitem_set_y_direction(n_val) { + this.n_y_direction = n_val; +} + +function mitem_get_y_direction() { + return (this.n_y_direction ? this.n_y_direction : null); +} + +// -------------------------------------------------------------------------------- +function menu_collapse (n_id) { + // cancel item open delay + clearTimeout(this.o_showtimer); + + // by default collapse all levels + var n_tolevel = (n_id ? this.a_index[n_id].n_depth : -1); + + if(-1 == n_tolevel) + { + for (n_id = 0; n_id < this.a_index.length; n_id++) + { + var o_curritem = this.a_index[n_id]; + if(o_curritem) + { + var e_oelement = document.getElementById(o_curritem.e_oelement.id); + document.body.removeChild(e_oelement); + } + } + A_MENUS.splice(this.o_root.n_id); + } + else + { + // hide all items over the level specified + for (n_id = 0; n_id < this.a_index.length; n_id++) { + var o_curritem = this.a_index[n_id]; + if (o_curritem && o_curritem.n_depth > n_tolevel && o_curritem.b_visible) { + o_curritem.e_oelement.style.visibility = 'hidden'; + o_curritem.b_visible = false; + } + } + } + + // reset current item if mouse has gone out of items + if (!n_id) + this.o_current = null; +} + +// -------------------------------------------------------------------------------- +function menu_expand (n_id) { + + // expand only when mouse is over some menu item + if (this.o_hidetimer) + return; + + // lookup current item + var o_item = this.a_index[n_id]; + + // close previously opened items + if (this.o_current && this.o_current.n_depth >= o_item.n_depth) + this.collapse(o_item.n_id); + this.o_current = o_item; + + // exit if there are no children to open + if (!o_item.a_children) + return; + + // show direct child items + for (var n_order = 0; n_order < o_item.a_children.length; n_order++) { + var o_curritem = o_item.a_children[n_order]; + o_curritem.e_oelement.style.visibility = 'visible'; + o_curritem.b_visible = true; + } +} + +// -------------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------------- +function menu_onclick (n_id) { + // don't go anywhere if item has no link defined + return Boolean(this.a_index[n_id].a_config[1]); +} + +// -------------------------------------------------------------------------------- +function menu_onmouseout (n_id) { + + // lookup new item's object + var o_item = this.a_index[n_id]; + + // apply rollout + o_item.e_oelement.className = o_item.getstyle(0, 0); + o_item.e_ielement.className = o_item.getstyle(1, 0); + + // update status line + o_item.upstatus(7); + + // run mouseover timer + this.o_hidetimer = setTimeout('A_MENUS['+ this.n_id +'].collapse();', o_item.getprop('hide_delay')); +} + +// -------------------------------------------------------------------------------- +function menu_onmouseover (n_id) { + + // cancel mouseoute menu close and item open delay + clearTimeout(this.o_hidetimer); + this.o_hidetimer = null; + clearTimeout(this.o_showtimer); + + // lookup new item's object + var o_item = this.a_index[n_id]; + + // update status line + o_item.upstatus(); + + // apply rollover + o_item.e_oelement.className = o_item.getstyle(0, 1); + o_item.e_ielement.className = o_item.getstyle(1, 1); + + // if onclick open is set then no more actions required + if (o_item.getprop('expd_delay') < 0) + return; + + // run expand timer + this.o_showtimer = setTimeout('A_MENUS['+ this.n_id +'].expand(' + n_id + ');', + o_item.getprop('expd_delay')); + +} + +// -------------------------------------------------------------------------------- +// called when mouse button is pressed on menu item +// -------------------------------------------------------------------------------- +function menu_onmousedown (n_id) { + + // lookup new item's object + var o_item = this.a_index[n_id]; + + // apply mouse down style + o_item.e_oelement.className = o_item.getstyle(0, 2); + o_item.e_ielement.className = o_item.getstyle(1, 2); + + this.expand(n_id); +// this.items[id].switch_style('onmousedown'); +} + + +// -------------------------------------------------------------------------------- +// menu item Class +function menu_item (o_parent, n_order) { + + // store parameters passed to the constructor + this.n_depth = o_parent.n_depth + 1; + + var item_offset = this.n_depth ? 4 : 0; + this.a_config = o_parent.a_config[n_order + item_offset]; + + // return if required parameters are missing + if (!this.a_config || !this.a_config[0]) + { + return; + } + + // store info from parent item + this.o_root = o_parent.o_root; + this.o_parent = o_parent; + this.n_order = n_order; + + // register in global and parent's collections + this.n_id = this.o_root.a_index.length + 1; + this.o_root.a_index[this.n_id] = this; + o_parent.a_children[n_order] = this; + + // calculate item's coordinates + var o_root = this.o_root, + a_tpl = this.o_root.a_tpl; + + this.a_css = this.a_config[3] ? this.a_config[3] : null; + + // assign methods + this.getprop = mitem_getprop; + this.getstyle = mitem_getstyle; + this.upstatus = mitem_upstatus; + + this.set_x_direction = mitem_set_x_direction; + this.get_x_direction = mitem_get_x_direction; + this.set_y_direction = mitem_set_y_direction; + this.get_y_direction = mitem_get_y_direction; + + if(!o_parent.n_x_direction && !n_order) + { + // calculate menu direction in first element + o_parent.set_x_direction( + (this.getprop('width') + o_parent.n_x + this.getprop('block_left') + > o_root.n_scr_width + o_root.n_scroll_left) + ? -1 : 1 + ); + } + + this.n_x = n_order + ? o_parent.a_children[n_order - 1].n_x + this.getprop('left') * o_parent.get_x_direction() + : o_parent.n_x + this.getprop('block_left') * o_parent.get_x_direction(); + + if(-1 == o_parent.get_x_direction() && o_parent == o_root && !n_order) + { + this.n_x -= this.getprop('width'); + } + + if(!o_parent.n_y_direction && !n_order) + { + //alert("w: " +this.getprop('height') +" i:" + (o_parent.a_config.length - item_offset) ); + // calculate menu direction in first element + o_parent.set_y_direction( + (this.getprop('height') * (o_parent.a_config.length - item_offset) + o_parent.n_y + this.getprop('block_top') + > o_root.n_scr_height + o_root.n_scroll_top) + ? -1 : 1 + ); + } + + this.n_y = n_order + ? o_parent.a_children[n_order - 1].n_y + this.getprop('top') + : o_parent.n_y + this.getprop('block_top') * (o_parent == o_root ? o_parent.get_y_direction() : 1); + + if(-1 == o_parent.get_y_direction() && !n_order) + { + this.n_y -= this.getprop('height') * (o_parent.a_config.length - item_offset); + } + + // generate item's HMTL + var el = document.createElement("a"); + el.setAttribute('id', 'e' + o_root.n_id + '_' + this.n_id + 'o'); + el.setAttribute('href', this.a_config[1]); + + if(this.a_config[2] && this.a_config[2]['tw']) + el.setAttribute('target', this.a_config[2]['tw']); + + el.className = this.getstyle(0, 0); + el.style.position = 'absolute'; + el.style.top = this.n_y + 'px'; + el.style.left = this.n_x + 'px'; + el.style.width = this.getprop('width') + 'px'; + el.style.height = this.getprop('height') + 'px'; + el.style.visibility = 'hidden'; + el.style.zIndex = this.n_depth; + + el.o_root_n_id = o_root.n_id; + el.this_n_id = this.n_id; + + el.onclick = A_MENUS_onclick; + el.onmouseout = A_MENUS_onmouseout; + el.onmouseover = A_MENUS_onmouseover; + el.onmousedown = A_MENUS_onmousedown; + + el.innerHTML = '<div id="e' + o_root.n_id + '_' + this.n_id +'i" class="' + this.getstyle(1, 0) + '">' + this.a_config[0] + '</div>'; + + document.body.appendChild(el); + + this.e_ielement = document.getElementById('e' + o_root.n_id + '_' + this.n_id + 'i'); + this.e_oelement = document.getElementById('e' + o_root.n_id + '_' + this.n_id + 'o'); + + this.b_visible = !this.n_depth; + + // no more initialization if leaf + if (this.a_config.length < item_offset) + return; + + // node specific methods and properties + this.a_children = []; + + // init downline recursively + for (var n_order = 0; n_order < this.a_config.length - item_offset; n_order++) + new menu_item(this, n_order); +} + +function A_MENUS_onclick(){ return A_MENUS[this.o_root_n_id].onclick(this.this_n_id); } +function A_MENUS_onmouseout(){ return A_MENUS[this.o_root_n_id].onmouseout(this.this_n_id); } +function A_MENUS_onmouseover(){ return A_MENUS[this.o_root_n_id].onmouseover(this.this_n_id); } +function A_MENUS_onmousedown(){ return A_MENUS[this.o_root_n_id].onmousedown(this.this_n_id); } + +// -------------------------------------------------------------------------------- +// reads property from template file, inherits from parent level if not found +// ------------------------------------------------------------------------------------------ +function mitem_getprop (s_key) { + + // check if value is defined for current level + var s_value = null, + a_level = this.o_root.a_tpl[this.n_depth]; + + // return value if explicitly defined + if (a_level) + s_value = a_level[s_key]; + + // request recursively from parent levels if not defined + return (s_value == null ? this.o_parent.getprop(s_key) : s_value); +} +// -------------------------------------------------------------------------------- +// reads property from template file, inherits from parent level if not found +// ------------------------------------------------------------------------------------------ +function mitem_getstyle (n_pos, n_state) { + + var a_css = this.a_css; + + // request recursively from parent levels if not defined + if(!a_css) + a_css = this.o_root.a_css_def; + + //var a_css = this.o_root.a_css; + + var a_oclass = a_css[n_pos ? 'inner' : 'outer']; + + // same class for all states + if (typeof(a_oclass) == 'string') + return a_oclass; + + // inherit class from previous state if not explicitly defined + for (var n_currst = n_state; n_currst >= 0; n_currst--) + if (a_oclass[n_currst]) + return a_oclass[n_currst]; +} + +// ------------------------------------------------------------------------------------------ +// updates status bar message of the browser +// ------------------------------------------------------------------------------------------ +function mitem_upstatus (b_clear) { + window.setTimeout("window.status=unescape('" + (b_clear + ? '' + : (this.a_config[2] && this.a_config[2]['sb'] + ? escape(this.a_config[2]['sb']) + : escape(this.a_config[0]) + (this.a_config[1] + ? ' ('+ escape(this.a_config[1]) + ')' + : ''))) + "')", 10); +} + +// -------------------------------------------------------------------------------- +// that's all folks diff --git a/frontends/php/media_types.php b/frontends/php/media_types.php index aa54ac81..55045888 100644 --- a/frontends/php/media_types.php +++ b/frontends/php/media_types.php @@ -28,7 +28,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php $fields=array( diff --git a/frontends/php/nodes.php b/frontends/php/nodes.php index 5aa6b5cf..9d0ce999 100644 --- a/frontends/php/nodes.php +++ b/frontends/php/nodes.php @@ -28,7 +28,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php $fields=array( diff --git a/frontends/php/popup.php b/frontends/php/popup.php index cdc7b2b1..7370fde6 100644 --- a/frontends/php/popup.php +++ b/frontends/php/popup.php @@ -89,8 +89,6 @@ include_once "include/page_header.php"; invalid_url(); } - insert_confirm_javascript(); - if(defined($page["title"])) $page["title"] = constant($page["title"]); ?> <?php diff --git a/frontends/php/popup_gitem.php b/frontends/php/popup_gitem.php index 415a57df..7e7916bc 100644 --- a/frontends/php/popup_gitem.php +++ b/frontends/php/popup_gitem.php @@ -32,7 +32,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION diff --git a/frontends/php/popup_httpstep.php b/frontends/php/popup_httpstep.php index a296c49b..2b4ebe5f 100644 --- a/frontends/php/popup_httpstep.php +++ b/frontends/php/popup_httpstep.php @@ -32,7 +32,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION diff --git a/frontends/php/popup_media.php b/frontends/php/popup_media.php index 1ff45a02..8b7f2042 100644 --- a/frontends/php/popup_media.php +++ b/frontends/php/popup_media.php @@ -32,7 +32,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION diff --git a/frontends/php/popup_right.php b/frontends/php/popup_right.php index 09ca6cf9..d61c0bee 100644 --- a/frontends/php/popup_right.php +++ b/frontends/php/popup_right.php @@ -28,7 +28,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION diff --git a/frontends/php/popup_trexpr.php b/frontends/php/popup_trexpr.php index ca28d85c..e41eec8a 100644 --- a/frontends/php/popup_trexpr.php +++ b/frontends/php/popup_trexpr.php @@ -29,7 +29,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php $operators = array( diff --git a/frontends/php/popup_users.php b/frontends/php/popup_users.php index 960ac168..28712c71 100644 --- a/frontends/php/popup_users.php +++ b/frontends/php/popup_users.php @@ -29,7 +29,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION diff --git a/frontends/php/popup_usrgrp.php b/frontends/php/popup_usrgrp.php index 15a8f104..060940e7 100644 --- a/frontends/php/popup_usrgrp.php +++ b/frontends/php/popup_usrgrp.php @@ -29,7 +29,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION diff --git a/frontends/php/profile.php b/frontends/php/profile.php index 09f95944..a15f5f1e 100644 --- a/frontends/php/profile.php +++ b/frontends/php/profile.php @@ -28,7 +28,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php if($USER_DETAILS["alias"]=="guest") diff --git a/frontends/php/screenconf.php b/frontends/php/screenconf.php index 0c79a379..c673cb44 100644 --- a/frontends/php/screenconf.php +++ b/frontends/php/screenconf.php @@ -28,7 +28,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php diff --git a/frontends/php/screenedit.php b/frontends/php/screenedit.php index 90af6b1c..502d384e 100644 --- a/frontends/php/screenedit.php +++ b/frontends/php/screenedit.php @@ -28,7 +28,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php diff --git a/frontends/php/services.php b/frontends/php/services.php index 3c919b2c..bee054ad 100644 --- a/frontends/php/services.php +++ b/frontends/php/services.php @@ -27,7 +27,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php diff --git a/frontends/php/sysmap.php b/frontends/php/sysmap.php index 703fdd8d..4af2e4cb 100644 --- a/frontends/php/sysmap.php +++ b/frontends/php/sysmap.php @@ -28,7 +28,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php diff --git a/frontends/php/sysmaps.php b/frontends/php/sysmaps.php index 684fc389..ebb48608 100644 --- a/frontends/php/sysmaps.php +++ b/frontends/php/sysmaps.php @@ -28,7 +28,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php index 89adb8b3..24b80cd6 100644 --- a/frontends/php/triggers.php +++ b/frontends/php/triggers.php @@ -30,7 +30,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php diff --git a/frontends/php/users.php b/frontends/php/users.php index 4c61e29d..91ec1841 100644 --- a/frontends/php/users.php +++ b/frontends/php/users.php @@ -30,7 +30,6 @@ include_once "include/page_header.php"; - insert_confirm_javascript(); ?> <?php $_REQUEST["config"]=get_request("config",get_profile("web.users.config",0)); |