Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/files/file_tp.php
Show All 20 Lines | |||||
$params[$this->getPrefixSpecial().'_event'] = 'OnDownloadFile'; | $params[$this->getPrefixSpecial().'_event'] = 'OnDownloadFile'; | ||||
$params['pass'] = 'm,'.$this->Application->getUnitOption($this->Prefix, 'ParentPrefix').','.$this->getPrefixSpecial(); | $params['pass'] = 'm,'.$this->Application->getUnitOption($this->Prefix, 'ParentPrefix').','.$this->getPrefixSpecial(); | ||||
return $this->ItemLink($params); | return $this->ItemLink($params); | ||||
} | } | ||||
function FileIcon($params) | function FileIcon($params) | ||||
{ | { | ||||
/** @var kDBItem $object */ | |||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
/* @var $object kDBItem */ | |||||
$last_dot = mb_strrpos($object->GetDBField('FilePath'), '.'); | $last_dot = mb_strrpos($object->GetDBField('FilePath'), '.'); | ||||
$ext = ($last_dot !== false) ? mb_substr($object->GetDBField('FilePath'), $last_dot + 1).'.gif' : ''; | $ext = ($last_dot !== false) ? mb_substr($object->GetDBField('FilePath'), $last_dot + 1).'.gif' : ''; | ||||
return $ext ? $ext : $params['default']; | return $ext ? $ext : $params['default']; | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |