- md5
- db3ff93518a29590576feda9fb0cae6f
- sha1
- 791b7a4ef039e8889c1355ff4417a6b624e593b9
- sha256
- 1a9eb7da45720d0dc560e86553e5e3b64532c57dc2477c83a5e860bfd8820a86
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_feed
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\Language\Text;
// Check if feed URL has been set
if (empty ($rssurl))
{
echo '<div>' . Text::_('MOD_FEED_ERR_NO_URL') . '</div>';
return;
}
if (!empty($feed) && is_string($feed))
{
echo $feed;
}
else
{
$lang = Factory::getLanguage();
$myrtl = $params->get('rssrtl');
$direction = ' ';
if ($lang->isRtl() && $myrtl == 0)
{
$direction = ' redirect-rtl';
}
// Feed description
elseif ($lang->isRtl() && $myrtl == 1)
{
$direction = ' redirect-ltr';
}
elseif ($lang->isRtl() && $myrtl == 2)
{
$direction = ' redirect-rtl';
}
elseif ($myrtl == 0)
{
$direction = ' redirect-ltr';
}
elseif ($myrtl == 1)
{
$direction = ' redirect-ltr';
}
elseif ($myrtl == 2)
{
$direction = ' redirect-rtl';
}
if ($feed != false) :
// Image handling
$iUrl = $feed->image ?? null;
$iTitle = $feed->imagetitle ?? null;
?>
<div style="direction: <?php echo $rssrtl ? 'rtl' :'ltr'; ?>; text-align: <?php echo $rssrtl ? 'right' :'left'; ?> !important" class="feed<?php echo $moduleclass_sfx; ?>">
<?php
// Feed description
if (!is_null($feed->title) && $params->get('rsstitle', 1)) : ?>
<h2 class="<?php echo $direction; ?>">
<a href="<?php echo str_replace('&', '&', $rssurl); ?>" target="_blank">
<?php echo $feed->title; ?></a>
</h2>
<?php endif; ?>
<?php // Feed description ?>
<?php if ($params->get('rssdesc', 1)) : ?>
<?php echo $feed->description; ?>
<?php endif; ?>
<?php // Feed image ?>
<?php if ($params->get('rssimage', 1) && $iUrl) : ?>
<img src="<?php echo $iUrl; ?>" alt="<?php echo @$iTitle; ?>">
<?php endif; ?>
<?php // Show items ?>
<?php if (!empty($feed)) : ?>
<ul class="newsfeed<?php echo $params->get('moduleclass_sfx'); ?> list-group">
<?php for ($i = 0; $i < $params->get('rssitems', 5); $i++) :
if (!$feed->offsetExists($i)) :
break;
endif;
$uri = (!empty($feed[$i]->uri) || !is_null($feed[$i]->uri)) ? $feed[$i]->uri : $feed[$i]->guid;
$uri = substr($uri, 0, 4) != 'http' ? $params->get('rsslink') : $uri;
$text = !empty($feed[$i]->content) || !is_null($feed[$i]->content) ? $feed[$i]->content : $feed[$i]->description;
?>
<li class="list-group-item mb-2">
<?php if (!empty($uri)) : ?>
<h5 class="feed-link">
<a href="<?php echo $uri; ?>" target="_blank">
<?php echo $feed[$i]->title; ?></a></h5>
<?php else : ?>
<h5 class="feed-link"><?php echo $feed[$i]->title; ?></h5>
<?php endif; ?>
<?php if ($params->get('rssitemdesc') && !empty($text)) : ?>
<div class="feed-item-description">
<?php
// Strip the images.
$text = OutputFilter::stripImages($text);
// Strip HTML
$text = strip_tags($text);
echo str_replace(''', "'", $text);
?>
</div>
<?php endif; ?>
</li>
<?php endfor; ?>
</ul>
<?php endif; ?>
</div>
<?php endif;
}
The same content is in 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.