Reworked 'nodir'-function a bit and included it in the Page-class instead. Started working on a way to edit content files

This commit is contained in:
2014-07-04 18:27:49 +02:00
parent f723d7bd69
commit b9cbc947b5
8 changed files with 81 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
class Page
{
public $name, $filename;
public static $parentDir = "../";
public static $contentFolder = "content/";
public function __construct($name, $filename)
@@ -26,11 +27,24 @@ class Page
return $this->filename;
}
public function nodir($item)
{
return (!is_dir(Page::$parentDir . Page::$contentFolder . $item));
}
public static function fileList()
{
$dirContent = scandir(Page::$parentDir . Page::$contentFolder);
$files = (array_filter($dirContent, "Page::nodir"));
return $files;
}
// For future-uses...
public function getName()
{
return $this->name;
}
}
?>