コード例 #1
0
ファイル: Filetype.php プロジェクト: laiello/digitalus-cms
 public static function load($filepath)
 {
     $fileExtension = Digitalus_Filesystem_File::getFileExtension($filepath);
     $fileExtension = strtolower($fileExtension);
     $allowedFiletypes = Digitalus_Media::getFiletypes();
     if (is_array($allowedFiletypes) && array_key_exists($fileExtension, $allowedFiletypes)) {
         return $allowedFiletypes[$fileExtension];
     }
     return null;
 }
コード例 #2
0
ファイル: File.php プロジェクト: laiello/digitalus-cms
 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;
     }
 }
コード例 #3
0
ファイル: MediaController.php プロジェクト: ngukho/ducbui-cms
 /**
  * Rename Folder Action
  *
  * @return void
  */
 public function renameFolderAction()
 {
     $filepath = Digitalus_Filter_Post::get('filepath');
     $folderName = Digitalus_Filter_Post::get('folder_name');
     Digitalus_Media::renameFolder($filepath, $folderName);
     $folder = Digitalus_Toolbox_String::addUnderscores(Digitalus_Toolbox_String::getParentFromPath($filepath) . '/' . $folderName);
     $this->_request->setParam('folder', $folder);
     $this->_forward('open-folder');
 }