getConfig()->toArray(); unset($item['__constructorOptions']); $item['tpl'] = 'Slide/view.tpl'; $item['maxWidth'] = $this->getConfig('image')->get('width'); $item['maxHeight'] = $this->getConfig('image')->get('height'); $item['idItem'] = $this->getIdItem(); $limit = intval($this->getConfig('limit')); if ($limit) { $this->_getDataObj()->getListSelect()->limit($limit); } $list = $this->_getDataObj()->getList(); if (empty($list)) { return false; } if (is_array($list) && !empty($list)) { foreach ($list as &$slide) { $slide['title'] = htmlspecialchars($slide['title']); if ($slide['backgroundImage']) { $slide['backgroundImage'] = Qs_ImageFs::get( $slide['backgroundImage'], $item['maxWidth'], $item['maxHeight'] ); } $slide['image'] = Qs_ImageFs::get( $slide['image'], $item['maxWidth'], $item['maxHeight'] ); if ($slide['type'] == App_Slide_View::HTML_TYPE) { Qs_Smarty_File::setTemplate('Slide/slide.tpl'); $slide['content'] = Qs_Smarty_File::render($slide); } } unset($slide); } $item['slides'] = $list; foreach ($scriptOptions as &$value) { if (in_array($value, array('y', 'n'))) { $value = ('y' == $value); } } if ($scriptOptions['enablePaginator']) { $this->_doc->addStylesheet('css/thirdpart/yui-build/paginator.css'); $this->_doc->addScript('js/lib/yui-build/paginator.js'); } $scriptOptions['idItem'] = $item['idItem']; $scriptOptions['slides'] = $item['slides']; $scriptOptions['debug'] = Qs_Constant::get('DEBUG'); $scriptOptions['maxWidth'] = $item['maxWidth']; $scriptOptions['maxHeight'] = $item['maxHeight']; $this->_addItem($item); $this->_doc->addStylesheet('css/modules/slide.css') ->addScript('js/jquery.cj-swipe.js') ->addScript('js/app/slide.js') ->addInitFunction('App_Slide.prototype.init', array($scriptOptions)); return $this; } }