diff options
author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-10-25 14:44:38 +0000 |
---|---|---|
committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-10-25 14:44:38 +0000 |
commit | 4d02efc00fc5a4c076f12c4039197baf080c33d4 (patch) | |
tree | 56a354d3bf079e55e854b8c1f040e4c96d6fe6a0 /frontends/php/include | |
parent | 1064b7a725f59c3ab5f6efa0bc984a374dc3423b (diff) | |
download | zabbix-4d02efc00fc5a4c076f12c4039197baf080c33d4.tar.gz zabbix-4d02efc00fc5a4c076f12c4039197baf080c33d4.tar.xz zabbix-4d02efc00fc5a4c076f12c4039197baf080c33d4.zip |
- developed Numeric Box
git-svn-id: svn://svn.zabbix.com/trunk@3383 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r-- | frontends/php/include/classes/ctextbox.inc.php | 48 | ||||
-rw-r--r-- | frontends/php/include/forms.inc.php | 7 |
2 files changed, 52 insertions, 3 deletions
diff --git a/frontends/php/include/classes/ctextbox.inc.php b/frontends/php/include/classes/ctextbox.inc.php index b8faf48a..587799ad 100644 --- a/frontends/php/include/classes/ctextbox.inc.php +++ b/frontends/php/include/classes/ctextbox.inc.php @@ -27,6 +27,7 @@ function CTextBox($name='textbox',$value="",$size=20,$readonly="no") { parent::CTag('input','no'); + $this->tag_body_start = ''; $this->options['class'] = 'biginput'; $this->options['name'] = $name; $this->options['size'] = $size; @@ -61,4 +62,51 @@ } } + class CNumericBox extends CTextBox + { + function CNumericBox($name='password',$value='',$size=20) + { + parent::CTextBox($name,$value,$size); + $this->options['OnKeyPress'] = + " var c= (event.which) ? event.which : event.keyCode; ". + " if(c <= 31 || (c >= 48 && c <= 57)) return true; else return false; "; + } + } +/* TEST + class CIpBox + { + var $ip_parts = array(); + + function CIPBox($name='ip',$value) + { + if(!is_array($value)) $value = explode('.', $value); + if(!isset($value[0])) $value[0] = 0; + if(!isset($value[1])) $value[1] = 0; + if(!isset($value[2])) $value[2] = 0; + if(!isset($value[3])) $value[3] = 0; + + for($i = 0; $i < 4; $i++) + { + $this->ip_parts[$i] = new CNumericBox($name.'['.$i.']', $value[$i], 3); + if($i < 3) $this->ip_parts[$i]->tag_end = ''; + $this->ip_parts[$i] = unpack_object($this->ip_parts[$i]); + } + } + + function ToString($destroy=true) + { + $res = implode('.',$this->ip_parts); + + if($destroy) $this = null; + + return $res; + } + + function Show($destroy=true) + { + echo $this->ToString($destroy); + } + } +TEST */ + ?> diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index 89edd1e6..bb7bede1 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -85,9 +85,10 @@ } $frmNode->AddRow(S_TIME_ZONE, $cmbTimeZone); $frmNode->AddRow(S_IP, new CTextBox('ip', $ip, 17)); - $frmNode->AddRow(S_PORT, new CTextBox('port', $port,5)); - $frmNode->AddRow(S_DO_NOT_KEEP_HISTORY_OLDER_THAN, new CTextBox('slave_history', $slave_history,6)); - $frmNode->AddRow(S_DO_NOT_KEEP_TRENDS_OLDER_THAN, new CTextBox('slave_trends', $slave_trends,6)); +//TEST $frmNode->AddRow(S_IP.'(test)', new CIpBox('ip', $ip)); + $frmNode->AddRow(S_PORT, new CNumericBox('port', $port,5)); + $frmNode->AddRow(S_DO_NOT_KEEP_HISTORY_OLDER_THAN, new CNumericBox('slave_history', $slave_history,6)); + $frmNode->AddRow(S_DO_NOT_KEEP_TRENDS_OLDER_THAN, new CNumericBox('slave_trends', $slave_trends,6)); $frmNode->AddItemToBottomRow(new CButton('save',S_SAVE)); |