Exemplo n.º 1
0
 /**
  * Returns the item path relative to the root.
  */
 public function getPath()
 {
     if (isset($this->path)) {
         return $this->path;
     }
     if ($this->parent) {
         $path = $this->parent->getPath();
         if (isset($path)) {
             return Imce::joinPaths($path, $this->name);
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Sets the folder path.
  */
 public function setPath($path)
 {
     $oldpath = $this->path;
     if ($path !== $oldpath) {
         // Remove oldpath references
         if (isset($oldpath)) {
             unset($this->fm()->tree[$oldpath]);
             foreach ($this->subfolders as $name => $item) {
                 $item->setPath(NULL);
             }
         }
         // Add new path references
         $this->path = $path;
         if (isset($path)) {
             $this->fm()->tree[$path] = $this;
             foreach ($this->subfolders as $name => $item) {
                 $item->setPath(Imce::joinPaths($path, $name));
             }
         }
     }
 }