public function __construct($path, $basePath = './', $baseUrl = '/') { $this->name = basename($path); $this->path = $path; $mediaFolder = Digitalus_Media::rootDirectory(); $this->fullPath = $basePath . $mediaFolder . '/' . $path; $this->fullUrl = $baseUrl . $mediaFolder . '/' . $path; $this->type = Digitalus_Media_Filetype::load($path); if ($this->fileExists()) { $this->exists = true; } }
public function getIcon($file) { $filetype = Digitalus_Media_Filetype::load($file); if ($filetype != null) { $type = $filetype->key; if (isset($this->icons->{$type})) { $filetype = $this->icons->{$type}; return $filetype->icon; } } return $this->defaultIcon; }