mirror of
https://github.com/Aviortheking/DeltaCMS.git
synced 2025-04-22 10:52:11 +00:00
.gitignore ignores some launch files changelog.md, readme.md added end file line public.php moved started the work on it router.php added require to functions & moved the function in the file set an ini value to show errors defied some constants moved the public page management to public/public.php exampleModule -> headGenerator.php started working on module management *.json reworked files function.php added this file to manages cores functions website.php the Website Object for theme & modules page.php created a test theme
41 lines
846 B
PHP
41 lines
846 B
PHP
<?php
|
|
|
|
class Website {
|
|
|
|
private $root;
|
|
|
|
private const TEMPLATEJSON = "templates.json";
|
|
|
|
|
|
public function __construct(String $root) {
|
|
$this->root = $root;
|
|
}
|
|
|
|
private function getTemplateFileURI() {
|
|
return $this->root . "/admin/settings/" . self::TEMPLATEJSON;
|
|
}
|
|
|
|
public function addTemplate(String $name, String $path, String $func, $bool) {
|
|
var_dump($_SERVER);
|
|
|
|
$val = array(
|
|
$name => array(
|
|
"URI" => $path,
|
|
"function" => $func,
|
|
"static" => $bool
|
|
)
|
|
);
|
|
if(! file_exists($this->getTemplateFileURI())) {
|
|
file_put_contents($this->getTemplateFileURI(), json_encode($val));
|
|
} else {
|
|
$json = json_decode(file_get_contents($this->getTemplateFileURI()), true);
|
|
$json = array_merge($json, $val);
|
|
file_put_contents($this->getTemplateFileURI(), json_encode($json));
|
|
}
|
|
}
|
|
|
|
public function addJS() {
|
|
|
|
}
|
|
}
|