ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilCloudFileNode Class Reference

ilCloudFileTree class More...

+ Collaboration diagram for ilCloudFileNode:

Public Member Functions

 __construct ($path, $id)
 
 setId ($id)
 
 getId ()
 
 setLoadingComplete ($complete)
 
 getLoadingComplete ()
 
 setPath ($path="/")
 
 getPath ()
 
 addChild ($path)
 
 removeChild ($path)
 
 getChildrenPathes ()
 
 hasChildren ()
 
 setParentId ($id)
 
 getParentId ()
 
 setIsDir ($is_dir)
 
 getIsDir ()
 
 setSize ($size)
 
 getSize ()
 
 setModified ($modified)
 
 getModified ()
 
 setIconPath ($path)
 
 getIconPath ()
 
 setMixed ($mixed)
 
 getMixed ()
 
 getJSONEncode ()
 

Protected Attributes

 $id = 0
 
 $path = ""
 
 $parent_id = -1
 
 $children = array()
 
 $loading_complete = false
 
 $is_dir = false
 
 $size = 0
 
 $modified = 0
 
 $created = 0
 
 $icon_path = ""
 
 $mixed
 

Detailed Description

ilCloudFileTree class

Representation of a node (a file or a folder) in the file tree

Author
Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
Version
$Id$

Definition at line 13 of file class.ilCloudFileNode.php.

Constructor & Destructor Documentation

◆ __construct()

ilCloudFileNode::__construct (   $path,
  $id 
)
Parameters
string$path

Definition at line 73 of file class.ilCloudFileNode.php.

References $id, $path, setId(), and setPath().

+ Here is the call graph for this function:

Member Function Documentation

◆ addChild()

ilCloudFileNode::addChild (   $path)
Parameters
$path

Definition at line 130 of file class.ilCloudFileNode.php.

References $path.

131  {
132  if (!isset($this->children[$path]))
133  {
134  $this->children[$path] = $path;
135  }
136 
137  }

◆ getChildrenPathes()

ilCloudFileNode::getChildrenPathes ( )
Returns
array|null

Definition at line 154 of file class.ilCloudFileNode.php.

References $children, and hasChildren().

Referenced by getJSONEncode(), and ilCloudFileTree\getSortedListOfChildren().

155  {
156  if ($this->hasChildren())
157  {
158  return $this->children;
159  }
160  return null;
161 
162  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIconPath()

ilCloudFileNode::getIconPath ( )
Returns
string

Definition at line 248 of file class.ilCloudFileNode.php.

References $icon_path.

Referenced by ilCloudPluginFileTreeGUI\getItemHtml().

249  {
250  return $this->icon_path;
251  }
+ Here is the caller graph for this function:

◆ getId()

ilCloudFileNode::getId ( )
Returns
int

Definition at line 90 of file class.ilCloudFileNode.php.

References $id.

Referenced by ilCloudPluginFileTreeGUI\getItemHtml(), getJSONEncode(), ilCloudPluginFileTreeGUI\getLinkToFolder(), and ilCloudPluginFileTreeGUI\getLocatorHtml().

91  {
92  return $this->id;
93  }
+ Here is the caller graph for this function:

◆ getIsDir()

ilCloudFileNode::getIsDir ( )
Returns
bool

Definition at line 200 of file class.ilCloudFileNode.php.

References $is_dir.

Referenced by ilCloudPluginFileTreeGUI\getItemHtml(), and getJSONEncode().

201  {
202  return $this->is_dir;
203  }
+ Here is the caller graph for this function:

◆ getJSONEncode()

ilCloudFileNode::getJSONEncode ( )
Returns
array

Definition at line 273 of file class.ilCloudFileNode.php.

References array, getChildrenPathes(), getId(), getIsDir(), getLoadingComplete(), getParentId(), getPath(), and getSize().

274  {
275  $node = array();
276  $node["id"] = $this->getId();
277  $node["is_dir"] = $this->getIsDir();
278  $node["path"] = $this->getPath();
279  $node["parent_id"] = $this->getParentId();
280  $node["loading_complete"] = $this->getLoadingComplete();
281  $node["children"] = $this->getChildrenPathes();
282  $node["size"] = $this->getSize();
283 
284  return $node;
285  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getLoadingComplete()

ilCloudFileNode::getLoadingComplete ( )
Returns
bool

Definition at line 106 of file class.ilCloudFileNode.php.

References $loading_complete.

Referenced by getJSONEncode().

107  {
109  }
+ Here is the caller graph for this function:

◆ getMixed()

ilCloudFileNode::getMixed ( )
Returns
mixed

Definition at line 264 of file class.ilCloudFileNode.php.

References $mixed.

265  {
266  return $this->mixed;
267  }

◆ getModified()

ilCloudFileNode::getModified ( )
Returns
int

Definition at line 232 of file class.ilCloudFileNode.php.

References $modified.

Referenced by ilCloudPluginFileTreeGUI\getItemHtml().

233  {
234  return $this->modified;
235  }
+ Here is the caller graph for this function:

◆ getParentId()

ilCloudFileNode::getParentId ( )
Returns
int

Definition at line 184 of file class.ilCloudFileNode.php.

References $parent_id.

Referenced by getJSONEncode(), ilCloudPluginFileTreeGUI\getLinkToFolder(), and ilCloudPluginFileTreeGUI\getLocatorHtml().

185  {
186  return $this->parent_id;
187  }
+ Here is the caller graph for this function:

◆ getPath()

ilCloudFileNode::getPath ( )
Returns
string

Definition at line 122 of file class.ilCloudFileNode.php.

References $path.

Referenced by ilCloudPluginFileTreeGUI\getItemHtml(), getJSONEncode(), ilCloudPluginFileTreeGUI\getLinkToFolder(), and ilCloudPluginFileTreeGUI\getLocatorHtml().

123  {
124  return $this->path;
125  }
+ Here is the caller graph for this function:

◆ getSize()

ilCloudFileNode::getSize ( )
Returns
int

Definition at line 216 of file class.ilCloudFileNode.php.

References $size.

Referenced by ilCloudPluginFileTreeGUI\getItemHtml(), and getJSONEncode().

217  {
218  return $this->size;
219  }
+ Here is the caller graph for this function:

◆ hasChildren()

ilCloudFileNode::hasChildren ( )
Returns
bool

Definition at line 167 of file class.ilCloudFileNode.php.

Referenced by getChildrenPathes().

168  {
169  return (count($this->children) > 0);
170  }
+ Here is the caller graph for this function:

◆ removeChild()

ilCloudFileNode::removeChild (   $path)
Parameters
$path

Definition at line 142 of file class.ilCloudFileNode.php.

References $path.

143  {
144  if (isset($this->children[$path]))
145  {
146  unset($this->children[$path]);
147  }
148 
149  }

◆ setIconPath()

ilCloudFileNode::setIconPath (   $path)
Parameters
$path

Definition at line 240 of file class.ilCloudFileNode.php.

References $path.

241  {
242  $this->icon_path = $path;
243  }

◆ setId()

ilCloudFileNode::setId (   $id)
Parameters
$id

Definition at line 82 of file class.ilCloudFileNode.php.

References $id.

Referenced by __construct().

83  {
84  $this->id = $id;
85  }
+ Here is the caller graph for this function:

◆ setIsDir()

ilCloudFileNode::setIsDir (   $is_dir)
Parameters
$is_dir

Definition at line 192 of file class.ilCloudFileNode.php.

References $is_dir.

193  {
194  $this->is_dir = $is_dir;
195  }

◆ setLoadingComplete()

ilCloudFileNode::setLoadingComplete (   $complete)
Parameters
bool$complete

Definition at line 98 of file class.ilCloudFileNode.php.

99  {
100  $this->loading_complete = $complete;
101  }

◆ setMixed()

ilCloudFileNode::setMixed (   $mixed)
Parameters
mixed$mixed

Definition at line 256 of file class.ilCloudFileNode.php.

References $mixed.

257  {
258  $this->mixed = $mixed;
259  }

◆ setModified()

ilCloudFileNode::setModified (   $modified)
Parameters
$modified

Definition at line 224 of file class.ilCloudFileNode.php.

References $modified.

225  {
226  $this->modified = $modified;
227  }

◆ setParentId()

ilCloudFileNode::setParentId (   $id)
Parameters
$id

Definition at line 176 of file class.ilCloudFileNode.php.

References $id.

177  {
178  $this->parent_id = $id;
179  }

◆ setPath()

ilCloudFileNode::setPath (   $path = "/")
Parameters
string$path

Definition at line 114 of file class.ilCloudFileNode.php.

References $path, and ilCloudUtil\normalizePath().

Referenced by __construct().

115  {
116  $this->path = ilCloudUtil::normalizePath($path,$this->is_dir);
117  }
static normalizePath($path)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSize()

ilCloudFileNode::setSize (   $size)
Parameters
$size

Definition at line 208 of file class.ilCloudFileNode.php.

References $size, and size.

209  {
210  $this->size = $size;
211  }
font size
Definition: langcheck.php:162

Field Documentation

◆ $children

ilCloudFileNode::$children = array()
protected

Definition at line 33 of file class.ilCloudFileNode.php.

Referenced by getChildrenPathes().

◆ $created

ilCloudFileNode::$created = 0
protected

Definition at line 58 of file class.ilCloudFileNode.php.

◆ $icon_path

ilCloudFileNode::$icon_path = ""
protected

Definition at line 63 of file class.ilCloudFileNode.php.

Referenced by getIconPath().

◆ $id

ilCloudFileNode::$id = 0
protected

Definition at line 18 of file class.ilCloudFileNode.php.

Referenced by __construct(), getId(), setId(), and setParentId().

◆ $is_dir

ilCloudFileNode::$is_dir = false
protected

Definition at line 43 of file class.ilCloudFileNode.php.

Referenced by getIsDir(), and setIsDir().

◆ $loading_complete

ilCloudFileNode::$loading_complete = false
protected

Definition at line 38 of file class.ilCloudFileNode.php.

Referenced by getLoadingComplete().

◆ $mixed

ilCloudFileNode::$mixed
protected

Definition at line 68 of file class.ilCloudFileNode.php.

Referenced by getMixed(), and setMixed().

◆ $modified

ilCloudFileNode::$modified = 0
protected

Definition at line 53 of file class.ilCloudFileNode.php.

Referenced by getModified(), and setModified().

◆ $parent_id

ilCloudFileNode::$parent_id = -1
protected

Definition at line 28 of file class.ilCloudFileNode.php.

Referenced by getParentId().

◆ $path

ilCloudFileNode::$path = ""
protected

◆ $size

ilCloudFileNode::$size = 0
protected

Definition at line 48 of file class.ilCloudFileNode.php.

Referenced by getSize(), and setSize().


The documentation for this class was generated from the following file: