<commit_before><?php
namespace Chamilo\Core\Repository\ContentObject\RssFeed\Integration\Chamilo\Core\Home\Type;

use Chamilo\Core\Repository\ContentObject\RssFeed\Implementation\RenditionImplementation;
use Chamilo\Libraries\File\Path;
use Chamilo\Libraries\Format\Theme;
use Chamilo\Libraries\Format\Utilities\ResourceManager;
use Chamilo\Libraries\Platform\Translation;
use Chamilo\Core\Home\Architecture\ConfigurableInterface;

class Feeder extends \Chamilo\Core\Repository\Integration\Chamilo\Core\Home\Block implements ConfigurableInterface
{

    public function __construct($renderer, $block)
    {
        parent :: __construct($renderer, $block, Translation :: get('Feeder'));
    }

    public function isVisible()
    {
        return true; // i.e.display on homepage when anonymous
    }

    /**
     * Returns the html to display when the block is configured.
     *
     * @return string
     */
    public function displayContent()
    {
        $content_object = $this->getObject();

        $html = array();

        $html[] = '<script type="text/javascript">';
        $html[] = '(function(){';
        $html[] = '     var rssFeedRendererApp = angular.module(\'rssFeedRendererApp\', []);';
        $html[] = '     rssFeedRendererApp.value(\'rssFeedUrl\', \'' . $content_object->get_url() . '\');';<commit_msg>Changing the title of the feeder block to the title of the feed if a feed has been selected<commit_after><?php
namespace Chamilo\Core\Repository\ContentObject\RssFeed\Integration\Chamilo\Core\Home\Type;

use Chamilo\Core\Repository\ContentObject\RssFeed\Implementation\RenditionImplementation;
use Chamilo\Libraries\File\Path;
use Chamilo\Libraries\Format\Theme;
use Chamilo\Libraries\Format\Utilities\ResourceManager;
use Chamilo\Libraries\Platform\Translation;
use Chamilo\Core\Home\Architecture\ConfigurableInterface;

class Feeder extends \Chamilo\Core\Repository\Integration\Chamilo\Core\Home\Block implements ConfigurableInterface
{

    public function __construct($renderer, $block)
    {
        parent :: __construct($renderer, $block, Translation :: get('Feeder'));
    }

    public function isVisible()
    {
        return true; // i.e.display on homepage when anonymous
    }

    /**
     * Displays the title of the feed or the generic title if no object selected
     *
     * @return string
     */
    public function getTitle()
    {
        $content_object = $this->getObject();

        if($content_object)
        {
            return $content_object->get_title();
        }

        return parent::getTitle();
    }

    /**
     * Returns the html to display when the block is configured.
     *
     * @return string
     */
    public function displayContent()
    {
        $content_object = $this->getObject();

        $html = array();

        $html[] = '<script type="text/javascript">';
        $html[] = '(function(){';
        $html[] = '     var rssFeedRendererApp = angular.module(\'rssFeedRendererApp\', []);';
        $html[] = '     rssFeedRendererApp.value(\'rssFeedUrl\', \'' . $content_object->get_url() . '\');';
{'fraction_non_alphanumeric': 0.12994167206740118, 'fraction_numerical': 0.0, 'mean_word_length': 3.1942934782608696, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6652707', 'n_tokens_mistral': 908, 'n_tokens_neox': 896, 'n_words': 186}