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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
function start_html($title)
|
||||
{
|
||||
print "
|
||||
<html>
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title>$title</title>
|
||||
</head>
|
||||
|
@@ -3,6 +3,7 @@ function terminate($message="")
|
||||
{
|
||||
print "$message\n";
|
||||
footer();
|
||||
exit(1);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user