| [ Index ] |
PHP Cross Reference of Joomla 1.5.26 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * version $Id: view.html.php 14401 2010-01-26 14:10:00Z louis $ 4 * @package Joomla 5 * @subpackage Newsfeeds 6 * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. 7 * @license GNU/GPL, see LICENSE.php 8 * 9 * Joomla! is free software. This version may have been modified pursuant 10 * to the GNU General Public License, and as distributed it includes or 11 * is derivative of works licensed under the GNU General Public License or 12 * other free or open source software licenses. 13 * See COPYRIGHT.php for copyright notices and details. 14 */ 15 16 // Check to ensure this file is included in Joomla! 17 defined('_JEXEC') or die( 'Restricted access' ); 18 19 jimport( 'joomla.application.component.view'); 20 21 /** 22 * HTML View class for the Newsfeeds component 23 * 24 * @static 25 * @package Joomla 26 * @subpackage Newsfeeds 27 * @since 1.0 28 */ 29 class NewsfeedsViewCategory extends JView 30 { 31 function display($tpl = null) 32 { 33 global $mainframe; 34 35 $pathway = & $mainframe->getPathway(); 36 $document = & JFactory::getDocument(); 37 38 // Get the parameters of the active menu item 39 $menus = &JSite::getMenu(); 40 $menu = $menus->getActive(); 41 $params = &$mainframe->getParams(); 42 43 $category = $this->get('category'); 44 $items = $this->get('data'); 45 $total = $this->get('total'); 46 $pagination = &$this->get('pagination'); 47 48 // Set page title 49 $menus = &JSite::getMenu(); 50 $menu = $menus->getActive(); 51 52 // because the application sets a default page title, we need to get it 53 // right from the menu item itself 54 if (is_object( $menu )) { 55 $menu_params = new JParameter( $menu->params ); 56 if (!$menu_params->get( 'page_title')) { 57 $params->set('page_title', $category->title); 58 } 59 } else { 60 $params->set('page_title', $category->title); 61 } 62 63 $document->setTitle( $params->get( 'page_title' ) ); 64 65 //set breadcrumbs 66 $pathway->addItem($category->title, ''); 67 68 // Prepare category description 69 $category->description = JHTML::_('content.prepare', $category->description); 70 71 $k = 0; 72 for($i = 0; $i < count($items); $i++) 73 { 74 $item =& $items[$i]; 75 76 $item->link = JRoute::_('index.php?view=newsfeed&catid='.$category->slug.'&id='. $item->slug ); 77 78 $item->odd = $k; 79 $item->count = $i; 80 $k = 1 - $k; 81 } 82 83 // Define image tag attributes 84 if (!empty ($category->image)) 85 { 86 $attribs['align'] = $category->image_position; 87 $attribs['hspace'] = 6; 88 89 // Use the static HTML library to build the image tag 90 $image = JHTML::_('image', 'images/stories/'.$category->image, JText::_('NEWS_FEEDS'), $attribs); 91 } 92 93 $this->assignRef('image', $image); 94 $this->assignRef('params', $params); 95 $this->assignRef('items', $items); 96 $this->assignRef('category', $category); 97 $this->assignRef('pagination', $pagination); 98 99 parent::display($tpl); 100 } 101 } 102 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Mar 28 15:54:07 2012 | Cross-referenced by PHPXref 0.7.1 |