From dfd4ecb78450b3c580ce06fccc86e40c7fbf9646 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 10 May 2014 17:09:11 +0200 Subject: type/base: set default title to "Plugin Type (PluginInstance) (Category)" --- type/Base.class.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/type/Base.class.php b/type/Base.class.php index 5de381e..4cb9e18 100644 --- a/type/Base.class.php +++ b/type/Base.class.php @@ -36,7 +36,19 @@ class Type_Base { $this->rrdtool_opts = $config['rrdtool_opts']; $this->cache = $config['cache']; $this->parse_get($_get); - $this->rrd_title = $this->args['plugin']; + $this->rrd_title = sprintf( + '%s%s%s%s', + $this->args['plugin'], + $this->args['type'] != $this->args['plugin'] + ? sprintf(' %s', $this->args['type']) + : '', + (isset($this->args['pinstance']) and $this->args['pinstance'] != '') + ? sprintf(' (%s)', $this->args['pinstance']) + : '', + (isset($this->args['category']) and $this->args['category'] != '') + ? sprintf(' (%s)', $this->args['category']) + : '' + ); $this->rrd_files(); $this->width = isset($_get['x']) ? $_get['x'] : $config['width']; $this->height = isset($_get['y']) ? $_get['y'] : $config['height']; -- cgit v1.1