Exemplo n.º 1
0
 function parse($html = null, $blockName = 'document', $blockParams = null)
 {
     $blockParams = (array) $blockParams;
     $blockParams += array('range' => true, 'min' => 0, 'max' => 100, 'values' => array(0, 100), 'domId' => SL::uniqid());
     $options = $blockParams;
     unset($options['domId']);
     $key = "jqueryUiSlider-{$blockParams['domId']}";
     SlConfigure::write("Asset.js.ready.{$key}", "\$('#{$blockParams['domId']}').slider(" . json_encode($options) . ')');
     return parent::parse($html, $blockName);
 }
Exemplo n.º 2
0
 function parse($html = null, $blockName = 'document', $blockParams = null)
 {
     $blockParams = (array) $blockParams;
     $blockParams += array('width' => 300, 'height' => 120, 'version' => '9.0.0.0', 'src' => 'swfobject/test.swf', 'id' => SL::uniqid(), 'flashvars' => array(), 'params' => array(), 'attributes' => array());
     if ($html && !preg_match('/[\\n]/', $html)) {
         $blockParams['src'] = $html;
         $html = null;
     }
     foreach (array('flashvars', 'params', 'attributes') as $key) {
         $blockParams[$key] = json_encode($blockParams[$key]);
     }
     $this->vars = $blockParams;
     return parent::parse($html, $blockName);
 }
Exemplo n.º 3
0
 function parse($html = null, $blockName = 'document', $blockParams = null)
 {
     $blockParams = (array) $blockParams;
     $blockParams += array('id' => false, 'skin' => null);
     if ($blockName === 'NodeIndex') {
         $skin = empty(SL::getInstance()->view->params['named']['skin']) ? Inflector::camelize($blockParams['skin']) : Inflector::camelize(SL::getInstance()->view->params['named']['skin']);
         $skin = $skin && Pheme::init("NodeIndex{$skin}") ? "NodeIndex{$skin}" : "NodeIndexDefault";
     } else {
         $skin = $blockName;
     }
     $this->vars['ajaxId'] = SL::uniqid();
     if ($blockParams['id'] === false) {
         $nodes = $this->_getVar('nodes');
     } else {
         if ($blockParams['id'] === 0) {
             $blockParams['id'] = null;
         }
         $nodes = SlNode::find('all', array('conditions' => array('CmsNode.parent_id' => $blockParams['id'], 'CmsNode.visible' => true), 'order' => array('CmsNode.lft' => 'asc'), 'auth' => 'index'));
     }
     if ($nodes) {
         foreach ($nodes as &$node) {
             $node['href'] = h(SlNode::url($node));
         }
         $this->blocks["loop"]->params[0] =& $nodes;
         if ($skin != $blockName) {
             PhemeParser::$parseCallStack[] = Pheme::get($skin);
         }
         PhemeParser::$parseCallStack[] = Pheme::get('NodeView');
         $html = parent::parse($html, $skin);
         array_pop(PhemeParser::$parseCallStack);
         if ($skin != $blockName) {
             array_pop(PhemeParser::$parseCallStack);
         }
         return $html;
     }
 }
Exemplo n.º 4
0
 function parse($html = null, $blockName = 'document', $blockParams = null)
 {
     $blockParams = (array) $blockParams;
     $blockParams += array('id' => false, 'width' => 0, 'colspan' => 1);
     if (empty($blockParams['id']) && preg_match('/^[a-z0-9]+$/i', $html)) {
         $blockParams['id'] = $html;
         $html = null;
     }
     if (empty($html) && $blockParams['id']) {
         $html = $blockParams['id'] == 'Content' ? '{SiteContent/}' : "{Blocks(\"id\":\"{$blockParams['id']}\")/}";
     }
     if ($html) {
         $uid = SL::uniqid();
         $this->referrer()->columns[$uid] = array(parent::parse($html, $blockName), $blockParams);
         return $uid;
     }
 }