preparations for sef
[eventlist:eventlist.git] / views / eventlist / tmpl / default_table.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 <script language="javascript" type="text/javascript">
11
12         function tableOrdering( order, dir, view )
13         {
14                 var form = document.adminForm;
15
16                 form.filter_order.value         = order;
17                 form.filter_order_Dir.value     = dir;
18                 document.adminForm.submit( view );
19         }
20 </script>
21 <form action="<?php echo $this->request_url; ?>" method="post" name="adminForm">
22 <?php if ($this->params->get('filter') || $this->params->get('display')) : ?>
23 <table width="<?php echo $this->tablewidth; ?>" border="0" cellspacing="0" cellpadding="0" summary="eventlist">
24         <tr>
25                 <?php if ($this->params->get('filter')) : ?>
26                 <td align="left" width="100%" nowrap="nowrap">
27                                 <?php
28                                         echo JText::_('Filter').'&nbsp;';
29                                         echo $this->lists['filter_type'].'&nbsp;';
30                                 ?>
31
32                                 <input type="text" name="filter" id="filter" value="<?php echo $this->lists['filter'];?>" class="text_area" onchange="document.adminForm.submit();" />
33                                 <button onclick="document.adminForm.submit();"><?php echo JText::_( 'Go' ); ?></button>
34                                 <button onclick="document.getElementById('filter').value='';document.adminForm.submit();"><?php echo JText::_( 'Reset' ); ?></button>
35                 </td>
36                 <?php endif; ?>
37                 <?php if ($this->params->get('display')) : ?>
38                 <td align="right" width="100%" nowrap="nowrap">
39                         <?php
40                                 echo '&nbsp;&nbsp;&nbsp;'.JText::_('Display Num').'&nbsp;';
41                                 echo $this->pageNav->getLimitBox( $this->link );
42                         ?>
43                 </td>
44                 <?php endif; ?>
45         </tr>
46 </table>
47 <br />
48 <?php endif; ?>
49 <table width="<?php echo $this->elsettings->tablewidth; ?>" border="0" cellspacing="0" cellpadding="0" summary="eventlist">
50                         <tr>
51                                 <td width="<?php echo $this->elsettings->datewidth; ?>" class="sectiontableheader" align="left"><?php JCommonHTML::tableOrdering( $this->elsettings->datename, 'a.dates', $this->lists ); ?></td>
52                                 <?php
53                                 if ($this->elsettings->showtitle == 1) :
54                                 ?>
55                                 <td width="<?php echo $this->elsettings->titlewidth; ?>" class="sectiontableheader" align="left"><?php JCommonHTML::tableOrdering( $this->elsettings->titlename, 'a.title', $this->lists ); ?></td>
56                                 <?php
57                                 endif;
58                                 if ($this->elsettings->infobuttonwidth != '') :
59                                 ?>
60                                 <td width="<?php echo $this->elsettings->infobuttonwidth; ?>" class="sectiontableheader" align="left"><?php echo $this->elsettings->infobuttonname; ?></td>
61                                 <?php
62                                 endif;
63                                 if ($this->elsettings->showlocate == 1) :
64                                 ?>
65                                 <td width="<?php echo $this->elsettings->locationwidth; ?>" class="sectiontableheader" align="left"><?php JCommonHTML::tableOrdering( $this->elsettings->locationname, 'l.club', $this->lists ); ?></td>
66                                 <?php
67                                 endif;
68                                 if ($this->elsettings->showcity == 1) :
69                                 ?>
70                                 <td width="<?php echo $this->elsettings->citywidth; ?>" class="sectiontableheader" align="left"><?php JCommonHTML::tableOrdering( $this->elsettings->cityname, 'l.city', $this->lists ); ?></td>
71                                 <?php
72                                 endif;
73                                 if ($this->elsettings->showstate == 1) :
74                                 ?>
75                                 <td width="<?php echo $this->elsettings->statewidth; ?>" class="sectiontableheader" align="left"><?php JCommonHTML::tableOrdering( $this->elsettings->statename, 'l.state', $this->lists ); ?></td>
76                                 <?php
77                                 endif;
78                                 if ($this->elsettings->showcat == 1) :
79                                 ?>
80                                 <td width="<?php echo $this->elsettings->catfrowidth; ?>" class="sectiontableheader" align="left"><?php JCommonHTML::tableOrdering( $this->elsettings->catfroname, 'c.catname', $this->lists ); ?></td>
81                                 <?php
82                                 endif;
83                                 ?>
84                         </tr>
85         </table>
86
87         <table width="<?php echo $this->elsettings->tablewidth; ?>"  border="0" cellspacing="0" cellpadding="0" summary="eventlist">
88         <?php
89         if ($this->noevents == 1) :
90                 ?>
91                 <tr align="center"><td><?php echo JText::_( 'NO EVENTS' ); ?></td></tr>
92                 <?php
93         else :
94
95         $this->rows =& $this->getRows();
96
97         foreach ($this->rows as $row) :
98                 //alternating colors
99                 //$tabclass = array( 'sectiontableentry1', 'sectiontableentry2' );
100
101                 ?>
102                         <!--<tr class="<?php // echo $tabclass[$k]; ?>">-->
103                         <tr class="sectiontableentry<?php echo ($row->odd +1 ) . $this->params->get( 'pageclass_sfx' ); ?>" >
104                         <td width="<?php echo $this->elsettings->datewidth; ?>" align="left">
105                         <b><?php echo $row->displaydate; ?></b>
106                                 <?php
107                                 if ($this->elsettings->showtime == 1) :
108                                         echo $row->displaytime;
109                                 endif;
110                                 ?>
111                                 </td>
112                                 <?php
113                                 //Link to details
114                                 //$detaillink = JRoute::_( 'index.php?option=com_eventlist&view=details&did='. $row->id );
115                                 $detaillink = JRoute::_( 'index.php?option=com_eventlist&view=details&did='. $row->slug );
116                                 //title
117                                 if (($this->elsettings->showtitle == 1 ) && (($this->elsettings->showdetails == 1) || ($this->elsettings->showdetails == 3)) ) :
118                                 ?>
119                                 <td width="<?php echo $this->elsettings->titlewidth; ?>" align="left" valign="top"><a href="<?php echo $detaillink ; ?>"> <?php echo $row->title ? $row->title : '-'; ?></a></td>
120                                 <?php
121                                 endif;
122                                 if (( $this->elsettings->showtitle == 1 ) && (($this->elsettings->showdetails == 2) || ($this->elsettings->showdetails == 0)) ) :
123                                 ?>
124                                 <td width="<?php echo $this->elsettings->titlewidth; ?>" align="left" valign="top"><?php echo $row->title ? $row->title : '-'; ?></td>
125                                 <?php
126                                 endif;
127
128                                 //Infomation icon
129                                 if ($this->elsettings->infobuttonwidth != '') :
130                                         if (($this->elsettings->showdetails == 2) || ($this->elsettings->showdetails == 3)) :
131                                                 if (empty ($row->datdescription) && empty($row->locdescription)) :
132                                 ?>
133                                                         <td width="<?php echo $this->elsettings->infobuttonwidth; ?>" align="center" valign="top">
134                                                         <img src="<?php echo $live_site."/components/com_eventlist/assets/images/information_no.png"; ?>" width="16" height="16"  name="image" alt="<?php JText::_( 'SHOW DETAILS' ); ?>" />
135                                                         </td>
136                                 <?php
137                                                 else :
138                                 ?>
139                                                         <td width="<?php echo $this->elsettings->infobuttonwidth; ?>" align="center" valign="top">
140                                                         <a href="<?php echo $detaillink ; ?>"><img src="<?php echo $live_site."/components/com_eventlist/assets/images/information.png"; ?>" width="16" height="16"  name="image" alt="<?php JText::_( 'SHOW DETAILS' ); ?>" /></a>
141                                                         </td>
142                                 <?php
143                                                 endif;
144                                         endif;
145                                 endif;
146
147                                 if ($this->elsettings->showlocate == 1) :
148                                 ?>
149                                         <td width="<?php echo $this->elsettings->locationwidth; ?>" align="left" valign="top">
150                                 <?php
151                                         if ($this->elsettings->showlinkclub == 1 ) :
152                                                         echo $row->locid != 0 ? "<a href='".JRoute::_('index.php?option=com_eventlist&view=venueevents&locatid='.$row->locid)."'>".$row->club."</a>" : '-';
153                                                 else :
154                                                         echo $row->locid ? $row->club : '-';
155                                                 endif;
156                                 ?>
157                                         </td>
158                                 <?php
159                                 endif;
160
161                                 if ($this->elsettings->showcity == 1) :
162                                 ?>
163                                         <td width="<?php echo $this->elsettings->citywidth; ?>" align="left" valign="top"><?php echo $row->city ? $row->city : '-'; ?></td>
164                                 <?php
165                                 endif;
166
167                                 if ($this->elsettings->showstate == 1) :
168                                 ?>
169                                         <td width="<?php echo $this->elsettings->statewidth; ?>" align="left" valign="top"><?php echo $row->state ? $row->state : '-'; ?></td>
170                                 <?php
171                                 endif;
172
173                                 if ($this->elsettings->showcat == 1) :
174                                         if ($this->elsettings->catlinklist == 1) :
175                                         ?>
176                                                 <td width="<?php echo $this->elsettings->catfrowidth; ?>" align="left" valign="top">
177                                                         <a href="<?php echo JRoute::_('index.php?option=com_eventlist&view=categoryevents&categid='.$row->catid) ; ?>">
178                                                                 <?php echo $row->catname ? $row->catname : '-' ; ?>
179                                                         </a>
180                                                 </td>
181                                         <?php else : ?>
182                                                 <td width="<?php echo $this->elsettings->catfrowidth; ?>" align="left" valign="top">
183                                                         <?php echo $row->catname ? $row->catname : '-'; ?>
184                                                 </td>
185                                 <?php
186                                         endif;
187                                 endif;
188                                 ?>
189                         </tr>
190                 <?php
191                 endforeach;
192                 endif;
193                 ?>
194 </table>
195 <br />