| [ Indice ] |
Riferimento incrociato di Joomla! 1.5.14 - VM 1.1.4Servizio fornito da VMItalia |
[Vedi sommario] [Stampa] [Vedi testo]
1 <?php 2 /** 3 * @version $Id: view.html.php 11398 2009-01-05 20:03:27Z kdevine $ 4 * @package Joomla 5 * @subpackage Content 6 * @copyright Copyright (C) 2005 - 2008 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 require_once (JPATH_COMPONENT.DS.'view.php'); 19 20 /** 21 * HTML View class for the Content component 22 * 23 * @package Joomla 24 * @subpackage Content 25 * @since 1.5 26 */ 27 class ContentViewArchive extends ContentView 28 { 29 function display($tpl = null) 30 { 31 global $mainframe, $option; 32 33 if (empty( $layout )) 34 { 35 // degrade to default 36 $layout = 'list'; 37 } 38 39 // Initialize some variables 40 $user =& JFactory::getUser(); 41 $pathway =& $mainframe->getPathway(); 42 $document =& JFactory::getDocument(); 43 44 // Get the page/component configuration 45 $params = &$mainframe->getParams('com_content'); 46 47 // Request variables 48 $task = JRequest::getCmd('task'); 49 $limit = $mainframe->getUserStateFromRequest('com_content.'.$this->getLayout().'.limit', 'limit', $params->get('display_num', 20), 'int'); 50 $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); 51 $month = JRequest::getInt( 'month' ); 52 $year = JRequest::getInt( 'year' ); 53 $filter = JRequest::getString( 'filter' ); 54 JRequest::setVar('limit', (int) $limit); 55 56 // Get some data from the model 57 $state = & $this->get( 'state' ); 58 $items = & $this->get( 'data' ); 59 $total = & $this->get( 'total' ); 60 61 // Add item to pathway 62 $pathway->addItem(JText::_('Archive'), ''); 63 64 $params->def('filter', 1); 65 $params->def('filter_type', 'title'); 66 67 jimport('joomla.html.pagination'); 68 $pagination = new JPagination($total, $limitstart, $limit); 69 70 $menus = &JSite::getMenu(); 71 $menu = $menus->getActive(); 72 73 // because the application sets a default page title, we need to get it 74 // right from the menu item itself 75 if (is_object( $menu )) { 76 $menu_params = new JParameter( $menu->params ); 77 if (!$menu_params->get( 'page_title')) { 78 $params->set('page_title', JText::_( 'Archives' )); 79 } 80 } else { 81 $params->set('page_title', JText::_( 'Archives' )); 82 } 83 $document->setTitle( $params->get( 'page_title' ) ); 84 85 $form = new stdClass(); 86 // Month Field 87 $months = array( 88 JHTML::_('select.option', null, JText::_( 'Month' ) ), 89 JHTML::_('select.option', '01', JText::_( 'JANUARY_SHORT' ) ), 90 JHTML::_('select.option', '02', JText::_( 'FEBRUARY_SHORT' ) ), 91 JHTML::_('select.option', '03', JText::_( 'MARCH_SHORT' ) ), 92 JHTML::_('select.option', '04', JText::_( 'APRIL_SHORT' ) ), 93 JHTML::_('select.option', '05', JText::_( 'MAY_SHORT' ) ), 94 JHTML::_('select.option', '06', JText::_( 'JUNE_SHORT' ) ), 95 JHTML::_('select.option', '07', JText::_( 'JULY_SHORT' ) ), 96 JHTML::_('select.option', '08', JText::_( 'AUGUST_SHORT' ) ), 97 JHTML::_('select.option', '09', JText::_( 'SEPTEMBER_SHORT' ) ), 98 JHTML::_('select.option', '10', JText::_( 'OCTOBER_SHORT' ) ), 99 JHTML::_('select.option', '11', JText::_( 'NOVEMBER_SHORT' ) ), 100 JHTML::_('select.option', '12', JText::_( 'DECEMBER_SHORT' ) ) 101 ); 102 $form->monthField = JHTML::_('select.genericlist', $months, 'month', 'size="1" class="inputbox"', 'value', 'text', $month ); 103 104 // Year Field 105 $years = array(); 106 $years[] = JHTML::_('select.option', null, JText::_( 'Year' ) ); 107 for ($i=2000; $i <= 2010; $i++) { 108 $years[] = JHTML::_('select.option', $i, $i ); 109 } 110 $form->yearField = JHTML::_('select.genericlist', $years, 'year', 'size="1" class="inputbox"', 'value', 'text', $year ); 111 $form->limitField = $pagination->getLimitBox(); 112 113 $this->assign('filter' , $filter); 114 $this->assign('year' , $year); 115 $this->assign('month' , $month); 116 117 $this->assignRef('form', $form); 118 $this->assignRef('items', $items); 119 $this->assignRef('params', $params); 120 $this->assignRef('user', $user); 121 $this->assignRef('pagination', $pagination); 122 123 parent::display($tpl); 124 } 125 } 126 ?>
titolo
Descrizione
Corpo
titolo
Descrizione
Corpo
titolo
Descrizione
Corpo
titolo
Corpo
| Generato il: Mon Oct 19 20:29:27 2009 | Generato con PHPXref 0.7 |