From 8a21bbee12ccce2af57158691732104b74f2578c Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 13 Aug 2009 21:22:41 +1000 Subject: [PATCH] Fix render of ReadOnly binary attributes --- lib/PageRender.php | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/lib/PageRender.php b/lib/PageRender.php index d2882f5..d923f4b 100644 --- a/lib/PageRender.php +++ b/lib/PageRender.php @@ -608,20 +608,26 @@ class PageRender extends Visitor { printf('[%s]',_('Binary Value')); } + protected function drawFormReadOnlyValueBinaryAttribute($attribute,$i) { + if (DEBUGTMP) printf('%s
',__METHOD__); + + $this->draw('CurrentValue',$attribute,$i); + echo '

'; + + $href = sprintf('download_binary_attr.php?server_id=%s&dn=%s&attr=%s&index=%s', + $this->getServerID(),rawurlencode($this->template->getDN()),$attribute->getName(),$i); + + printf('Save %s', + htmlspecialchars($href),IMGDIR,_('download value')); + + echo '
'; + } + protected function drawFormReadWriteValueBinaryAttribute($attribute,$i) { if (DEBUGTMP) printf('%s
',__METHOD__); if ($attribute->getValue($i)) { - $this->draw('CurrentValue',$attribute,$i); - echo '

'; - - $href = sprintf('download_binary_attr.php?server_id=%s&dn=%s&attr=%s&index=%s', - $this->getServerID(),rawurlencode($this->template->getDN()),$attribute->getName(),$i); - - printf('Save %s', - htmlspecialchars($href),IMGDIR,_('download value')); - - echo '
'; + $this->draw('FormReadOnlyValue',$attribute,$i); if (! $attribute->isReadOnly() && $_SESSION[APPCONFIG]->isCommandAvailable('script','delete_attr')) printf('Trash %s',