Ejemplo n.º 1
0
 public function finish()
 {
     header('Content-Type: application/json');
     $this->data = json_encode($this->data);
     $this->data = preg_replace_callback('/\\{ICON:([\\w-]+)\\}/s', function ($icon) {
         return addslashes(Iconset::instance()->{$icon[1]});
     }, $this->data);
     return $this->data;
 }
Ejemplo n.º 2
0
 public function finish()
 {
     /** @var \Base $f3 */
     $f3 = \Base::instance();
     include 'app/loader.php';
     if ($this->data) {
         $f3->mset($this->data);
     }
     /*
     	3-step processing of the inner page content:
     	- render page
     	- process tags
     	- prepare data for outer page rendering
     */
     $body = $this->post_render($this->tagWork(\Template::instance()->render('body.html')));
     $body = preg_replace_callback('/\\{ICON:([\\w-]+)\\}/s', function ($icon) {
         return Iconset::instance()->{$icon[1]};
     }, $body);
     $f3->set('BODY', $body);
     return \Template::instance()->render('layout.html');
 }
Ejemplo n.º 3
0
 public function finish()
 {
     /** @var \Base $f3 */
     $f3 = \Base::instance();
     $cfg = $f3->get('CONFIG');
     if ($this->data) {
         $f3->mset($this->data);
     }
     if (isset($this->JS['head'])) {
         $f3->set('JS_HEAD', implode("\n", $this->JS['head']));
     }
     if (isset($this->JS['body'])) {
         $f3->set('JS_BODY', implode("\n", $this->JS['body']));
     }
     $f3->set('TITLE', implode($cfg['page_title_separator'], array_merge([$cfg['page_title']], $this->title)));
     $f3->set('DEBUGLOG', $f3->get('DB')->log());
     return preg_replace_callback('/\\{ICON:([\\w-]+)\\}/s', function ($icon) {
         return Iconset::instance()->{$icon[1]};
         //return "#";
     }, \Template::instance()->render('layout.html'));
     return $body;
 }
Ejemplo n.º 4
0
 function merge(Iconset $iconset, $over = true)
 {
     $tag = $iconset->tag();
     $prepend = $iconset->prepend();
     $append = $iconset->append();
     $class = $iconset->getClass();
     foreach ($iconset->icons() as $name => $icon) {
         if (!isset($this->icons[$name]) || $over) {
             if (empty($icon['tag']) && $tag && $this->tag !== $tag) {
                 $icon['tag'] = $tag;
             }
             if (empty($icon['prepend']) && $prepend && $this->prepend !== $prepend) {
                 $icon['prepend'] = $prepend;
             }
             if (empty($icon['append']) && $append && $this->append !== $append) {
                 $icon['append'] = $append;
             }
             if (empty($icon['class']) && $class && $this->class !== $class) {
                 $icon['class'] = $class;
             }
             $this->icons[$name] = $icon;
         }
     }
     if (isset($iconset->defaults) && count($iconset->defaults > 0)) {
         foreach ($iconset->defaults as $defname) {
             if (!isset($this->icons[$defname]) || $over) {
                 $deficon['id'] = $defname;
                 $deficon['tag'] = $tag;
                 $deficon['prepend'] = $prepend;
                 $deficon['append'] = $append;
                 $this->icons[$defname] = $deficon;
             }
         }
     }
 }