summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-03-21 14:44:38 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-03-21 14:44:38 +0000
commit07ea4eb6c1927b132fc294271841066c11ab2955 (patch)
tree05a082481c5e15b9faa047878a75e503e0b1ba15 /frontends/php/include
parentd76992f73658df06227395e4a79c4366294efebe (diff)
downloadzabbix-07ea4eb6c1927b132fc294271841066c11ab2955.tar.gz
zabbix-07ea4eb6c1927b132fc294271841066c11ab2955.tar.xz
zabbix-07ea4eb6c1927b132fc294271841066c11ab2955.zip
- developed remote commads execution on specific actions (Eugene)
- added "URL" module for screens (Eugene) - fix some bugs - clean code git-svn-id: svn://svn.zabbix.com/trunk@2703 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/actions.inc.php70
-rw-r--r--frontends/php/include/classes/ciframe.inc.php89
-rw-r--r--frontends/php/include/config.inc.php4
-rw-r--r--frontends/php/include/defines.inc.php3
-rw-r--r--frontends/php/include/forms.inc.php106
-rw-r--r--frontends/php/include/locales/en_gb.inc.php1
-rw-r--r--frontends/php/include/screens.inc.php53
7 files changed, 249 insertions, 77 deletions
diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php
index 25a64cb0..c9c49b80 100644
--- a/frontends/php/include/actions.inc.php
+++ b/frontends/php/include/actions.inc.php
@@ -36,7 +36,7 @@
# Add Action
- function add_action($id,$delay,$subject,$message,$recipient,$maxrepeats,$repeatdelay,$status)
+ function add_action($actiontype,$userid,$delay,$subject,$message,$recipient,$maxrepeats,$repeatdelay,$status,$scripts)
{
// if(!check_right_on_trigger("A",$triggerid))
// {
@@ -44,24 +44,46 @@
// return 0;
// }
- $sql="insert into actions (userid,delay,nextcheck,subject,message,recipient,".
- "maxrepeats,repeatdelay,status) values ($id,$delay,0,".zbx_dbstr($subject).",".
- zbx_dbstr($message).",$recipient,$maxrepeats,$repeatdelay,$status)";
+ if($actiontype == ACTION_TYPE_MESSAGE)
+ {
+ $scripts = "";
+ }
+ elseif($actiontype == ACTION_TYPE_COMMAND)
+ {
+ $subject = $message = "";
+ $userid = 0;
+ $recipient = 0;
+ if(!check_commands($scripts)) return FALSE;
+ }
+ $sql="insert into actions (actiontype,userid,delay,nextcheck,subject,message,recipient,".
+ "maxrepeats,repeatdelay,status,scripts) values ($actiontype,$userid,$delay,0,".zbx_dbstr($subject).",".
+ zbx_dbstr($message).",$recipient,$maxrepeats,$repeatdelay,$status,".zbx_dbstr($scripts).")";
$result=DBexecute($sql);
return DBinsert_id($result,"actions","actionid");
}
# Update Action
- function update_action($actionid, $id, $delay, $subject, $message, $recipient, $maxrepeats, $repeatdelay, $status)
+ function update_action($actionid,$actiontype,$userid,$delay,$subject,$message,$recipient,$maxrepeats,$repeatdelay,$status,$scripts)
{
// if(!check_right_on_trigger("U",$triggerid))
// {
// error("Insufficient permissions");
// return 0;
// }
+ if($actiontype == ACTION_TYPE_MESSAGE)
+ {
+ $scripts = "";
+ }
+ elseif($actiontype == ACTION_TYPE_COMMAND)
+ {
+ $subject = $message = "";
+ $userid = 0;
+ $recipient = 0;
+ if(!check_commands($scripts)) return FALSE;
+ }
- $result=DBexecute("update actions set userid=$id,delay=$delay,nextcheck=0,subject=".zbx_dbstr($subject).",message=".zbx_dbstr($message).",recipient=$recipient,maxrepeats=$maxrepeats, repeatdelay=$repeatdelay,status=$status where actionid=$actionid");
+ $result=DBexecute("update actions set actiontype=$actiontype,userid=$userid,delay=$delay,nextcheck=0,subject=".zbx_dbstr($subject).",message=".zbx_dbstr($message).",recipient=$recipient,maxrepeats=$maxrepeats, repeatdelay=$repeatdelay,status=$status,scripts=".zbx_dbstr($scripts)." where actionid=$actionid");
return $result;
}
@@ -145,10 +167,10 @@
$message=str_replace("{".$host_template["host"].":", "{".$host["host"].":",
$action["message"]);
- add_action($row2["triggerid"], $action["userid"], $action["good"],
+ add_action($action["actiontype"],$row2["triggerid"], $action["userid"], $action["good"],
$action["delay"], $action["subject"], $message, $action["scope"],
$action["severity"], $action["recipient"], $action["maxrepeats"],
- $action["repeatdelay"]);
+ $action["repeatdelay"],$action["scripts"]);
}
}
}
@@ -242,7 +264,7 @@
{
$host=get_host_by_hostid($row["hostid"]);
$message=str_replace("{".$host_template["host"].":", "{".$host["host"].":", $action["message"]);
- update_action($row3["actionid"], $row2["triggerid"], $action["userid"], $action["good"], $action["delay"], $action["subject"], $message, $action["scope"], $action["severity"], $action["recipient"], $action["maxrepeats"],$action["repeatdelay"]);
+ update_action($row3["actionid"], $action["actiontype"],$row2["triggerid"], $action["userid"], $action["good"], $action["delay"], $action["subject"], $message, $action["scope"], $action["severity"], $action["recipient"], $action["maxrepeats"],$action["repeatdelay"],$action["scripts"]);
}
}
@@ -343,4 +365,34 @@
{
return DBexecute("update actions set status=$status where actionid=$actionid");
}
+
+ function check_commands($commands)
+ {
+ $cmd_list = split("\n",$commands);
+ foreach($cmd_list as $cmd)
+ {
+ $cmd = trim($cmd, "\x00..\x1F");
+ if(!ereg("^([a-zA-Z0-9]{1,})(:|#)(([a-zA-Z]\:|/){0,1}([a-zA-Z0-9_\.\\/]{3,}))$",$cmd,$cmd_items)){
+ error("incorrect command: '$cmd'");
+ return FALSE;
+ }
+ if($cmd_items[2] == "#")
+ { // group
+ if(DBnum_rows(DBselect("select groupid from groups where name=".zbx_dbstr($cmd_items[1])))!=1)
+ {
+ error("Uncnown group name: '".$cmd_items[1]."' in command ".$cmd."'");
+ return FALSE;
+ }
+ }
+ elseif($cmd_items[2] == ":")
+ { // host
+ if(DBnum_rows(DBselect("select hostid from hosts where host=".zbx_dbstr($cmd_items[1])))!=1)
+ {
+ error("Uncnown host name '".$cmd_items[1]."' in command '".$cmd."'");
+ return FALSE;
+ }
+ }
+ }
+ return TRUE;
+ }
?>
diff --git a/frontends/php/include/classes/ciframe.inc.php b/frontends/php/include/classes/ciframe.inc.php
new file mode 100644
index 00000000..9e9b4376
--- /dev/null
+++ b/frontends/php/include/classes/ciframe.inc.php
@@ -0,0 +1,89 @@
+<?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 CIFrame extends CTag
+ {
+/* public */
+ function CIFrame($src=NULL,$width="100%",$height="100%",$scrolling="no")
+ {
+ parent::CTag("iframe","yes");
+
+ $this->tag_start= "";
+ $this->tag_end = "";
+ $this->tag_body_start = "";
+ $this->tag_body_end = "";
+
+ $this->SetSrc($src);
+ $this->SetWidth($width);
+ $this->SetHeight($height);
+ $this->SetScrolling($scrolling);
+ }
+ function SetSrc($value=NULL)
+ {
+ if(is_null($value))
+ {
+ return $this->DelOption("src");
+ }
+ elseif(!is_string($value))
+ {
+ return $this->error("Incorrect value for SetSrc [$value]");
+ }
+ return $this->AddOption("src",$value);
+ }
+ function SetWidth($value)
+ {
+ if(is_null($value))
+ {
+ return $this->DelOption("width");
+ }
+ elseif(!is_string($value))
+ {
+ return $this->error("Incorrect value for SetWidth [$value]");
+ }
+
+ $this->AddOption("width",$value);
+ }
+ function SetHeight($value)
+ {
+ if(is_null($value))
+ {
+ return $this->DelOption("height");
+ }
+ elseif(!is_string($value))
+ {
+ return $this->error("Incorrect value for SetHeight [$value]");
+ }
+
+ $this->AddOption("height",$value);
+ }
+ function SetScrolling($value)
+ {
+ if(is_null($value)) $value = 'no';
+
+ if($value=='no' && $value=='yes' && $value=='auto')
+ {
+ return $this->error("Incorrect value for SetScrolling [$value]");
+ }
+
+ $this->AddOption("scrolling",$value);
+ }
+ }
+?>
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index e1f4ce3a..283143d2 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -83,6 +83,7 @@ function SDI($msg="SDI") { echo "DEBUG INFO: $msg ".BR; } // DEBUG INFO!!!
include_once("include/classes/cformtable.inc.php");
include_once("include/classes/cmap.inc.php");
include_once("include/classes/cflash.inc.php");
+ include_once("include/classes/ciframe.inc.php");
// Include Tactical Overview modules
include_once("include/classes/chostsinfo.mod.php");
@@ -1145,7 +1146,7 @@ function SDI($msg="SDI") { echo "DEBUG INFO: $msg ".BR; } // DEBUG INFO!!!
}
$table->AddRow(array(
- new CCol(new CLink(new CImg("images/general/zabbix.png","ZABBIX")),
+ new CCol(new CLink(new CImg("images/general/zabbix.png","ZABBIX"),"http://www.zabbix.com"),
"page_header_l"),
new CCol($col_r,
"page_header_r")));
@@ -3075,4 +3076,5 @@ function SDI($msg="SDI") { echo "DEBUG INFO: $msg ".BR; } // DEBUG INFO!!!
</script>
";
}
+
?>
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php
index 816d6b7d..0bdf2d0a 100644
--- a/frontends/php/include/defines.inc.php
+++ b/frontends/php/include/defines.inc.php
@@ -143,6 +143,9 @@
define("ACTION_STATUS_ENABLED",0);
define("ACTION_STATUS_DISABLED",1);
+ define("ACTION_TYPE_MESSAGE",0);
+ define("ACTION_TYPE_COMMAND",1);
+
define("TRIGGER_STATUS_ENABLED",0);
define("TRIGGER_STATUS_DISABLED",1);
define("TRIGGER_STATUS_UNKNOWN",2);
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index 0e4aa9b3..f3dc8ee7 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -1173,6 +1173,7 @@
$maxrepeats = $action["maxrepeats"];
$repeatdelay = $action["repeatdelay"];
$status = $action["status"];
+ $scripts = $action["scripts"];
if(isset($_REQUEST["repeat"]))
{
@@ -1203,7 +1204,7 @@
else
{
$source = get_request("source",0);
- $actiontype = get_request("actiontype",0);
+ $actiontype = get_request("actiontype",ACTION_TYPE_MESSAGE);
$delay = get_request("delay",30);
$subject = get_request("subject","{TRIGGER.NAME}: {STATUS}");
@@ -1215,14 +1216,17 @@
$repeatdelay = get_request("repeatdelay",600);
$repeat = get_request("repeat",0);
$status = get_request("status",ACTION_STATUS_ENABLED);
-
- if($recipient==RECIPIENT_TYPE_GROUP)
- $uid = get_request("usrgrpid",NULL);
- else
- $uid = get_request("userid",NULL);
+ $uid = get_request("userid",0);
+ $scripts = get_request("scripts","");
}
+ $cmbActionType = new CComboBox('actiontype', $actiontype,'submit()');
+ $cmbActionType->AddItem(ACTION_TYPE_MESSAGE,S_SEND_MESSAGE);
+ $cmbActionType->AddItem(ACTION_TYPE_COMMAND,S_REMOTE_COMMAND);
+ $frmAction->AddRow(S_ACTION_TYPE, $cmbActionType);
+
+
// prepare condition list
$cond_el=array();
$i=0;
@@ -1369,50 +1373,57 @@
// end of new condition preparation
$frmAction->AddRow(S_CONDITION, $rowCondition);
- $cmbActionType = new CComboBox('actiontype', $actiontype,'submit()');
- $cmbActionType->AddItem(0,S_SEND_MESSAGE);
- $cmbActionType->AddItem(1,S_REMOTE_COMMAND,NULL,'no');
-
- $frmAction->AddRow(S_ACTION_TYPE, $cmbActionType);
+ $frmAction->AddRow(
+ $actiontype == ACTION_TYPE_MESSAGE ? S_DELAY_BETWEEN_MESSAGES_IN_SEC : S_DELAY_BETWEEN_EXECUTIONS_IN_SEC,
+ new CTextBox('delay',$delay,5));
- $cmbRecipient = new CComboBox('recipient', $recipient,'submit()');
- $cmbRecipient->AddItem(0,S_SINGLE_USER);
- $cmbRecipient->AddItem(1,S_USER_GROUP);
-
- $frmAction->AddRow(S_SEND_MESSAGE_TO, $cmbRecipient);
-
- if($recipient==RECIPIENT_TYPE_GROUP)
+ if($actiontype == ACTION_TYPE_MESSAGE)
{
-
- $cmbGroups = new CComboBox('userid', $uid);
-
- $sql="select usrgrpid,name from usrgrp order by name";
- $groups=DBselect($sql);
- while($group=DBfetch($groups))
+ $cmbRecipient = new CComboBox('recipient', $recipient,'submit()');
+ $cmbRecipient->AddItem(0,S_SINGLE_USER);
+ $cmbRecipient->AddItem(1,S_USER_GROUP);
+ $frmAction->AddRow(S_SEND_MESSAGE_TO, $cmbRecipient);
+
+ if($recipient==RECIPIENT_TYPE_GROUP)
{
- $cmbGroups->AddItem($group['usrgrpid'],$group['name']);
+
+ $cmbGroups = new CComboBox('userid', $uid);
+
+ $sql="select usrgrpid,name from usrgrp order by name";
+ $groups=DBselect($sql);
+ while($group=DBfetch($groups))
+ {
+ $cmbGroups->AddItem($group['usrgrpid'],$group['name']);
+ }
+
+ $frmAction->AddRow(S_GROUP, $cmbGroups);
}
+ else
+ {
+ $cmbUser = new CComboBox('userid', $uid);
+
+ $sql="select userid,alias from users order by alias";
+ $users=DBselect($sql);
+ while($user=DBfetch($users))
+ {
+ $cmbUser->AddItem($user['userid'],$user['alias']);
+ }
- $frmAction->AddRow(S_GROUP, $cmbGroups);
+ $frmAction->AddRow(S_USER, $cmbUser);
+ }
+ $frmAction->AddRow(S_SUBJECT, new CTextBox('subject',$subject,80));
+ $frmAction->AddRow(S_MESSAGE, new CTextArea('message',$message,77,7));
+ $frmAction->AddVar("scripts",$scripts);
}
else
{
- $cmbUser = new CComboBox('userid', $uid);
-
- $sql="select userid,alias from users order by alias";
- $users=DBselect($sql);
- while($user=DBfetch($users))
- {
- $cmbUser->AddItem($user['userid'],$user['alias']);
- }
-
- $frmAction->AddRow(S_USER, $cmbUser);
+ $frmAction->AddRow(S_REMOTE_COMMAND, new CTextArea('scripts',$scripts,77,7));
+ $frmAction->AddVar("recipient",$recipient);
+ $frmAction->AddVar("userid",$uid);
+ $frmAction->AddVar("subject",$subject);
+ $frmAction->AddVar("message",$message);
}
- $frmAction->AddRow(S_DELAY_BETWEEN_MESSAGES_IN_SEC, new CTextBox('delay',$delay,5));
- $frmAction->AddRow(S_SUBJECT, new CTextBox('subject',$subject,80));
- $frmAction->AddRow(S_MESSAGE, new CTextArea('message',$message,77,7));
-
$cmbRepeat = new CComboBox('repeat',$repeat,'submit()');
$cmbRepeat->AddItem(0,S_NO_REPEATS);
$cmbRepeat->AddItem(1,S_REPEAT);
@@ -1648,6 +1659,7 @@
$valign = $irow["valign"];
$halign = $irow["halign"];
$style = $irow["style"];
+ $url = $irow["url"];
}
else
{
@@ -1661,9 +1673,9 @@
$valign = get_request("valign", VALIGN_DEFAULT);
$halign = get_request("halign", HALIGN_DEFAULT);
$style = get_request("style", 0);
+ $url = get_request("url", "");
}
-
$form->AddVar("screenid",$_REQUEST["screenid"]);
$cmbRes = new CCombobox("resource",$resource,"submit()");
@@ -1678,7 +1690,7 @@
$cmbRes->AddItem(SCREEN_RESOURCE_TRIGGERS_OVERVIEW, S_TRIGGERS_OVERVIEW);
$cmbRes->AddItem(SCREEN_RESOURCE_DATA_OVERVIEW, S_DATA_OVERVIEW);
$cmbRes->AddItem(SCREEN_RESOURCE_CLOCK, S_CLOCK);
-// $cmbRes->AddItem(SCREEN_RESOURCE_URL, S_URL);
+ $cmbRes->AddItem(SCREEN_RESOURCE_URL, S_URL);
$form->AddRow(S_RESOURCE,$cmbRes);
if($resource == SCREEN_RESOURCE_GRAPH)
@@ -1821,7 +1833,12 @@
$form->AddVar("style", 0);
}
- if(in_array($resource,array(SCREEN_RESOURCE_GRAPH,SCREEN_RESOURCE_SIMPLE_GRAPH,SCREEN_RESOURCE_CLOCK)))
+ if(in_array($resource,array(SCREEN_RESOURCE_URL)))
+ {
+ $form->AddRow(S_URL, new CTextBox("url",$url,60));
+ }
+
+ if(in_array($resource,array(SCREEN_RESOURCE_GRAPH,SCREEN_RESOURCE_SIMPLE_GRAPH,SCREEN_RESOURCE_CLOCK,SCREEN_RESOURCE_URL)))
{
$form->AddRow(S_WIDTH, new CTextBox("width",$width,5));
$form->AddRow(S_HEIGHT, new CTextBox("height",$height,5));
@@ -1832,7 +1849,8 @@
$form->AddVar("height", 0);
}
- if(in_array($resource,array(SCREEN_RESOURCE_GRAPH,SCREEN_RESOURCE_SIMPLE_GRAPH,SCREEN_RESOURCE_MAP,SCREEN_RESOURCE_CLOCK)))
+ if(in_array($resource,array(SCREEN_RESOURCE_GRAPH,SCREEN_RESOURCE_SIMPLE_GRAPH,SCREEN_RESOURCE_MAP,
+ SCREEN_RESOURCE_CLOCK,SCREEN_RESOURCE_URL)))
{
$cmbHalign = new CComboBox("halign",$halign);
$cmbHalign->AddItem(HALIGN_CENTER, S_CENTER);
diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php
index 1c59a4c6..a37fd3eb 100644
--- a/frontends/php/include/locales/en_gb.inc.php
+++ b/frontends/php/include/locales/en_gb.inc.php
@@ -81,6 +81,7 @@
"S_USER"=> "User",
"S_ON_OR_OFF"=> "ON or OFF",
"S_DELAY_BETWEEN_MESSAGES_IN_SEC"=> "Delay between messages (in sec)",
+ "S_DELAY_BETWEEN_EXECUTIONS_IN_SEC"=> "Delay between executions (in sec)",
"S_MESSAGE"=> "Message",
"S_THIS_TRIGGER_ONLY"=> "This trigger only",
"S_ALL_TRIGGERS_OF_THIS_HOST"=> "All triggers of this host",
diff --git a/frontends/php/include/screens.inc.php b/frontends/php/include/screens.inc.php
index 8ade536d..30698be7 100644
--- a/frontends/php/include/screens.inc.php
+++ b/frontends/php/include/screens.inc.php
@@ -54,18 +54,19 @@
return DBexecute("delete from screens where screenid=$screenid");
}
- function add_screen_item($resource,$screenid,$x,$y,$resourceid,$width,$height,$colspan,$rowspan,$elements,$valign,$halign,$style)
+ function add_screen_item($resource,$screenid,$x,$y,$resourceid,$width,$height,$colspan,$rowspan,$elements,$valign,$halign,$style,$url)
{
$sql="delete from screens_items where screenid=$screenid and x=$x and y=$y";
DBexecute($sql);
- $sql="insert into screens_items (resource,screenid,x,y,resourceid,width,height,colspan,rowspan,elements,valign,halign,style)".
- " values ($resource,$screenid,$x,$y,$resourceid,$width,$height,$colspan,$rowspan,$elements,$valign,$halign,$style)";
+ $sql="insert into screens_items (resource,screenid,x,y,resourceid,width,height,colspan,rowspan,elements,valign,halign,style,url)".
+ " values ($resource,$screenid,$x,$y,$resourceid,$width,$height,$colspan,$rowspan,$elements,$valign,$halign,$style,".
+ zbx_dbstr($url).")";
return DBexecute($sql);
}
- function update_screen_item($screenitemid,$resource,$resourceid,$width,$height,$colspan,$rowspan,$elements,$valign,$halign,$style)
+ function update_screen_item($screenitemid,$resource,$resourceid,$width,$height,$colspan,$rowspan,$elements,$valign,$halign,$style,$url)
{
- $sql="update screens_items set resource=$resource,resourceid=$resourceid,width=$width,height=$height,colspan=$colspan,rowspan=$rowspan,elements=$elements,valign=$valign,halign=$halign,style=$style where screenitemid=$screenitemid";
+ $sql="update screens_items set resource=$resource,resourceid=$resourceid,width=$width,height=$height,colspan=$colspan,rowspan=$rowspan,elements=$elements,valign=$valign,halign=$halign,style=$style,url=".zbx_dbstr($url)." where screenitemid=$screenitemid";
return DBexecute($sql);
}
@@ -171,6 +172,7 @@
$valign = $irow["valign"];
$halign = $irow["halign"];
$style = $irow["style"];
+ $url = $irow["url"];
}
else
{
@@ -186,16 +188,16 @@
$valign = VALIGN_DEFAULT;
$halign = HALIGN_DEFAULT;
$style = 0;
+ $url = "";
}
-
if($editmode == 1 && $screenitemid!=0)
- $url = "screenedit.php?form=update".url_param("screenid").
+ $action = "screenedit.php?form=update".url_param("screenid").
"&screenitemid=$screenitemid#form";
elseif ($editmode == 1 && $screenitemid==0)
- $url = "screenedit.php?form=update".url_param("screenid")."&x=$c&y=$r#form";
+ $action = "screenedit.php?form=update".url_param("screenid")."&x=$c&y=$r#form";
else
- $url = NULL;
+ $action = NULL;
if($editmode == 1 && isset($_REQUEST["form"]) &&
isset($_REQUEST["x"]) && $_REQUEST["x"]==$c &&
@@ -211,25 +213,25 @@
elseif( ($screenitemid!=0) && ($resource==SCREEN_RESOURCE_GRAPH) )
{
if($editmode == 0)
- $url = "charts.php?graphid=$resourceid".url_param("period").
+ $action = "charts.php?graphid=$resourceid".url_param("period").
url_param("inc").url_param("dec");
$item = new CLink(
new CImg("chart2.php?graphid=$resourceid&width=$width&height=$height".
"&period=$effectiveperiod".url_param("stime").url_param("from")),
- $url
+ $action
);
}
elseif( ($screenitemid!=0) && ($resource==SCREEN_RESOURCE_SIMPLE_GRAPH) )
{
if($editmode == 0)
- $url = "history.php?action=showhistory&itemid=$resourceid".
+ $action = "history.php?action=showhistory&itemid=$resourceid".
url_param("period").url_param("inc").url_param("dec");
$item = new CLink(
new CImg("chart.php?itemid=$resourceid&width=$width&height=$height".
"&period=$effectiveperiod".url_param("stime").url_param("from")),
- $url
+ $action
);
}
elseif( ($screenitemid!=0) && ($resource==SCREEN_RESOURCE_MAP) )
@@ -242,52 +244,57 @@
$image_map->SetMap($action_map->GetName());
$item = array($action_map,$image_map);
} else {
- $item = new CLink($image_map, $url);
+ $item = new CLink($image_map, $action);
}
}
elseif( ($screenitemid!=0) && ($resource==SCREEN_RESOURCE_PLAIN_TEXT) )
{
$item = array(get_screen_plaintext($resourceid,$elements));
- if($editmode == 1) array_push($item,new CLink(S_CHANGE,$url));
+ if($editmode == 1) array_push($item,new CLink(S_CHANGE,$action));
}
elseif( ($screenitemid!=0) && ($resource==SCREEN_RESOURCE_HOSTS_INFO) )
{
$item = array(new CHostsInfo($style));
- if($editmode == 1) array_push($item,new CLink(S_CHANGE,$url));
+ if($editmode == 1) array_push($item,new CLink(S_CHANGE,$action));
}
elseif( ($screenitemid!=0) && ($resource==SCREEN_RESOURCE_TRIGGERS_INFO) )
{
$item = array(new CTriggersInfo($style));
- if($editmode == 1) array_push($item,new CLink(S_CHANGE,$url));
+ if($editmode == 1) array_push($item,new CLink(S_CHANGE,$action));
}
elseif( ($screenitemid!=0) && ($resource==SCREEN_RESOURCE_SERVER_INFO) )
{
$item = array(new CServerInfo());
- if($editmode == 1) array_push($item,new CLink(S_CHANGE,$url));
+ if($editmode == 1) array_push($item,new CLink(S_CHANGE,$action));
}
elseif( ($screenitemid!=0) && ($resource==SCREEN_RESOURCE_CLOCK) )
{
- $item = new CFlashClock($width, $height, $style, $url);
+ $item = new CFlashClock($width, $height, $style, $action);
}
elseif( ($screenitemid!=0) && ($resource==SCREEN_RESOURCE_SCREEN) )
{
$item = array(get_screen($resourceid, 2, $effectiveperiod));
- if($editmode == 1) array_push($item,new CLink(S_CHANGE,$url));
+ if($editmode == 1) array_push($item,new CLink(S_CHANGE,$action));
}
elseif( ($screenitemid!=0) && ($resource==SCREEN_RESOURCE_TRIGGERS_OVERVIEW) )
{
$item = array(get_triggers_overview($resourceid));
- if($editmode == 1) array_push($item,new CLink(S_CHANGE,$url));
+ if($editmode == 1) array_push($item,new CLink(S_CHANGE,$action));
}
elseif( ($screenitemid!=0) && ($resource==SCREEN_RESOURCE_DATA_OVERVIEW) )
{
$item = array(get_items_data_overview($resourceid));
- if($editmode == 1) array_push($item,new CLink(S_CHANGE,$url));
+ if($editmode == 1) array_push($item,new CLink(S_CHANGE,$action));
+ }
+ elseif( ($screenitemid!=0) && ($resource==SCREEN_RESOURCE_URL) )
+ {
+ $item = array(new CIFrame($url,$width,$height,"auto"));
+ if($editmode == 1) array_push($item,BR,new CLink(S_CHANGE,$action));
}
else
{
$item = array(SPACE);
- if($editmode == 1) array_push($item,BR,new CLink(S_CHANGE,$url));
+ if($editmode == 1) array_push($item,BR,new CLink(S_CHANGE,$action));
}
$str_halign = "def";