summaryrefslogtreecommitdiff
path: root/httemplate/config
diff options
context:
space:
mode:
authorivan <ivan>2009-03-17 09:58:17 +0000
committerivan <ivan>2009-03-17 09:58:17 +0000
commit2755d4a4810600f4392eaf73f362b4f358adeec6 (patch)
treef5382c884512cdc2a788ce616f05af823bac23d7 /httemplate/config
parent541207eb5505eee6eafd25e861230bdb36ac5fb3 (diff)
add eps preview to config, for RT#5025
Diffstat (limited to 'httemplate/config')
-rw-r--r--httemplate/config/config-image.cgi5
-rw-r--r--httemplate/config/config-view.cgi32
2 files changed, 25 insertions, 12 deletions
diff --git a/httemplate/config/config-image.cgi b/httemplate/config/config-image.cgi
index 892f7c65b..0de9d4278 100644
--- a/httemplate/config/config-image.cgi
+++ b/httemplate/config/config-image.cgi
@@ -1,4 +1,4 @@
-<% $conf->config_binary($name, $agentnum) %>
+<% $logo %>
<%init>
die "access denied"
@@ -16,4 +16,7 @@ if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
$agentnum = $1;
}
+my $logo = $conf->config_binary($name, $agentnum);
+$logo = eps2png($logo) if $name =~ /\.eps$/i;
+
</%init>
diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi
index 0f5fd6213..f2ae892a6 100644
--- a/httemplate/config/config-view.cgi
+++ b/httemplate/config/config-view.cgi
@@ -69,22 +69,32 @@ Click on a configuration value to change it.
% } elsif ( $type eq 'image' ) {
<tr>
-
- <% $conf->exists($i->key, $agentnum)
- ? '<img src="config-image.cgi?key='. $i->key.
- ';agentnum='. $agentnum. '">'
- : 'empty'
- %>
+ <td bgcolor='#ffffff'>
+ <% $conf->exists($i->key, $agentnum)
+ ? '<img src="config-image.cgi?key='. $i->key.
+ ';agentnum='. $agentnum. '">'
+ : 'empty'
+ %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <% $conf->exists($i->key, $agentnum)
+ ? qq!<a href="config-download.cgi?key=!. $i->key. ';agentnum='. $agentnum. qq!">download</a>!
+ : ''
+ %>
+ </td>
</tr>
% } elsif ( $type eq 'binary' ) {
<tr>
-
- <% $conf->exists($i->key, $agentnum)
- ? qq!<a href="config-download.cgi?key=!. $i->key. ';agentnum='. $agentnum. qq!">download</a>!
- : 'empty'
- %>
+ <td>
+ <% $conf->exists($i->key, $agentnum)
+ ? qq!<a href="config-download.cgi?key=!. $i->key. ';agentnum='. $agentnum. qq!">download</a>!
+ : 'empty'
+ %>
+ </td>
</tr>
% } elsif ( $type eq 'textarea'