_getListItem(); if (empty($item['list'])) { return null; } $item['tpl'] = $this->getTemplate('side-block.tpl'); $item['blockId'] = Qs_SiteMap::classToId($this) . 'block'; $item['calendarUrl'] = EventView::getPageUrlByType(ConfigForm::TYPE_CALENDAR); $item['detailsUrl'] = EventView::getPageUrlByType(ConfigForm::TYPE_DETAILS); $item['stylesheet'][] = ['css/thirdpart/royalslider-default.css']; $item['stylesheet'][] = ['css/thirdpart/royalslider.css']; $item['script'][] = ['js/royalslider/jquery.royalslider.js']; $item['script'][] = ['js/royalslider/jquery.rs.auto-height.js']; $item['script'][] = ['js/royalslider/jquery.rs.autoplay.js']; $options = [ 'blockId' => $item['blockId'], ]; $item['script'][] = ['js/app/event/sideBlock.js']; $item['initObject'][] = ['app.event.SideBlock', [$options]]; return $item; } protected function _getListItem() { $item = parent::_getListItem(); if (empty($item['list'])) { return false; } $item['detailsUrl'] = EventView::getPageUrlByType(ConfigForm::TYPE_DETAILS) . '/{alias}'; if (self::TYPE_HOMEPAGE == $this->getConfig('type')) { $item['tpl'] = $this->getTemplate('homepage-slider.tpl'); $item['blockId'] = Qs_SiteMap::classToId($this) . 'block'; $item['stylesheet'][] = ['css/thirdpart/royalslider.css']; $item['stylesheet'][] = ['css/thirdpart/royalslider-default.css']; $item['stylesheet'][] = ['css/modules/wideSlide.css']; $item['script'][] = ['js/royalslider/jquery.royalslider.js']; $item['script'][] = ['js/royalslider/jquery.rs.bullets.js']; $item['script'][] = ['js/royalslider/jquery.rs.animated-blocks.js']; $item['script'][] = ['js/royalslider/jquery.rs.auto-height.js']; $item['script'][] = ['js/royalslider/jquery.rs.autoplay.js']; $options = [ 'blockId' => $item['blockId'], ]; $item['script'][] = ['js/app/event/homepage-slider.js']; $item['initObject'][] = ['app.event.HomepageSlider', [$options]]; } return $item; } public static function getPage($field = null, $default = null) { $page = Qs_SiteMap::findFirst( null, ['type' => Qs_SiteMap::classToType(get_called_class())], ['type' => self::TYPE_LIST] ); return (empty($page)) ? $default : Qs_Array::get($page, $field, $default); } }