From 0a28d7fe6ddebdc74a343574a38f3bb646a7ddd5 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 20 Apr 2014 06:27:27 +0200 Subject: Added new methods --- www/functions/class_files.php | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'www/functions/class_files.php') diff --git a/www/functions/class_files.php b/www/functions/class_files.php index 716d4c2..0cf066c 100644 --- a/www/functions/class_files.php +++ b/www/functions/class_files.php @@ -4,9 +4,33 @@ class file { public $file; - function __construct(){ - $f = collect_content($GLOBALS["db"], $_GET["name"], $_GET["folder"]); - $this->file=$f; + function __construct($val = null){ + if($val == null){ + $this->file = collect_content($GLOBALS["db"], $_GET["name"], $_GET["folder"]); + } else { + $this->file = $val; + } + } + function NotFound(){ + if($this->file == FILE_NOT_FOUND){ + return true; + } else { + return false; + } + } + function isEmpty(){ + if($this->file == EMPTY_FOLDER){ + return true; + } else { + return false; + } + } + function isFile(){ + if(check_if_file($GLOBALS["db"], $_GET["name"], $_GET["folder"])){ + return true; + } else { + return false; + } } function initFile($val){ $this->file=$val; -- cgit v1.2.3