diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-11-15 12:53:32 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-11-15 12:53:32 +0000 |
| commit | e5c765ac713664bdae99dac1c975f4a8b7999c32 (patch) | |
| tree | 6958b6105333f9012250a1e9c14916b94530cf71 /frontends/php/include | |
| parent | 600abf07f6952ce7f6a1e8417fb31e3202b55894 (diff) | |
| download | zabbix-e5c765ac713664bdae99dac1c975f4a8b7999c32.tar.gz zabbix-e5c765ac713664bdae99dac1c975f4a8b7999c32.tar.xz zabbix-e5c765ac713664bdae99dac1c975f4a8b7999c32.zip | |
- improved stricted PHP5 supporting (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3486 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
18 files changed, 169 insertions, 219 deletions
diff --git a/frontends/php/include/classes/cbutton.inc.php b/frontends/php/include/classes/cbutton.inc.php index ce63f5ce..dc37d085 100644 --- a/frontends/php/include/classes/cbutton.inc.php +++ b/frontends/php/include/classes/cbutton.inc.php @@ -79,10 +79,11 @@ class CButtonQMessage extends CButton { + /* var $vars; var $msg; var $name; - var $do_redirect; + var $do_redirect;*/ function CButtonQMessage($name, $caption, $msg=NULL, $vars=NULL, $do_redirect=true){ $this->name = $name; @@ -108,7 +109,7 @@ $this->msg = $value; $this->SetAction(NULL); } - function SetAction($value=NULL){ + function SetAction($value=null, $event='onClick'){ if(!is_null($value)) return parent::SetAction($value); diff --git a/frontends/php/include/classes/ccombobox.inc.php b/frontends/php/include/classes/ccombobox.inc.php index ee390332..387821e6 100644 --- a/frontends/php/include/classes/ccombobox.inc.php +++ b/frontends/php/include/classes/ccombobox.inc.php @@ -59,7 +59,7 @@ class CComboBox extends CTag { /* private */ - var $value; + //var $value; /* public */ function CComboBox($name='combobox',$value=NULL,$action=NULL) @@ -80,7 +80,7 @@ { $this->value = $value; } - function AddItem($value, $caption, $selected=NULL, $enabled='yes') + function AddItem($value, $caption='', $selected=NULL, $enabled='yes') { // if($enabled=='no') return; /* disable item method 1 */ diff --git a/frontends/php/include/classes/cfile.inc.php b/frontends/php/include/classes/cfile.inc.php index bea8d910..74377658 100644 --- a/frontends/php/include/classes/cfile.inc.php +++ b/frontends/php/include/classes/cfile.inc.php @@ -30,14 +30,6 @@ $this->SetName($name); $this->SetFile($value); } - function SetName($value='textarea') - { - if(!is_string($value)) - { - return $this->error("Incorrect value for SetName [$value]"); - } - return $this->AddOption("name",$value); - } function SetFile($value="") { if(!is_string($value)) diff --git a/frontends/php/include/classes/cflash.inc.php b/frontends/php/include/classes/cflash.inc.php index 0254443a..692fe6e0 100644 --- a/frontends/php/include/classes/cflash.inc.php +++ b/frontends/php/include/classes/cflash.inc.php @@ -60,8 +60,9 @@ /* public */ class CFlash extends CTag { + /* var $SrcParam; - var $EmbededFlash; + var $EmbededFlash; */ function CFlash($src=NULL, $width = NULL, $height = NULL) { diff --git a/frontends/php/include/classes/cflashclock.mod.php b/frontends/php/include/classes/cflashclock.mod.php index dbfef8d3..8f359fd5 100644 --- a/frontends/php/include/classes/cflashclock.mod.php +++ b/frontends/php/include/classes/cflashclock.mod.php @@ -21,10 +21,13 @@ <?php class CFlashClock extends CFlash { + /* var $timetype; - var $src; + var $src;*/ function CFlashClock($width = 200, $height = 200, $timetype = TIME_TYPE_LOCAL, $url = NULL) { + $this->timetype = null; + if(!is_numeric($width) || $width < 24) $width = 200; if(!is_numeric($height) || $height< 24) $height = 200; diff --git a/frontends/php/include/classes/cform.inc.php b/frontends/php/include/classes/cform.inc.php index 7af98ee8..7e5872e1 100644 --- a/frontends/php/include/classes/cform.inc.php +++ b/frontends/php/include/classes/cform.inc.php @@ -33,7 +33,7 @@ { return $this->options['method'] = $value; } - function SetAction($value=NULL) + function SetAction($value) { global $page; diff --git a/frontends/php/include/classes/cformtable.inc.php b/frontends/php/include/classes/cformtable.inc.php index a0bf889d..cf203ef6 100644 --- a/frontends/php/include/classes/cformtable.inc.php +++ b/frontends/php/include/classes/cformtable.inc.php @@ -21,19 +21,23 @@ <?php class CFormTable extends CForm { -/* private */ +/* private *//* var $align; var $title; - var $help; -/* protected */ + var $help;*/ +/* protected *//* var $top_items = array(); var $center_items = array(); - var $bottom_items = array(); + var $bottom_items = array();*/ /* public */ function CFormTable($title=null, $action=null, $method=null, $enctype=null, $form_variable=null) { global $_REQUEST; + $this->top_items = array(); + $this->center_items = array(); + $this->bottom_items = array(); + if( null == $method ) { $method = 'get'; @@ -102,7 +106,7 @@ { if(is_null($value)) { $this->help = new CHelp(); - } elseif(is_a($value,'chelp')) { + } elseif(strtolower(get_class($value)) == 'chelp') { $this->help = $value; } elseif(is_string($value)) { $this->help = new CHelp($value); diff --git a/frontends/php/include/classes/chostsinfo.mod.php b/frontends/php/include/classes/chostsinfo.mod.php index 65f5a88a..00644ed8 100644 --- a/frontends/php/include/classes/chostsinfo.mod.php +++ b/frontends/php/include/classes/chostsinfo.mod.php @@ -21,9 +21,11 @@ <?php class CHostsInfo extends CTable { - var $style; + //var $style; function CHostsInfo($style = STYLE_HORISONTAL) { + $this->style = null; + parent::CTable(NULL,"hosts_info"); $this->SetOrientation($style); } diff --git a/frontends/php/include/classes/cmap.inc.php b/frontends/php/include/classes/cmap.inc.php index 662b4936..e479e925 100644 --- a/frontends/php/include/classes/cmap.inc.php +++ b/frontends/php/include/classes/cmap.inc.php @@ -37,7 +37,7 @@ } function AddItem($value) { - if(!is_a($value,'carea')) + if(strtolower(get_class($value)) != 'carea') return $this->error("Incorrect value for AddItem [$value]"); return parent::AddItem($value); diff --git a/frontends/php/include/classes/ctable.inc.php b/frontends/php/include/classes/ctable.inc.php index 79ffc1d4..5001ec30 100644 --- a/frontends/php/include/classes/ctable.inc.php +++ b/frontends/php/include/classes/ctable.inc.php @@ -55,18 +55,16 @@ { return $this->options['align'] = $value; } - function AddItem($item=NULL) + function AddItem($item) { - if(is_a($item,'ccol')) - { + if(strtolower(get_class($item))=='ccol') { parent::AddItem($item); } elseif(is_array($item)) { foreach($item as $el) { - if(is_a($el,'ccol')) - { + if(strtolower(get_class($el))=='ccol') { parent::AddItem($el); } elseif(!is_null($el)) { parent::AddItem('<td>'.unpack_object($el).'</td>'); @@ -82,7 +80,7 @@ class CTable extends CTag { -/* protected */ +/* protected *//* var $oddRowClass; var $evenRowClass; var $header; @@ -91,7 +89,7 @@ var $rownum; var $footer; var $footerClass; - var $message; + var $message;*/ /* public */ function CTable($message=NULL,$class=NULL) { @@ -136,15 +134,13 @@ { if(is_null($item)) return NULL; - if(is_a($item,'ccol')) - { + if(strtolower(get_class($item))=='ccol') { if(isset($this->header) && !isset($item->options['colspan'])) $item->options['colspan'] = $this->colnum; $item = new CRow($item,$rowClass); } - elseif(is_a($item,'crow')) - { + if(strtolower(get_class($item))=='crow') { if(isset($rowClass)) $item->SetClass($rowClass); } @@ -164,8 +160,7 @@ { if(is_null($class)) $class = $this->headerClass; - if(is_a($value,'crow')) - { + if(strtolower(get_class($value))=='crow') { if(!is_null($class)) $value->SetClass($class); }else{ $value = new CRow($value,$class); diff --git a/frontends/php/include/classes/ctag.inc.php b/frontends/php/include/classes/ctag.inc.php index 80020309..33c00221 100644 --- a/frontends/php/include/classes/ctag.inc.php +++ b/frontends/php/include/classes/ctag.inc.php @@ -53,22 +53,24 @@ class CTag { -/* private */ - var $destroyable_object; +/* private *//* var $tagname; var $options = array(); - var $paired; -/* protected */ + var $paired;*/ +/* protected *//* var $items = array(); var $tag_body_start; var $tag_body_end; var $tag_start; - var $tag_end; + var $tag_end;*/ /* public */ function CTag($tagname=NULL, $paired='no', $body=NULL, $class=null) { + $this->options = array(); + $this->items = array(); + if(!is_string($tagname)) { return $this->error('Incorrect tagname for CTag ['.$tagname.']'); @@ -135,7 +137,11 @@ } function SetName($value) { - $this->options['name'] = $value; + if(!is_string($value)) + { + return $this->error("Incorrect value for SetName [$value]"); + } + return $this->AddOption("name",$value); } function GetName() { diff --git a/frontends/php/include/classes/ctextbox.inc.php b/frontends/php/include/classes/ctextbox.inc.php index 97373a03..a61e4364 100644 --- a/frontends/php/include/classes/ctextbox.inc.php +++ b/frontends/php/include/classes/ctextbox.inc.php @@ -22,10 +22,11 @@ class CTextBox extends CTag { /* private */ - var $caption; + //var $caption; /* public */ function CTextBox($name='textbox',$value="",$size=20,$readonly="no") { + $this->caption = null; parent::CTag('input','no'); $this->tag_body_start = ''; $this->options['class'] = 'biginput'; @@ -81,10 +82,12 @@ class CIpBox { - var $ip_parts = array(); + //var $ip_parts = array(); function CIPBox($name='ip',$value) { + $this->ip_parts = array(); + if(!is_array($value)) $value = explode('.', $value); if(!isset($value[0])) $value[0] = 0; if(!isset($value[1])) $value[1] = 0; diff --git a/frontends/php/include/classes/ctriggerinfo.mod.php b/frontends/php/include/classes/ctriggerinfo.mod.php index aa016b83..6616b728 100644 --- a/frontends/php/include/classes/ctriggerinfo.mod.php +++ b/frontends/php/include/classes/ctriggerinfo.mod.php @@ -21,14 +21,17 @@ <?php class CTriggersInfo extends CTable { + /* var $style; var $show_header; - var $nodeid; + var $nodeid;*/ function CTriggersInfo($style = STYLE_HORISONTAL) { global $ZBX_CURNODEID; + $this->style = null; + parent::CTable(NULL,"triggers_info"); $this->SetOrientation($style); $this->show_header = true; diff --git a/frontends/php/include/classes/cvar.inc.php b/frontends/php/include/classes/cvar.inc.php index 384bf607..7b7c3a11 100644 --- a/frontends/php/include/classes/cvar.inc.php +++ b/frontends/php/include/classes/cvar.inc.php @@ -37,11 +37,13 @@ /* public */ class CVar { + /* var $var_container = array(); - var $var_name; + var $var_name;*/ function CVar($name,$value=null) { + $this->var_container = array(); $this->var_name = $name; $this->SetValue($value); diff --git a/frontends/php/include/classes/graph.inc.php b/frontends/php/include/classes/graph.inc.php index f7c2f751..1493a929 100644 --- a/frontends/php/include/classes/graph.inc.php +++ b/frontends/php/include/classes/graph.inc.php @@ -47,29 +47,30 @@ class Graph { - var $period; - var $from; + /* + //var $period; + //var $from; var $stime; - var $sizeX; - var $sizeY; - var $shiftXleft; - var $shiftXright; - var $shiftY; - var $border; + //var $sizeX; + //var $sizeY; + //var $shiftXleft; + //var $shiftXright; + //var $shiftY; + //var $border; var $fullSizeX; var $fullSizeY; - var $m_showWorkPeriod; - var $m_showTriggers; + //var $m_showWorkPeriod; + //var $m_showTriggers; - var $type; /* 0 - simple graph; 1 - stacked graph; */ + //var $type; // 0 - simple graph; 1 - stacked graph; - var $yaxistype; + //var $yaxistype; var $yaxismin; var $yaxismax; - var $yaxisleft; - var $yaxisright; + //var $yaxisleft; + //var $yaxisright; var $m_minY; var $m_maxY; @@ -84,7 +85,7 @@ var $clock; var $count; // Number of items - var $num; + //var $num; var $header; @@ -94,7 +95,67 @@ var $colors; var $im; - var $triggers = array(); + var $triggers = array();*/ + + function Graph($type = GRAPH_TYPE_NORMAL) + { + $this->stime = null; + $this->fullSizeX = null; + $this->fullSizeY = null; + + $this->yaxismin = null; + $this->yaxismax = null; + + $this->m_minY = null; + $this->m_maxY = null; + + $this->data = array(); + + $this->items = null; + + $this->min = null; + $this->max = null; + $this->avg = null; + $this->clock = null; + $this->count = null; + + $this->header = null; + + $this->from_time = null; + $this->to_time = null; + + $this->colors = null; + $this->im = null; + + $this->triggers = array(); + + $this->period=3600; + $this->from=0; + $this->sizeX=900; + $this->sizeY=200; + $this->shiftXleft=10; + $this->shiftXright=60; + $this->shiftY=17; + $this->border=1; + $this->num=0; + $this->type = $type; + $this->yaxistype=GRAPH_YAXIS_TYPE_CALCULATED; + $this->yaxisright=0; + $this->yaxisleft=0; + + $this->m_showWorkPeriod = 1; + $this->m_showTriggers = 1; + +/* if($this->period<=3600) + { + $this->date_format="H:i"; + } + else + { + $this->date_format="m.d H:i"; + }*/ + + } function updateShifts() { @@ -171,36 +232,6 @@ } } - function Graph($type = GRAPH_TYPE_NORMAL) - { - $this->period=3600; - $this->from=0; - $this->sizeX=900; - $this->sizeY=200; - $this->shiftXleft=10; - $this->shiftXright=60; - $this->shiftY=17; - $this->border=1; - $this->num=0; - $this->type = $type; - $this->yaxistype=GRAPH_YAXIS_TYPE_CALCULATED; - $this->yaxisright=0; - $this->yaxisleft=0; - - $this->m_showWorkPeriod = 1; - $this->m_showTriggers = 1; - -/* if($this->period<=3600) - { - $this->date_format="H:i"; - } - else - { - $this->date_format="m.d H:i"; - }*/ - - } - function ShowWorkPeriod($value) { $this->m_showWorkPeriod = $value == 1 ? 1 : 0; diff --git a/frontends/php/include/classes/table.inc.php b/frontends/php/include/classes/table.inc.php deleted file mode 100644 index b698e831..00000000 --- a/frontends/php/include/classes/table.inc.php +++ /dev/null @@ -1,120 +0,0 @@ -<?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 Ctable - { - var $rows=array(); - var $header=array(); - var $msg_empty; - var $after_header_html; - var $before_footer_html; - - function Ctable($msg_empty="...") - { - $this->msg_empty=$msg_empty; - $this->after_header_html=""; - $this->before_footer_html=""; - } - - function setAfterHeader($html) - { - $this->after_header_html = $html; - } - - function setBeforeFooter($html) - { - $this->before_footer_html = $html; - } - - function addRow($row) - { - $this->rows = array_merge($this->rows, array($row)); - } - -// Private - function setHeader($header) - { - $this->header = $header; - } - -// Private - function showHeader($class="tableinfo") - { - echo "<table class=\"$class\" border=0 width=\"100%\" bgcolor='#AAAAAA' cellspacing=1 cellpadding=3>"; - echo "\n"; - echo "<tr bgcolor='#CCCCCC'>"; - while(list($num,$element)=each($this->header)) - { - echo "<td><b>".$element."</b></td>"; - } - echo "</tr>"; - echo "\n"; - } - -// Private - function showFooter() - { - echo "</table>"; - echo "\n"; - } - -// Private - function showRow($elements, $rownum) - { - if($rownum%2 == 1) { echo "<TR BGCOLOR=\"#DDDDDD\">"; } - else { echo "<TR BGCOLOR=\"#EEEEEE\">"; } - - while(list($num,$element)=each($elements)) - { - if(is_array($element)&&isset($element["hide"])&&($element["hide"]==1)) continue; - if(is_array($element)) - { - if(isset($element["class"])) - echo "<td class=\"".$element["class"]."\">".$element["value"]."</td>"; - else - echo "<td>".$element["value"]."</td>"; - } - else - { - echo "<td>".$element."</td>"; - } - } - echo "</tr>"; - echo "\n"; - } - - function show() - { - $this->showHeader(); - echo $this->after_header_html."\n"; - while (list($num,$row) = each($this->rows)) - { - $this->showRow($row,$num); - } - if(count($this->rows) == 0) - { - echo "<tr bgcolor=#eeeeee><td colspan=".count($this->header)." align=center>".$this->msg_empty."</td></tr>\n"; - } - echo $this->before_footer_html."\n"; - $this->showFooter(); - } - } -?> diff --git a/frontends/php/include/copt.lib.php b/frontends/php/include/copt.lib.php index 00b8c7cd..5e68c377 100644 --- a/frontends/php/include/copt.lib.php +++ b/frontends/php/include/copt.lib.php @@ -331,14 +331,29 @@ else } else { - class COpt + if(version_compare(phpversion(),'5.0','<')) + { + class COpt + { + /* public static */ function profiling_start($type=NULL) {} + /* public static */ function profiling_stop($type=NULL) {} + /* public static */ function savesqlrequest($sql) {} + /* public static */ function showmemoryusage($descr=null) {} + /* public static */ function compare_files_with_menu($menu=null) {} + /* public static */ function counter_up($type=NULL) {} + } + } + else { - /* public static */ function profiling_start($type=NULL) {} - /* public static */ function profiling_stop($type=NULL) {} - /* public static */ function savesqlrequest($sql) {} - /* public static */ function showmemoryusage($descr=null) {} - /* public static */ function compare_files_with_menu($menu=null) {} - /* public static */ function counter_up($type=NULL) {} + class COpt + { + static function profiling_start($type=NULL) {} + static function profiling_stop($type=NULL) {} + static function savesqlrequest($sql) {} + static function showmemoryusage($descr=null) {} + static function compare_files_with_menu($menu=null) {} + static function counter_up($type=NULL) {} + } } } diff --git a/frontends/php/include/setup.inc.php b/frontends/php/include/setup.inc.php index f9e2f4cf..5e1880c6 100644 --- a/frontends/php/include/setup.inc.php +++ b/frontends/php/include/setup.inc.php @@ -29,7 +29,7 @@ class CSetupWizard extends CForm { -/* protected */ +/* protected *//* var $ZBX_CONFIG; var $DISABLE_NEXT_BUTTON; var $stage = array( @@ -42,6 +42,7 @@ 6 => array('title' => '7. Install' , 'fnc' => 'Stage6' ), 7 => array('title' => '8. Finish' , 'fnc' => 'Stage7' ) ); + */ /* public */ function CSetupWizard(&$ZBX_CONFIG) @@ -49,6 +50,17 @@ $this->DISABLE_NEXT_BUTTON = false; $this->ZBX_CONFIG = &$ZBX_CONFIG; + + $this->stage = array( + 0 => array('title' => '1. Introduction' , 'fnc' => 'Stage0' ), + 1 => array('title' => '2. Licence Agreement' , 'fnc' => 'Stage1' ), + 2 => array('title' => '3. Check of pre-requisites' , 'fnc' => 'Stage2' ), + 3 => array('title' => '4. Configure DB connection' , 'fnc' => 'Stage3' ), + 4 => array('title' => '5. Distributed monitoring' , 'fnc' => 'Stage4' ), + 5 => array('title' => '6. Pre-Installation Summary' , 'fnc' => 'Stage5' ), + 6 => array('title' => '7. Install' , 'fnc' => 'Stage6' ), + 7 => array('title' => '8. Finish' , 'fnc' => 'Stage7' ) + ); $this->EventHandler(); |
