_restAlias) { if ((string) (int) $this->_restAlias != $this->_restAlias) { $this->_do404(); return $this; } $this->_getDataObj()->setFilter('year', $this->_restAlias); } elseif (($year = idate('Y'))) { $this->redirect($this->getYearFilterUrl($year)); } return parent::exec(); } protected function _addFilterItem() { if ($this->_hasFilter) { $form = $this->_getFilterForm(); if ($form->validate($form->getValidationValues())) { $filter = $form->getValues(); $this->_getDataObj()->addFilter($filter); $this->_getList()->addUrlVariables(array_keys($filter)); } $this->_filterFormHtml = $form->render(); } return $this; } protected function _getListItem() { $this->_getList()->setIsDisabledLimit(true); $item = parent::_getListItem(); if (($item['event'] = $this->_getDataObj()->getEventByYear($this->_restAlias))) { $this->_doc->setTitle($item['event']['title']); $this->_doc->setHeader($item['event']['title']); } $emptyFilter = empty(Qs_Request::getGet()); $item['filterFormHtml'] = $this->_filterFormHtml; if ($emptyFilter && empty($item['list'])) { unset($item['filterFormHtml']); } $item['showEventPostDescription'] = $emptyFilter; $item['years'] = $this->_getDataObj()->getYears(); $item['selectedYear'] = $this->_restAlias; $item['yearFilterUrl'] = $this->getYearFilterUrl(); return $item; } protected function getYearFilterUrl($year = null) { if (null === $year) { return $this->finalUrl() . '/{year}'; } return $this->finalUrl() . '/' . $year; } }