Beispiel #1
0
 public function preview()
 {
     CMS::layout_view()->use_scripts('/tao/scripts/admin/vars/image.js');
     Core::load('CMS.Images');
     $url = CMS_Images::modified_image('./' . $this['image'], '150x150');
     $id = 'container-' . md5($this['image']);
     return "<span class='var-image-preview' data-image='{$url}' data-container='{$id}'>[Image]</span>";
 }
Beispiel #2
0
 public function draw($view, $content)
 {
     $_view = CMS::layout_view();
     CMS::layout_view($view);
     $content = CMS::process_insertions($content);
     CMS::layout_view($_view);
     return $content;
 }
Beispiel #3
0
 protected function template()
 {
     $template = CMS::layout_view();
     if (!$template) {
         $template = Templates_HTML::Template('empty');
     }
     return $template;
 }
Beispiel #4
0
 protected function render_view($template, array $parms = array(), $layout = '')
 {
     $t = parent::render_view($template, $parms, $layout);
     CMS::layout_view($t);
     return $t;
 }
Beispiel #5
0
 static function MAPS($parms = false)
 {
     if (!CMS::layout_view()) {
         return '';
     }
     Core::load('Templates.HTML.Helpers.Maps');
     $parms = explode(';', $parms);
     $type = trim($parms[0]);
     $map_id = trim($parms[1]);
     $name = trim($parms[2]);
     $options = CMS::vars()->get($name);
     return CMS::layout_view()->maps->map($type, $map_id, $name, $options);
 }
Beispiel #6
0
 /**
  * @param string|false $uri
  */
 static function process_navigation($uri = false)
 {
     if (!empty(self::$navigation)) {
         return self::$navigation;
     }
     if (!$uri) {
         $uri = WS::env()->request->path;
     }
     Core::load(self::$nav_module);
     self::$navigation = Core::make(self::$nav_module);
     self::$navigation->process($uri);
     if (method_exists(self::$navigation, 'layout')) {
         self::$navigation->layout(CMS::layout_view());
     }
 }