From 5a138d4c0464b591177cf523ebb8e0603e32d650 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Mon, 28 Dec 2009 15:47:42 +0100 Subject: replace duplicate code by function rrd_options --- type/Default.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'type/Default.class.php') diff --git a/type/Default.class.php b/type/Default.class.php index f40d12d..817521a 100644 --- a/type/Default.class.php +++ b/type/Default.class.php @@ -84,9 +84,7 @@ class Type_Default { } } - function rrd_gen_graph() { - $filename = $this->get_filename(); - + function rrd_options() { $rrdgraph[] = '/usr/bin/rrdtool graph - -a PNG'; $rrdgraph[] = sprintf('-w %d', is_numeric($this->width) ? $this->width : 400); $rrdgraph[] = sprintf('-h %d', is_numeric($this->heigth) ? $this->heigth : 175); @@ -95,6 +93,14 @@ class Type_Default { $rrdgraph[] = sprintf('-v "%s"', $this->rrd_vertical); $rrdgraph[] = sprintf('-s -%d', is_numeric($this->seconds) ? $this->seconds : 86400); + return $rrdgraph; + } + + function rrd_gen_graph() { + $filename = $this->get_filename(); + + $rrdgraph = $this->rrd_options(); + if (is_array($this->args['tinstance'])) $array = is_array($this->order) ? $this->order : $this->args['tinstance']; else -- cgit v1.1