namespace Combodo\iTop\Form\Field; use utils; use Dict; /** * Description of ImageField * * @author Guillaume Lajarige */ class ImageField extends BlobField { /** * @inheritDoc */ public function GetDisplayValue() { if ($this->currentValue->IsEmpty()) { $sValue = Dict::S('Portal:File:None'); } else { $sFilename = $this->currentValue->GetFileName(); $iSize = utils::BytesToFriendlyFormat(utils::StrLen($this->currentValue->GetData())); $sOpenLink = $this->GetDisplayUrl(); $sDownloadLink = $this->GetDownloadUrl(); $sValue = Dict::Format('Portal:File:DisplayInfo+', $sFilename, $iSize, $sOpenLink, $sDownloadLink); } return $sValue; } }