X-Git-Url: https://git-public.kairo.at/?a=blobdiff_plain;f=include%2Fclasses%2Frrdstat.php-class;h=ea32b5276821c585c79a613eb691aff1ed2dbb7c;hb=82d064f49d1504d936007f150bcc4f12d29cc44f;hp=5e8cc6659c92b68f849e72bd2800c0a39b554ebf;hpb=2e28e4bd8d68f7bd199c387efb63b22d99bf04d6;p=php-utility-classes.git diff --git a/include/classes/rrdstat.php-class b/include/classes/rrdstat.php-class index 5e8cc66..ea32b52 100644 --- a/include/classes/rrdstat.php-class +++ b/include/classes/rrdstat.php-class @@ -200,7 +200,7 @@ class rrdstat { } elseif (isset($iinfo['file'])) { $this->rrd_file = (($iinfo['file']{0} != '/')?$this->basedir:'').$iinfo['file']; - $this->basename = (substr($this->rrd_file, -4) == '.rrd')?substr($this->rrd_file, 0, -4):$this->rrd_file; + $this->basename = basename((substr($this->rrd_file, -4) == '.rrd')?substr($this->rrd_file, 0, -4):$this->rrd_file); } elseif (!is_null($conf_id) && file_exists($conf_id.'.rrd')) { $this->rrd_file = (($iinfo['file']{0} != '/')?$this->basedir:'').$conf_id.'.rrd'; @@ -354,7 +354,7 @@ class rrdstat { } } $key_names = (!is_numeric(array_shift(array_keys($upvals)))); - if (in_array('L', $upvals)) { + if (in_array('L', $upvals, true)) { // for at least one value, we need to set the same as the last recorded value $fvals = $this->fetch(); $rowids = array_shift($fvals); @@ -563,6 +563,7 @@ class rrdstat { $grow['legend'] = $ds['legend']; if (!isset($gconf['show_legend'])) { $gconf['show_legend'] = true; } } + if (isset($ds['desc'])) { $grow['desc'] = $ds['desc']; } $graphrows[] = $grow; } } @@ -707,7 +708,7 @@ class rrdstat { $pconf = $pconf + (array)$this->config_page; $return = null; - switch ($pconf['type']) { + switch (@$pconf['type']) { case 'index': $return = $this->page_index($pconf); break; @@ -765,14 +766,27 @@ class rrdstat { $stats = $this->h_page_statsArray($pconf); + if (isset($pconf['stats_url'])) { $sURL_base = $pconf['stats_url']; } + else { $sURL_base = '?stat=%i%a'; } + + if (isset($pconf['stats_url_add'])) { $sURL_add = $pconf['stats_url_add']; } + else { $sURL_add = '&sub=%s'; } + $out .= '