aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/type
diff options
context:
space:
mode:
authorAlexander Meshcheryakov2018-06-20 00:22:31 +0300
committerGitHub2018-06-20 00:22:31 +0300
commite9a1fed491735e551337f72c25a41ae581cac0f8 (patch)
tree0a4c85533046cf07935e738c19d225fabc7d54a1 /type
parentMerge pull request #160 from gaaf/multi_neg_io (diff)
downloadapt-panopticon_cgp-e9a1fed491735e551337f72c25a41ae581cac0f8.zip
apt-panopticon_cgp-e9a1fed491735e551337f72c25a41ae581cac0f8.tar.gz
apt-panopticon_cgp-e9a1fed491735e551337f72c25a41ae581cac0f8.tar.bz2
apt-panopticon_cgp-e9a1fed491735e551337f72c25a41ae581cac0f8.tar.xz
Provide meaningful filenames for graphs
Gives decent default name when saving graph from browser as file and distinguishable tab for tabs showing graph.php output.
Diffstat (limited to 'type')
-rw-r--r--type/Base.class.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/type/Base.class.php b/type/Base.class.php
index 70b95b5..adb8fb1 100644
--- a/type/Base.class.php
+++ b/type/Base.class.php
@@ -245,10 +245,13 @@ class Type_Base {
245 if (is_numeric($this->cache) && $this->cache > 0) 245 if (is_numeric($this->cache) && $this->cache > 0)
246 header("Expires: " . date(DATE_RFC822,strtotime($this->cache." seconds"))); 246 header("Expires: " . date(DATE_RFC822,strtotime($this->cache." seconds")));
247 247
248 if ($style === 'svg') 248 if ($style === 'svg') {
249 header("content-type: image/svg+xml"); 249 header("content-type: image/svg+xml");
250 else 250 header('Content-Disposition: filename="' . $this->rrd_title . '.svg"');
251 } else {
251 header("content-type: image/png"); 252 header("content-type: image/png");
253 header('Content-Disposition: filename="' . $this->rrd_title . '.png"');
254 }
252 255
253 $shellcmd = array_merge( 256 $shellcmd = array_merge(
254 $this->rrd_graph_command($style), 257 $this->rrd_graph_command($style),