[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/components/com_content/views/category/ -> view.feed.php (source)

   1  <?php
   2  /**
   3   * @version        $Id: view.feed.php 14401 2010-01-26 14:10:00Z louis $
   4   * @package        Joomla
   5   * @subpackage    Content
   6   * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   7   * @license        GNU/GPL, see LICENSE.php
   8   * Joomla! is free software. This version may have been modified pursuant to the
   9   * GNU General Public License, and as distributed it includes or is derivative
  10   * of works licensed under the GNU General Public License or other free or open
  11   * source software licenses. See COPYRIGHT.php for copyright notices and
  12   * details.
  13   */
  14  
  15  // Check to ensure this file is included in Joomla!
  16  defined('_JEXEC') or die( 'Restricted access' );
  17  
  18  jimport( 'joomla.application.component.view');
  19  
  20  /**
  21   * HTML View class for the Content component
  22   *
  23   * @package        Joomla
  24   * @subpackage    Content
  25   * @since 1.5
  26   */
  27  class ContentViewCategory extends JView
  28  {
  29  	function display()
  30      {
  31          global $mainframe;
  32  
  33          $doc     =& JFactory::getDocument();
  34          $params =& $mainframe->getParams();
  35          $feedEmail = (@$mainframe->getCfg('feed_email')) ? $mainframe->getCfg('feed_email') : 'author';
  36          $siteEmail = $mainframe->getCfg('mailfrom');
  37  
  38          // Get some data from the model
  39          JRequest::setVar('limit', $mainframe->getCfg('feed_limit'));
  40          $category    = & $this->get( 'Category' );
  41          $rows         = & $this->get( 'Data' );
  42  
  43          $doc->link = JRoute::_(ContentHelperRoute::getCategoryRoute($category->id, $category->sectionid));
  44  
  45          foreach ( $rows as $row )
  46          {
  47              // strip html from feed item title
  48              $title = $this->escape( $row->title );
  49              $title = html_entity_decode( $title );
  50  
  51              // url link to article
  52              // & used instead of &amp; as this is converted by feed creator
  53              $link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
  54  
  55              // strip html from feed item description text
  56              $description    = ($params->get('feed_summary', 0) ? $row->introtext.$row->fulltext : $row->introtext);
  57              $author            = $row->created_by_alias ? $row->created_by_alias : $row->author;
  58  
  59              // load individual item creator class
  60              $item = new JFeedItem();
  61              $item->title         = $title;
  62              $item->link         = $link;
  63              $item->description     = $description;
  64              $item->date            = $row->created;
  65              $item->category       = $row->category;
  66              $item->author        = $author;
  67              if ($feedEmail == 'site') {
  68                  $item->authorEmail = $siteEmail;
  69              }
  70              else {
  71                  $item->authorEmail = $row->author_email;
  72              }
  73  
  74              // loads item info into rss array
  75              $doc->addItem( $item );
  76          }
  77      }
  78  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1