Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
 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;
 }