Пример #1
0
 public function __construct($file, $baseURI, $relativePath = '', $includeVariation = false, $flatList = false, $path, $isUpload = false, $foldersOnly = false, $place = '', $paginated = false)
 {
     parent::__construct($file, $baseURI, $relativePath);
     $this->place = $place;
     // If the relativePath is empty, we would assume that the user is currently on the root folder.
     if (empty($this->relativePath)) {
         $this->baseURI = dirname($baseURI);
         $this->relativePath = DIRECTORY_SEPARATOR;
     }
     if ($relativePath == DIRECTORY_SEPARATOR) {
         $this->isDS = true;
         $this->relativePath = parent::getRelativePath();
     }
     $this->includeVariation = $includeVariation;
     $this->contents = $this->getContents($foldersOnly, $paginated);
 }
Пример #2
0
 /**
  * Override parent's delete implementation since this is a folder.
  *
  * @access	public
  * @param	string	$path	The path to the folder.
  */
 public function delete($path)
 {
     // @TODO: Delete image variations here.
     jimport('joomla.filesystem.file');
     $name = basename($path);
     $name = str_ireplace('.', '\\.', $name);
     $filter = '(.*)_' . $name;
     $base = dirname($path);
     $files = JFolder::files($base, $filter, false, true);
     // @task: Add original image to path.
     $files[] = $path;
     // Let's request the parent to delete the item first.
     foreach ($files as $file) {
         parent::delete($file);
     }
     return true;
 }