Renders an RSS feed

@return string
963598
public function rssAction()
    {
        $rssDocumentNode = $this->request->getInternalArgument('__documentNode');
        if ($rssDocumentNode === null) {
            return 'Error: The Blog Post Plugin cannot determine the current document node. Please make sure to include this plugin only by inserting it into a page / document.';
        }

        /** @var NodeInterface $postsNode */
        $postsNode = $this->request->getInternalArgument('__postsNode');

        $uriBuilder = new UriBuilder();
        $uriBuilder->setRequest($this->request->getMainRequest());
        $uriBuilder->setCreateAbsoluteUri(true);

        $feedTitle = $this->request->getInternalArgument('__feedTitle');
        $feedDescription = $this->request->getInternalArgument('__feedDescription');
        $includeContent = $this->request->getInternalArgument('__includeContent');

        if ($this->request->getInternalArgument('__feedUri')) {
            $feedUri = $this->request->getInternalArgument('__feedUri');
        } else {
            $uriBuilder->setFormat('xml');
            $feedUri = $uriBuilder->uriFor('show', ['node' => $rssDocumentNode], 'Frontend\Node', 'Neos.Neos');
        }

        $channel = new Channel();
        $channel->setTitle($feedTitle);
        $channel->setDescription($feedDescription);
        $channel->setFeedUri($feedUri);
        $channel->setWebsiteUri($this->request->getHttpRequest()->getBaseUri());
        $channel->setLanguage((string)$this->i18nService->getConfiguration()->getCurrentLocale());

        /* @var $postNode NodeInterface */
        foreach ($postsNode->getChildNodes('RobertLemke.Plugin.Blog:Post') as $postNode) {

            $uriBuilder->setFormat('html');
            $postUri = $uriBuilder->uriFor('show', ['node' => $postNode], 'Frontend\Node', 'Neos.Neos');

            $item = new Item();
            $item->setTitle($postNode->getProperty('title'));
            $item->setGuid($postNode->getIdentifier());
            $item->setPublicationDate($postNode->getProperty('datePublished'));
            $item->setItemLink((string)$postUri);
            $item->setCommentsLink((string)$postUri . '#comments');

            $author = $postNode->getProperty('author');
            if ($author instanceof NodeInterface) {
                $author = $author->getLabel();
            }
            $item->setCreator($author);

            if ($postNode->getProperty('categories')) {
                $categories = [];
                /** @var NodeInterface $categoryNode */
                foreach ($postNode->getProperty('categories') as $categoryNode) {
                    $categories[] = [
                        'category' => $categoryNode->getProperty('title'),
                        'domain' => $categoryNode->getProperty('domain')
                    ];
                }
                $item->setCategories($categories);
            }

            $description = $this->contentService->renderTeaser($postNode);
            $item->setDescription($description);

            if ($includeContent) {
                $item->setContent($this->contentService->renderContent($postNode));
            }

            $channel->addItem($item);
        }

        $headers = $this->response->getHeaders();
        $headers->setCacheControlDirective('s-max-age', 3600);
        $headers->set('Content-Type', 'application/rss+xml');

        $feed = new Feed();
        $feed->addChannel($channel);

        return $feed->render();
    }
247711
public function rss()
    {
        $posts = Content::post()->latestPublish()->limit(config('orchestra/story::per_page', 10))->get();

        return Response::view('orchestra/story::atom', ['posts' => $posts], 200, [
            'Content-Type' => 'application/rss+xml; charset=UTF-8',
        ]);
    }
312696
public function render()
    {
        if (empty($this->breadcrumbs)) {
            return '';
        }

        $cssClasses = implode(' ', $this->breadcrumbsCssClasses);

        return '<'. $this->listElement . ' itemscope itemtype="http://schema.org/BreadcrumbList"'
                .' class="' . $cssClasses .'">'
                . $this->renderCrumbs()
                . '</'. $this->listElement .'>';
    }
1177993
public function render()
    {
        $output[] = $this->open();

        if ($this->hasIcon()) {
            $output[] = $this->icon;
        }

        if ($this->hasTextContent()) {
            $output[] = PHP_EOL . implode('', $this->textContent->getArrayCopy()) . PHP_EOL;
        }

        if ($this->hasChildNodes()) {
            if ( ! $this->hasTextContent()) {
                $output[] = PHP_EOL;
            }

            foreach ($this->childNodes as $childNode) {
                $output[] = $childNode . PHP_EOL;
            }
        }

        $output[] = $this->close();

        return implode('', $output);
    }
1187906
public function render(): string
    {
        $this->tags();

        if ($this->isLink === true) {
            $this->html .= "<a href=\"{$this->link}\">";
        }

        $element_attributes = '';
        foreach ($this->element_attributes as $attribute => $value) {
            if ($attribute == "color") {
                $element_attributes .= "style=\"{$attribute}: $value\"";
            } else {
                $element_attributes .= "{$attribute}=\"{$value}\" ";
            }
        }

        foreach ($this->tags as $i => $tag) {
            if ($i === 0 && strlen($element_attributes) > 0) {
                $this->html .= "<{$tag} " . rtrim($element_attributes) . '>';
            } else {
                $this->html .= "<{$tag}>";
            }
        }

        $this->html .= $this->escape($this->insert);

        foreach (array_reverse($this->tags) as $tag) {
            $this->html .= "</{$tag}>";
        }

        if ($this->isLink === true) {
            $this->html .= '</a>';
        }

        return $this->html;
    }
1192764
public function getFeed(HTTPRequest $request)
    {
        $link = $this->Link('rss');
        $class = $this->decodeClassName($request->param('ID'));
        $id = $request->param('OtherID');

        // Support old pageid param
        if (!$id && !$class && ($id = $request->getVar('pageid'))) {
            $class = SiteTree::class;
        }

        $comments = Comment::get()->filter([
            'Moderated' => 1,
            'IsSpam' => 0,
        ]);

        // Check if class filter
        if ($class) {
            if (!is_subclass_of($class, DataObject::class) || !$class::has_extension(CommentsExtension::class)) {
                return $this->httpError(404);
            }
            $this->setParentClass($class);
            $comments = $comments->filter('ParentClass', $class);
            $link = Controller::join_links($link, $this->encodeClassName($class));

            // Check if id filter
            if ($id) {
                $comments = $comments->filter('ParentID', $id);
                $link = Controller::join_links($link, $id);
                $this->setOwnerRecord(DataObject::get_by_id($class, $id));
            }
        }

        $title = _t(__CLASS__ . '.RSSTITLE', "Comments RSS Feed");
        $comments = PaginatedList::create($comments, $request);
        $comments->setPageLength($this->getOption('comments_per_page'));

        return RSSFeed::create(
            $comments,
            $link,
            $title,
            $link,
            'Title',
            'EscapedComment',
            'AuthorName'
        );
    }
884904
public function generateFeed()
    {
        if ($this->version != Feed::ATOM && !array_key_exists('link', $this->channels))
            throw new InvalidOperationException('RSS1 & RSS2 feeds need a link element. Call the setLink method before this method.');

        return $this->makeHeader()
            . $this->makeChannels()
            . $this->makeItems()
            . $this->makeFooter();
    }
589546
public function render()
    {
        if (!$this->grid->showColumnSelector()) {
            return '';
        }
        $show = array_filter(explode(',', request(static::SELECT_COLUMN_NAME)));

        $columns = $this->getGridColumns();

        $this->setupScript();

        $lists = $columns->map(function ($val, $key) use ($show) {
            if (empty($show)) {
                $checked = 'checked';
            } else {
                $checked = in_array($key, $show) ? 'checked' : '';
            }

            return <<<HTML
<li class="checkbox icheck" style="margin: 0;">
    <label style="width: 100%;padding: 3px;">
        <input type="checkbox" class="column-select-item" value="{$key}" {$checked}/>&nbsp;&nbsp;&nbsp;{$val}
    </label>
</li>
HTML;
        })->implode("\r\n");

        $btns = [
            'all'    => __('admin.all'),
            'submit' => __('admin.submit'),
        ];

        return <<<EOT

<div class="dropdown pull-right column-selector" style="margin-right: 10px">
    <button type="button" class="btn btn-sm btn-instagram dropdown-toggle" data-toggle="dropdown">
        <i class="fa fa-table"></i>
        &nbsp;
        <span class="caret"></span>
    </button>
    <ul class="dropdown-menu" role="menu" style="padding: 10px;">
        <li>
            <ul style='padding: 0;'>
                {$lists}
            </ul>
        </li>
        <li class="divider"></li>
        <li class="text-right">
            <button class="btn btn-sm btn-defalut column-select-all">{$btns['all']}</button>&nbsp;&nbsp;
            <button class="btn btn-sm btn-primary column-select-submit">{$btns['submit']}</button>
        </li>
    </ul>
</div>
EOT;
    }
1208023
protected function renderCrumbs()
    {
        end($this->breadcrumbs);
        $lastKey = key($this->breadcrumbs);

        $output = '';

        $hrefSegments = array();

        $position = 1;

        foreach ($this->breadcrumbs as $key => $crumb) {
            $isLast = ($lastKey === $key);

            if ($crumb['hrefIsFullUrl']) {
                $hrefSegments = array();
            }

            if ($crumb['href']) {
                $hrefSegments[] = $crumb['href'];
            }

            $href = implode('/', $hrefSegments);

            if (!preg_match('#^https?://.*#', $href)) {
                $href = "/{$href}";
            }

            $output .= $this->renderCrumb($crumb['name'], $href, $isLast, $position);
            $position++;
        }

        return $output;
    }
753212
public function getRSS()
    {
        $this->checkValidity();

        if (!$this->valid) {
            $this->createRSS();
        }

        if ($this->sendHeader) {
            header('Content-type: application/rss+xml; charset=UTF-8');
        }

        readfile($this->rssFile);
    }
634451
protected function renderInstagram()
    {

        $int = 0;

        if (isset($this->feedData->meta->error_message) || !isset($this->feedData)) {
            $msg = 'No error message, sorry about that.';

            if (isset($this->feedData->meta->error_message)) {
                $msg = $this->feedData->meta->error_message;
            }

            $this->addError($msg);
            return;
        }

        foreach ($this->feedData as $item) {
            $int++;

            $this->addImage(
                $item['timestamp'],
                array(
                    'name' => $item['user_name'],
                    'picture' => ''
                ),
                $item['image_large'],
                isset($item['content']) ? $item['content'] : null,
                $item['network_source']
            );

            if ($int == $this->args['length']) {
                break;
            }
        }
    }
768045
public function render()
    {
        return implode(PHP_EOL, array_filter([
            $this->meta()->render(),
            $this->openGraph()->render(),
            $this->twitter()->render(),
        ]));
    }
795319
public function render(): string
    {
        $append = str_replace(trim($this->insert), '', $this->insert);

        return "[" . trim($this->escape($this->insert)) . "]({$this->attributes['link']})" . $append;
    }
408621
public function render()
    {
        $output = '';

        foreach ($this->items as $message) {
            $output .= $message->render();
        }

        return $output;
    }
554682
public function render()
    {
        $selfClosingTags = [
            'area',
            'base',
            'br',
            'col',
            'command',
            'embed',
            'hr',
            'img',
            'input',
            'keygen',
            'link',
            'meta',
            'param',
            'source',
            'track',
            'wbr',
        ];

        if (in_array($this->tagName, $selfClosingTags)) {
            $attr = $this->attributes;
            unset($attr[ 'realpath' ]);

            if ($this->hasAttributes()) {
                return '<' . $this->tagName . ' ' . trim($this->attributes->__toString()) . '>';
            }

            return '<' . $this->tagName . '>';
        } else {
            $output[] = $this->open();

            if ($this->hasTextContent()) {
                $output[] = PHP_EOL . implode('', $this->textContent->getArrayCopy()) . PHP_EOL;
            }

            if ($this->hasChildNodes()) {
                if ( ! $this->hasTextContent()) {
                    $output[] = PHP_EOL;
                }

                foreach ($this->childNodes as $childNode) {
                    $output[] = $childNode . PHP_EOL;
                }
            }
        }

        $output[] = $this->close();

        return implode('', $output);
    }
1199733
public function render()
    {

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('showexceptionpage') == '1') {
            return 'message/exception.tpl';
        }

        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        $oRss = oxNew(\OxidEsales\Eshop\Application\Model\RssFeed::class);
        if ($myConfig->getConfigParam('iTop5Mode') && $myConfig->getConfigParam('bl_rssTopShop')) {
            $this->addRssFeed($oRss->getTopInShopTitle(), $oRss->getTopInShopUrl(), 'topArticles');
        }
        if ($myConfig->getConfigParam('iNewestArticlesMode') && $myConfig->getConfigParam('bl_rssNewest')) {
            $this->addRssFeed($oRss->getNewestArticlesTitle(), $oRss->getNewestArticlesUrl(), 'newestArticles');
        }
        if ($myConfig->getConfigParam('bl_rssBargain')) {
            $this->addRssFeed($oRss->getBargainTitle(), $oRss->getBargainUrl(), 'bargainArticles');
        }

        parent::render();

        return $this->_sThisTemplate;
    }
627322
public function render(): string
    {
        $toastr = '<script type="text/javascript">'.$this->options().$this->notificationsAsString().'</script>';

        $this->session->forget(self::TOASTR_NOTIFICATIONS);

        return $toastr;
    }