public static function getFiletypes() { $config = Zend_Registry::get('config'); $filetypes = $config->filetypes; if ($filetypes) { foreach ($filetypes as $key => $filetype) { $type = new Digitalus_Media_Filetype($key, $filetype); $type->setFromConfigItem($key, $filetype); $registeredFiletypes[$key] = $type; } return $registeredFiletypes; } return null; }
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; }