summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/classes/cpumenu.inc.php16
-rw-r--r--frontends/php/include/config.inc.php2
-rw-r--r--frontends/php/include/hosts.inc.php9
3 files changed, 26 insertions, 1 deletions
diff --git a/frontends/php/include/classes/cpumenu.inc.php b/frontends/php/include/classes/cpumenu.inc.php
index 1b697941..95cb104e 100644
--- a/frontends/php/include/classes/cpumenu.inc.php
+++ b/frontends/php/include/classes/cpumenu.inc.php
@@ -30,6 +30,22 @@
function CPUMenu($items=array(), $width=null)
{
$this->InsertJavaScript();
+ /*********************** ITEM ARRAY ***********************
+ ITEM: array(name, url, param, css, submenu1, submenu2, ... , submenuN)
+
+ name: text
+ url: text (url for href perameter)
+ param: array(tw => t_val, sb => s_val)
+ tw: target parameter
+ t_val: one of '_blank', '_parent', '_self', '_top'
+ sb: text for statusbar)
+ s_val: text
+ css: array(outer => cssarray, inner => cssarray)
+ outer -> style for outer div element
+ inner -> style for inner link element with text
+ cssarray -> array(normal, mouseover, mousedown)
+ submen1-N: list of subitems
+ **********************************************************/
$this->items = $items;
$this->width = $width;
}
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index c3c1b316..76c273f2 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -224,7 +224,7 @@ function TODO($msg) { echo "TODO: ".$msg.BR; } // DEBUG INFO!!!
if(!is_array($value))
{
if(is_object($value)) return unpack_object($value);
- if(is_string($value)) return '\''.str_replace('\'','\\\'',zbx_jsstr($value)).'\'';
+ if(is_string($value)) return '\''.str_replace('\'','\\\'',str_replace("\n", '\n', str_replace("\r", '', ($value)))).'\'';
if(is_null($value)) return 'null';
return strval($value);
}
diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php
index 044df43a..6d37652b 100644
--- a/frontends/php/include/hosts.inc.php
+++ b/frontends/php/include/hosts.inc.php
@@ -38,6 +38,15 @@ require_once "include/items.inc.php";
return $hostgroupid;
}
+ function delete_host_from_group($hostid, $groupid)
+ {
+ if(!is_numeric($hostid) || !is_numeric($groupid)){
+ error("incorrect parameters for 'add_host_to_group' [hostid:".$hostid."][groupid:".$groupid."]");
+ return false;
+ }
+ return DBexecute('delete from hosts_groups where hostid='.$hostid.' and groupid='.$groupid);
+ }
+
function db_save_group($name,$groupid=null)
{
if(!is_string($name)){