Skip to content

Commit

Permalink
Namespace mod feed
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Jul 26, 2017
1 parent c21ddbf commit 69252fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Expand Up @@ -6,6 +6,7 @@
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Module\Feed\Administrator\Helper;

defined('_JEXEC') or die;

Expand All @@ -14,7 +15,7 @@
*
* @since 1.5
*/
class ModFeedHelper
class FeedHelper
{
/**
* Method to load a feed.
Expand All @@ -34,17 +35,17 @@ public static function getFeed($params)
try
{
jimport('joomla.feed.factory');
$feed = new JFeedFactory;
$feed = new \JFeedFactory;
$rssDoc = $feed->getFeed($rssurl);
}
catch (Exception $e)
catch (\Exception $e)
{
return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED');
return \JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED');
}

if (empty($rssDoc))
{
return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED');
return \JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED');
}

return $rssDoc;
Expand Down
7 changes: 2 additions & 5 deletions administrator/modules/mod_feed/mod_feed.php
Expand Up @@ -9,12 +9,9 @@

defined('_JEXEC') or die;

// Include the feed functions only once
JLoader::register('ModFeedHelper', __DIR__ . '/helper.php');

$feed = ModFeedHelper::getFeed($params);
$feed = \Joomla\Module\Feed\Administrator\Helper\FeedHelper::getFeed($params);
$rssurl = $params->get('rssurl', '');
$rssrtl = $params->get('rssrtl', 0);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_feed', $params->get('layout', 'default'));
require \Joomla\CMS\Helper\ModuleHelper::getLayoutPath('mod_feed', $params->get('layout', 'default'));

0 comments on commit 69252fd

Please sign in to comment.