DeltaCMS/admin/system/website.php
Florian Bouillon bc8fba19d4 too manu changes (will list by files)
.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
2019-02-17 00:12:50 +01:00

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() {
}
}