_prepareRow($row); } } protected function _prepareRow(&$row) { switch ($row['linkType']) { case 'cms': $page = App_Cms_Obj::getInstance()->getPageById($row['idPage']); $row['url'] = BASE_URL . '/' . $page['fullAlias']; break; case 'link': break; case 'file': $row['url'] = BASE_URL . '/userfiles/files/' . rawurlencode($row['file']); break; case 'none': $row['url'] = ''; break; default: break; } } public function getData($field = false) { $data = parent::getData($field); if (false === $field) { $this->_prepareRow($data); } return $data; } public function getFeedData() { $feed = array(); $feed['title'] = SITE_NAME; $feed['link'] = BASE_URL_LANGUAGE . '/' . CURRENT_PAGE; $feed['published'] = gmdate('D, d M Y H:i:s'); $feed['charset'] = 'utf-8'; $feed['language'] = 'en-us'; $maxItems = (int) $this->maxFeedItemCount; $list = $this->getList(array('order' => 'date DESC', 'limit' => $maxItems)); foreach ($list as $key => $item) { $feedItem = array( 'title' => $item['title'], 'link' => BASE_URL_LANGUAGE . '/' . CURRENT_PAGE_FINAL . '/' . $item['id'], 'lastUpdate' => strtotime($item['date']) ); if (empty($item['introduction'])) { $feedItem['description'] = $item['content']; } else { $feedItem['description'] = htmlspecialchars($item['introduction']) . ' ' . '[Read more]'; } $feed['entries'][] = $feedItem; } return $feed; } }