bugfixes
[eventlist:eventlist.git] / views / venuesview / view.html.php
1 <?php
2 /**
3  * @version 0.9 $Id$
4  * @package Joomla
5  * @subpackage EventList
6  * @copyright (C) 2005 - 2007 Christoph Lukes
7  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
8  */
9
10 // no direct access
11 defined( '_JEXEC' ) or die( 'Restricted access' );
12
13 jimport( 'joomla.application.component.view');
14
15 /**
16  * HTML View class for the Venuesview View
17  *
18  * @package Joomla
19  * @subpackage EventList
20  * @since 0.9
21  */
22 class EventListViewVenuesview extends JView
23 {
24         /**
25          * Creates the Venuesview
26          *
27          * @since 0.9
28          */
29         function display( $tpl = null )
30         {
31                 global $mainframe, $option;
32
33                 $document       = & JFactory::getDocument();
34                 $elsettings = ELHelper::config();
35
36                 //get menu information
37                 $menu           =& JMenu::getInstance();
38                 $item           = $menu->getActive();
39                 $params         =& $menu->getParams($item->id);
40
41                 //cleanup events
42                 ELHelper::cleanevents( $elsettings->lastupdate );
43
44                 //add css file
45                 $document->addStyleSheet('components/com_eventlist/assets/css/eventlist.css');
46                 $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}</style><![endif]-->');
47
48                 // Request variables
49                 $limitstart             = JRequest::getVar('limitstart', 0, '', 'int');
50                 $limit                  = JRequest::getVar('limit', $params->get('display_num'), '', 'int');
51                 $live_site              = $mainframe->getCfg('live_site');
52                 $pop                    = JRequest::getVar('pop', 0, '', 'int');
53
54                 $rows           = & $this->get('Data');
55                 $total          = & $this->get('Total');
56
57                 //print_r($rows);
58                 //$mainframe->close();
59
60
61                 //Add needed scripts if the lightbox effect is enabled
62                 if ($elsettings->lightbox == 1) {
63                         $document->addScript('components/com_eventlist/assets/js/slimbox.js');
64                         $document->addStyleSheet('components/com_eventlist/assets/css/slimbox.css', 'text/css', 'screen');
65                 }
66
67                 //add alternate feed link
68                 $link    = 'index.php?option=com_eventlist&view=venuesview&format=feed';
69                 $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
70                 $document->addHeadLink($link.'&type=rss', 'alternate', 'rel', $attribs);
71                 $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
72                 $document->addHeadLink($link.'&type=atom', 'alternate', 'rel', $attribs);
73
74                 //set Page title
75                 $document->setTitle( $item->name );
76                 $document->setMetadata('keywords', $item->name );
77         //      $document->setDescription( strip_tags($l_row->locdescription) );
78
79                 //pathway
80                 $pathway        = & $mainframe->getPathWay();
81                 $pathway->setItemName(1, $item->name);
82
83
84                 //Printfunction
85                 $params->def( 'print', !$mainframe->getCfg( 'hidePrint' ) );
86                 $params->def( 'icons', $mainframe->getCfg( 'icons' ) );
87
88                 if ($params->def('page_title', 1)) {
89                         $params->def('header', $item->name);
90                 }
91
92                 if ( $pop ) {
93                         $params->set( 'popup', 1 );
94                 }
95
96                 $print_link = $live_site. '/index2.php?option=com_eventlist&amp;Itemid='. $item->id .'&amp;view=venuesview&amp;pop=1';
97
98                 //Check if the user has access to the form
99                 $maintainer = ELUser::ismaintainer();
100                 $genaccess      = ELUser::validate_user( $elsettings->evdelrec, $elsettings->delivereventsyes );
101
102                 if ($maintainer || $genaccess ) $dellink = 1;;
103
104                 // Create the pagination object
105                 jimport('joomla.html.pagination');
106                 $pageNav = new JPagination($total, $limitstart, $limit);
107
108                 $link = 'index.php?option=com_eventlist&view=venuesview';
109                 $page = $total - $limit;
110
111                 $this->assignRef('rows' ,                                       $rows);
112                 $this->assignRef('print_link' ,                         $print_link);
113                 $this->assignRef('params' ,                             $params);
114                 $this->assignRef('dellink' ,                            $dellink);
115                 $this->assignRef('live_site' ,                          $live_site);
116                 $this->assignRef('link' ,                                       $link);
117                 $this->assignRef('page' ,                                       $page);
118                 $this->assignRef('pageNav' ,                            $pageNav);
119                 $this->assignRef('limit' ,                                      $limit);
120                 $this->assignRef('total' ,                                      $total);
121                 $this->assignRef('item' ,                                       $item);
122                 $this->assignRef('elsettings' ,                         $elsettings);
123
124                 parent::display($tpl);
125         }
126 }
127 ?>