* @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Frontpage View class * * @since 1.5 */ class ContentViewFeatured extends JViewLegacy { /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise an Error object. */ public function display($tpl = null) { // Parameters $app = JFactory::getApplication(); $doc = JFactory::getDocument(); $params = $app->getParams(); $feedEmail = $app->get('feed_email', 'none'); $siteEmail = $app->get('mailfrom'); $doc->link = JRoute::_('index.php?option=com_content&view=featured'); // Get some data from the model $app->input->set('limit', $app->get('feed_limit')); $categories = JCategories::getInstance('Content'); $rows = $this->get('Items'); foreach ($rows as $row) { // Strip html from feed item title $title = $this->escape($row->title); $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8'); // Compute the article slug $row->slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; // URL link to article $link = ContentHelperRoute::getArticleRoute($row->slug, $row->catid, $row->language); $description = ''; $obj = json_decode($row->images); $introImage = isset($obj->{'image_intro'}) ? $obj->{'image_intro'} : ''; if (isset($introImage) && ($introImage != '')) { $image = preg_match('/http/', $introImage) ? $introImage : JURI::root() . $introImage; $description = '
' . JText::_('COM_CONTENT_FEED_READMORE') . '
'; } // Load item description and add div $item->description = '