Exemplo n.º 1
0
 public function render_template()
 {
     $template = SystemTemplate::get(Router::$node->getProperty('template'));
     if (null === $template) {
         $template = SystemTemplate::get(Config::get('DEFAULT_TEMPLATE'));
     }
     $html = $template->getPHP();
     $tokens = TreeScript::getParse($html);
     $text = '';
     foreach ($tokens as $i => $token) {
         if ($token['type'] == 'tag' && $token['name'] == 'BODY') {
             $text .= $this->html;
         } else {
             $this->tokenDefault($token, $text);
         }
     }
     $this->html = $text;
     $this->css .= $template->getCSS();
     $this->appendJS($template->getJS());
 }
Exemplo n.º 2
0
<?php

$id = $_POST['id_template'];
$code = $_POST['html'];
SystemTemplate::get($id)->setPHP($code);
Exemplo n.º 3
0
<?php

$id = $_POST['id_template'];
$code = $_POST['js'];
SystemTemplate::get($id)->setJS($code);
Exemplo n.º 4
0
<?php

$id = $_POST['id_template'];
$template = SystemTemplate::get($id);
$result = array('html' => $template->getPHP(), 'css' => $template->getCSS(), 'js' => $template->getJS());
echo json_encode($result);