summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-06-04 13:00:16 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-06-04 13:00:16 +0000
commitb0d70e49ec39c7af96a13144fa6747b1b6eaeb20 (patch)
tree01d0c9e9b0e3a675de7307ed49871e0a36ffdd72 /frontends/php/include
parent9c976c3c04e8a3f9bc9f9dbbdb429d82559f58b0 (diff)
- added constant ZBX_HISTORY_COUNT (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@4230 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/config.inc.php10
-rw-r--r--frontends/php/include/defines.inc.php2
2 files changed, 7 insertions, 5 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index d3b71f18..1c633932 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -1421,7 +1421,7 @@ $result =
$history='';
$delimiter = new CSpan('&raquo;','delimiter');
$delimiter = $delimiter->ToString();
- for($i = 0; $i < 5; $i++){
+ for($i = 0; $i < ZBX_HISTORY_COUNT; $i++){
if($rows = get_profile('web.history.'.$i,false)){
$history.= ($i>0)?($delimiter):('');
$url = new CLink($rows[0],$rows[1],'history');
@@ -1450,7 +1450,7 @@ $result =
$curr = 0;
$profile = array();
- for($i = 0; $i < 5; $i++){
+ for($i = 0; $i < ZBX_HISTORY_COUNT; $i++){
if($history = get_profile('web.history.'.$i,false)){
if($history[0] != $title){
$profile[$curr] = $history;
@@ -1461,16 +1461,16 @@ $result =
$history = array($title,$url);
- if($curr < 5){
+ if($curr < ZBX_HISTORY_COUNT){
for($i = 0; $i < $curr; $i++){
update_profile('web.history.'.$i,$profile[$i],PROFILE_TYPE_ARRAY);
}
$result = update_profile('web.history.'.$curr,$history,PROFILE_TYPE_ARRAY);
} else {
- for($i = 1; $i < 5; $i++){
+ for($i = 1; $i < ZBX_HISTORY_COUNT; $i++){
update_profile('web.history.'.($i-1),$profile[$i],PROFILE_TYPE_ARRAY);
}
- $result = update_profile('web.history.'.(5-1),$history,PROFILE_TYPE_ARRAY);
+ $result = update_profile('web.history.'.(ZBX_HISTORY_COUNT-1),$history,PROFILE_TYPE_ARRAY);
}
return $result;
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php
index 3558c34d..7deebe7a 100644
--- a/frontends/php/include/defines.inc.php
+++ b/frontends/php/include/defines.inc.php
@@ -395,6 +395,8 @@
define('ZBX_MIN_PERIOD', 3600);
define('ZBX_MAX_PERIOD', 12*31*24*3600);
define('ZBX_PERIOD_DEFAULT', ZBX_MIN_PERIOD);
+
+ define('ZBX_HISTORY_COUNT',5);
global $_GET, $_POST, $_COOKIE, $_REQUEST;