summaryrefslogtreecommitdiff
path: root/www/functions
diff options
context:
space:
mode:
Diffstat (limited to 'www/functions')
-rw-r--r--www/functions/class_files.php30
1 files changed, 27 insertions, 3 deletions
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;