summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-05-05 06:18:56 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-05-05 06:18:56 +0000
commit1c38a85fbe88e86eee3b9999395871b8eaeb3393 (patch)
treedfa2200d9504ae3a40dfb6ef9dcca6bc530d51d9 /frontends/php/include
parenta2be02acf83bc0300d2edbc01afd461a9b294e05 (diff)
- fixed action adding (Eugene)
- improved ZABBIX logo, open link in new window (Eugene) - added option 'target' for CLink class (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@2798 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/actions.inc.php2
-rw-r--r--frontends/php/include/classes/clink.inc.php19
-rw-r--r--frontends/php/include/classes/ctable.inc.php9
-rw-r--r--frontends/php/include/classes/ctableinfo.inc.php4
-rw-r--r--frontends/php/include/classes/ctag.inc.php22
-rw-r--r--frontends/php/include/config.inc.php12
-rw-r--r--frontends/php/include/db.inc.php4
7 files changed, 41 insertions, 31 deletions
diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php
index 0f46692f..fba6096a 100644
--- a/frontends/php/include/actions.inc.php
+++ b/frontends/php/include/actions.inc.php
@@ -372,7 +372,7 @@
foreach($cmd_list as $cmd)
{
$cmd = trim($cmd, "\x00..\x1F");
- if(!ereg("^([a-zA-Z0-9]{1,})(:|#)[a-zA-Z/][0-9a-zA-Z\"\'\\/_\|\:\.><\}\*-\&\`\;\{[:space:]]*$",$cmd,$cmd_items)){
+ if(!ereg("^([0-9a-zA-Z\_\.-]{1,})(:|#)[[:print:]]*$",$cmd,$cmd_items)){
error("incorrect command: '$cmd'");
return FALSE;
}
diff --git a/frontends/php/include/classes/clink.inc.php b/frontends/php/include/classes/clink.inc.php
index 354b7579..cc160b45 100644
--- a/frontends/php/include/classes/clink.inc.php
+++ b/frontends/php/include/classes/clink.inc.php
@@ -31,9 +31,9 @@
$this->tag_body_start = "";
$this->tag_body_end = "";
- $this->SetClass($class);
- $this->AddItem($item);
- $this->SetUrl($url);
+ if(!is_null($class)) $this->SetClass($class);
+ if(!is_null($item)) $this->AddItem($item);
+ if(!is_null($url)) $this->SetUrl($url);
}
function SetAction($value=NULL)
{
@@ -60,5 +60,18 @@
$this->AddOption("href",$value);
}
+ function SetTarget($value=NULL)
+ {
+ if(is_null($value))
+ {
+ return $this->DelOption("target");
+ }
+ elseif(!is_string($value))
+ {
+ return $this->error("Incorrect value for SetTarget [$value]");
+ }
+
+ $this->AddOption("target",$value);
+ }
}
?>
diff --git a/frontends/php/include/classes/ctable.inc.php b/frontends/php/include/classes/ctable.inc.php
index 46a18fff..69b10f71 100644
--- a/frontends/php/include/classes/ctable.inc.php
+++ b/frontends/php/include/classes/ctable.inc.php
@@ -110,10 +110,11 @@
parent::CTag("table","yes");
$this->SetClass($class);
$this->message = $message;
- $this->SetOddRowClass();
- $this->SetEvenRowClass();
- $this->SetHeader();
- $this->SetFooter();
+
+ $this->oddRowClass = NULL;
+ $this->evenRowClass = NULL;
+ $this->header = NULL;
+ $this->footer = NULL;;
}
function SetHeader($value=NULL,$class=NULL)
{
diff --git a/frontends/php/include/classes/ctableinfo.inc.php b/frontends/php/include/classes/ctableinfo.inc.php
index cbf43365..4826eeba 100644
--- a/frontends/php/include/classes/ctableinfo.inc.php
+++ b/frontends/php/include/classes/ctableinfo.inc.php
@@ -31,8 +31,8 @@
$this->SetEvenRowClass('even_row');
$this->SetCellSpacing(1);
$this->SetCellPadding(3);
- $this->SetHeader();
- $this->SortBy();
+
+ $this->sortby = null;
}
function SetHeader($value=NULL,$class='header')
{
diff --git a/frontends/php/include/classes/ctag.inc.php b/frontends/php/include/classes/ctag.inc.php
index 4d58626f..a6e2ce3b 100644
--- a/frontends/php/include/classes/ctag.inc.php
+++ b/frontends/php/include/classes/ctag.inc.php
@@ -19,14 +19,6 @@
**/
?>
<?php
- function fnc($c)
- {
- $ret = '<tr>';
- foreach($c as $cc)
- $ret .= '<td>'.$cc.'</td>';
- $ret .= '</tr>';
- return $ret;
- }
class CTag
{
/* private */
@@ -56,14 +48,18 @@
{
$this->SetTagName($name);
$this->SetPaired($paired);
- $this->SetMaxLength(0);
- $this->tag_start=$this->tag_end=$this->tag_body_start=$this->tag_body_end= "";
+ $this->items_max_count = 0;
- if(is_null($body)) $this->tag_end = "\n";
- if(is_null($body)) $this->tag_body_start = "\n";
+ $this->tag_start=$this->tag_end=$this->tag_body_start=$this->tag_body_end= "";
- CTag::AddItem($body);
+ if(is_null($body))
+ {
+ $this->tag_end = "\n";
+ $this->tag_body_start = "\n";
+ } else {
+ CTag::AddItem($body);
+ }
}
function SetMaxLength($value)
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 2817675f..bd455765 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -1243,17 +1243,17 @@ COpt::profiling_start("page");
$table->SetCellSpacing(0);
$table->SetCellPadding(5);
- $col_r = array(new CLink(S_HELP, "http://www.zabbix.com/manual/v1.1/index.php", "small_font"));
+ $help = new CLink(S_HELP, "http://www.zabbix.com/manual/v1.1/index.php", "small_font");
+ $help->SetTarget('_blank');
+ $col_r = array($help);
if($USER_DETAILS["alias"]!="guest") {
array_push($col_r, "|");
array_push($col_r, new CLink(S_PROFILE, "profile.php", "small_font"));
}
- $table->AddRow(array(
- 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")));
+ $logo = new CLink(new CImg("images/general/zabbix.png","ZABBIX"),"http://www.zabbix.com");
+ $logo->SetTarget('_blank');
+ $table->AddRow(array(new CCol($logo, "page_header_l"), new CCol($col_r, "page_header_r")));
$table->Show();
?>
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php
index df6d7b98..3ba212f9 100644
--- a/frontends/php/include/db.inc.php
+++ b/frontends/php/include/db.inc.php
@@ -28,8 +28,8 @@
// $DB_DATABASE ="zabbix";
// $DB_DATABASE ="osmiy";
// $DB_DATABASE ="zabbix";
-// $DB_DATABASE ="osmiy";
- $DB_DATABASE ="demo";
+ $DB_DATABASE ="osmiy";
+// $DB_DATABASE ="demo";
// $DB_DATABASE ="martinsj";
$DB_USER ="root";
$DB_PASSWORD ="";