|
Server : Apache System : Linux vps.urbanovitalino.adv.br 3.10.0-1062.12.1.el7.x86_64 #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64 User : urbanovitalinoad ( 1001) PHP Version : 7.3.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/urbanovitalinoad/www/controlpatri/modules/mod_feed/ |
Upload File : |
<?php
/**
* @package Joomla.Site
* @subpackage mod_feed
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Helper for mod_feed
*
* @since 1.5
*/
class ModFeedHelper
{
/**
* Retrieve feed information
*
* @param \Joomla\Registry\Registry $params module parameters
*
* @return JFeedReader|string
*/
public static function getFeed($params)
{
// Module params
$rssurl = $params->get('rssurl', '');
// Get RSS parsed object
try
{
$feed = new JFeedFactory;
$rssDoc = $feed->getFeed($rssurl);
}
catch (Exception $e)
{
return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED');
}
if (empty($rssDoc))
{
return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED');
}
if ($rssDoc)
{
return $rssDoc;
}
}
}