Fix render of ReadOnly binary attributes

This commit is contained in:
Deon George 2009-08-13 21:22:41 +10:00
parent 59c4e7896f
commit 8a21bbee12

View File

@ -608,10 +608,9 @@ class PageRender extends Visitor {
printf('<small>[%s]</small>',_('Binary Value')); printf('<small>[%s]</small>',_('Binary Value'));
} }
protected function drawFormReadWriteValueBinaryAttribute($attribute,$i) { protected function drawFormReadOnlyValueBinaryAttribute($attribute,$i) {
if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__); if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
if ($attribute->getValue($i)) {
$this->draw('CurrentValue',$attribute,$i); $this->draw('CurrentValue',$attribute,$i);
echo '<br/><br/>'; echo '<br/><br/>';
@ -622,6 +621,13 @@ class PageRender extends Visitor {
htmlspecialchars($href),IMGDIR,_('download value')); htmlspecialchars($href),IMGDIR,_('download value'));
echo '<br/>'; echo '<br/>';
}
protected function drawFormReadWriteValueBinaryAttribute($attribute,$i) {
if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
if ($attribute->getValue($i)) {
$this->draw('FormReadOnlyValue',$attribute,$i);
if (! $attribute->isReadOnly() && $_SESSION[APPCONFIG]->isCommandAvailable('script','delete_attr')) if (! $attribute->isReadOnly() && $_SESSION[APPCONFIG]->isCommandAvailable('script','delete_attr'))
printf('<a href="javascript:deleteAttribute(\'%s\',\'%s\',\'%s\');" style="color:red;"><img src="%s/trash.png" alt="Trash" /> %s</a>', printf('<a href="javascript:deleteAttribute(\'%s\',\'%s\',\'%s\');" style="color:red;"><img src="%s/trash.png" alt="Trash" /> %s</a>',