private function initialize($node) { $this->title = ''; $this->keywords = ''; $this->description = ''; $this->html = ''; $this->css = ''; $this->js = ''; $is_404 = null === $this->page; $this->page = SystemPage::get($node->getProperty('reference')); if (null === $this->page) { header("HTTP/1.0 404 Not Found"); $this->initialize(Router::$root->getById(Config::get('404_PAGE'))); return; } $this->title = $node->getProperty('title'); $this->keywords = $node->getProperty('keywords'); $this->description = $node->getProperty('description'); $this->render_page(); $this->render_view(); ob_start(); eval('?>' . $this->html); if (count(Router::$parts)) { ob_end_clean(); Router::$parts = array(); header("HTTP/1.0 404 Not Found"); $this->initialize(Router::$root->getById(Config::get('404_PAGE'))); return; } if (Config::get('CACHE_ENABLED')) { Cache::add(Router::$url, Router::export() . $this->html); $filename = 'cache/' . md5(Router::$url); file_put_contents($filename, php_strip_whitespace($filename)); } }
<?php $reference = Router::$root->getById($_POST['id'])->getProperty('reference'); echo SystemPage::get($reference)->setJS($_POST['value']);
<?php $reference = Router::$root->getById($_POST['id'])->getProperty('reference'); echo SystemPage::get($reference)->getCSS();
<?php $id = $_POST['id']; $key = $_POST['key']; $type = $_POST['type']; $parent_node = Router::$root->getById($id); if (null !== $parent_node) { $new_node = new Node(); $new_node->properties['type'] = $type; if ($parent_node->append($key, $new_node)) { if ('php' == $type) { $reference = md5(microtime()); $php = SystemPhp::INSERT($reference); $new_node->properties['reference'] = $reference; } else { if ('page' == $type) { $reference = md5(microtime()); $page = SystemPage::INSERT($reference); $new_node->properties['reference'] = $reference; } } echo json_encode($new_node->toArray()); Router::save(); } }
<?php $reference = Router::$root->getById($_POST['id'])->getProperty('reference'); echo SystemPage::get($reference)->getPHP();