From dea39449a9e4dad52f1682af680dd9fec9b6517f Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 22 Mar 2014 16:25:57 +0100 Subject: type/Default: merge file2identifier function into rrd_files --- type/Default.class.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/type/Default.class.php b/type/Default.class.php index c4fa8a9..2cd8560 100644 --- a/type/Default.class.php +++ b/type/Default.class.php @@ -34,7 +34,6 @@ class Type_Default { $this->cache = $config['cache']; $this->parse_get(); $this->rrd_files(); - $this->identifiers = $this->file2identifier($this->files); $this->width = GET('x'); if (empty($this->width)) $this->width = $config['width']; $this->height = GET('y'); @@ -143,10 +142,12 @@ class Type_Default { $this->tinstances[] = $instance; $this->files[$instance] = $filename; + $this->identifiers[$instance] = preg_replace("#^$this->datadir/(.*)\.rrd$#", '$1', $filename); } sort($this->tinstances); ksort($this->files); + ksort($this->identifiers); } function get_filenames() { @@ -166,17 +167,6 @@ class Type_Default { return $files; } - function file2identifier($files) { - foreach($files as $key => $file) { - if (is_file($file)) { - $files[$key] = preg_replace("#^$this->datadir/#u", '', $files[$key]); - $files[$key] = preg_replace('#\.rrd$#', '', $files[$key]); - } - } - - return $files; - } - function rrd_graph($debug = false) { if (!$this->colors) $this->rainbow_colors(); -- cgit v1.1