/** * Возвращает RSS комментариев. * @route GET//comments.rss */ public static function on_get_rss(Context $ctx) { if (!class_exists('RSSFeed')) { throw new PageNotFoundException(t('Модуль rss не установлен.')); } $filter = array('class' => 'comment', 'deleted' => 0, 'published' => 1, '#limit' => 20, '#sort' => '-id'); $title = t('Комментарии на %host', array('%host' => MCMS_HOST_NAME)); $feed = new RSSFeed($filter); return $feed->render($ctx, array('title' => $title, 'description' => $title . '.', 'xsl' => os::path('lib', 'modules', 'comment', 'rss.xsl'))); }
public static function on_get_custom(Context $ctx) { $filter = array(); if (!($filter['class'] = $ctx->get('type'))) { $filter['class'] = $ctx->db->getResultsV("name", "SELECT name FROM node WHERE class = 'type' AND deleted = 0 AND published = 1"); } if ($tmp = $ctx->get('tags')) { $filter['tags'] = explode('+', $tmp); } if ($tmp = $ctx->get('author')) { $filter['uid'] = $tmp; } $feed = new RSSFeed($filter); return $feed->render($ctx); }