aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--type/Default.class.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/type/Default.class.php b/type/Default.class.php
index f15ca32..0eab459 100644
--- a/type/Default.class.php
+++ b/type/Default.class.php
@@ -167,9 +167,27 @@ class Type_Default {
167 # use data_sources as sources 167 # use data_sources as sources
168 $sources = $this->data_sources; 168 $sources = $this->data_sources;
169 } 169 }
170 $this->fill_ds_names($sources);
170 return $sources; 171 return $sources;
171 } 172 }
172 173
174 function fill_ds_names($sources) {
175 $max = 0;
176 foreach ($sources as $source) {
177 if(strlen($source) > $max) {
178 $max = strlen($source);
179 }
180 }
181 if($max > 0) {
182 $fmt = sprintf("%%-%ds", $max);
183 foreach ($sources as $source) {
184 if(!isset($this->ds_names[$source])) {
185 $this->ds_names[$source] = sprintf($fmt, $source);
186 }
187 }
188 }
189 }
190
173 function rrd_gen_graph() { 191 function rrd_gen_graph() {
174 $rrdgraph = $this->rrd_options(); 192 $rrdgraph = $this->rrd_options();
175 193