10 defined(
'_JEXEC') or die;
30 public function display($tpl = null)
35 $extension = $app->input->getString(
'option');
36 $document->link =
JRoute::_(JHelperRoute::getCategoryRoute($app->input->getInt(
'id'), $language = 0, $extension));
38 $app->input->set(
'limit', $app->get(
'feed_limit'));
39 $siteEmail = $app->get(
'mailfrom');
40 $fromName = $app->get(
'fromname');
41 $feedEmail = $app->get(
'feed_email',
'author');
42 $document->editor = $fromName;
44 if ($feedEmail !=
'none')
46 $document->editorEmail = $siteEmail;
50 $items = $this->
get(
'Items');
51 $category = $this->
get(
'Category');
53 foreach ($items as $item)
55 $this->reconcileNames($item);
58 $title = $this->escape($item->title);
59 $title = html_entity_decode($title, ENT_COMPAT,
'UTF-8');
62 $router =
new JHelperRoute;
63 $link =
JRoute::_($router->getRoute($item->id, $item->catid));
66 $description = $item->description;
67 $author = $item->created_by_alias ? $item->created_by_alias : $item->author;
68 $date = isset($item->date) ? date(
'r', strtotime($item->date)) :
'';
72 $feeditem->title = $title;
73 $feeditem->link = $link;
74 $feeditem->description = $description;
75 $feeditem->date = $date;
76 $feeditem->category = $category->title;
77 $feeditem->author = $author;
80 if ($feedEmail ==
'site')
82 $feeditem->authorEmail = $siteEmail;
84 elseif ($feedEmail ===
'author')
86 $feeditem->authorEmail = $item->author_email;
90 $document->addItem($feeditem);
104 protected function reconcileNames($item)
106 if (!property_exists($item,
'title') && property_exists($item,
'name'))
108 $item->title = $item->name;