Example #1
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;
     }
 }
Example #2
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;
 }