From cf659ef490727520b205c0a3c160967d12e2f3da Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 18 Apr 2006 13:10:32 +0000 Subject: [PATCH] Fixed faiTemplate download icon git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3052 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiTemplateEntry.inc | 13 +++++++++++-- plugins/admin/fai/faiTemplateEntry.tpl | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/admin/fai/class_faiTemplateEntry.inc b/plugins/admin/fai/class_faiTemplateEntry.inc index b387581e7..9fec3e07b 100644 --- a/plugins/admin/fai/class_faiTemplateEntry.inc +++ b/plugins/admin/fai/class_faiTemplateEntry.inc @@ -75,17 +75,26 @@ class faiTemplateEntry extends plugin $this->FAItemplateFile = $str; /* If we don't have a filename set it from upload filename. */ - if( 0 == strlen( $this->FAItemplatePath ) ) + if( 0 == strlen( $this->FAItemplatePath )){ $this->FAItemplatePath = $_FILES['FAItemplateFile']['name']; + } + + $_SESSION['binary'] = $this->FAItemplateFile; + $_SESSION['binarytype'] = 'octet-stream'; + $_SESSION['binaryfile'] = basename( $this->FAItemplatePath ); } - } $status= _("no file uploaded yet"); + + $bStatus = false; // Hide download icon on default + if(strlen($this->FAItemplateFile)){ $status= sprintf(_("exists in database (size: %s bytes)"),strlen($this->FAItemplateFile)); + $bStatus = true; // Display download icon } $smarty->assign("status",$status); + $smarty->assign("bStatus",$bStatus); /* Magic quotes GPC, escapes every ' " \, to solve some security risks * If we post the escaped strings they will be escaped again diff --git a/plugins/admin/fai/faiTemplateEntry.tpl b/plugins/admin/fai/faiTemplateEntry.tpl index 1aa04a261..211e15f00 100644 --- a/plugins/admin/fai/faiTemplateEntry.tpl +++ b/plugins/admin/fai/faiTemplateEntry.tpl @@ -31,7 +31,7 @@ {$status} - {if $FAItemplatePath} + {if $bStatus} {t}Save template{/t}... {/if}
-- 2.30.2