<?php
/**
* Joomla! 1.5 component injooosm
*
* @version $Id: list.php 2010-02-05 23:37:00$
* @author Christian Knorr
* @package injooosm
* @subpackage frontend
* @license GNU/GPL
* @filesource
*
*
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
echo $this->lh;
?>
<script language="javascript" type="text/javascript">
function tableOrdering( order, dir, task )
{
var form = document.adminForm;
form.filter_order.value = order;
form.filter_order_Dir.value = dir;
document.adminForm.submit( task );
}
</script>
<form action="<?php echo $this->action; ?>" method="post" name="adminForm">
<table width="100%">
<tr>
<td>
<?php echo JText::_( 'Filter' ); ?>:
<input type="text" name="search" id="search" value="<?php echo html_entity_decode($this->lists['search']);?>" class="text_area" onchange="document.adminForm.submit();" />
<button class="button" onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
<button class="button" onclick="document.getElementById('search').value='';this.form.getElementById('filter_state').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
<?php echo JText::_('Display Num') .' ' . $this->pagination->getLimitBox(); ?>
</td>
<td style="text-align:right">
<?php echo $this->pagination->getResultsCounter( ); ?>
</td>
</tr>
</table>
<table class="tracktable">
<thead>
<tr class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" align="center">
<th>#</th>
<th><?php echo JHTML::_('grid.sort', JText::_( 'OSM_TITLE' ), 'title', @$this->lists['order_Dir'], @$this->lists['order'], 'files' ); ?></th>
<th width="80px"><?php echo JHTML::_('grid.sort', JText::_( 'OSM_CAT' ), 'cat', @$this->lists['order_Dir'], @$this->lists['order'], 'files' ); ?></th>
<th width="80px"><?php echo JHTML::_('grid.sort', JText::_( 'OSM_USER' ), 'user', @$this->lists['order_Dir'], @$this->lists['order'], 'files' ); ?></th>
<th width="20px"><?php echo JHTML::_('grid.sort', JText::_( 'OSM_HITS' ), 'hits', @$this->lists['order_Dir'], @$this->lists['order'], 'files' ); ?></th>
<th width="80px"><?php echo JHTML::_('grid.sort', JText::_( 'OSM_DISTANCE' ), 'distance', @$this->lists['order_Dir'], @$this->lists['order'], 'files' ); ?></th>
</tr>
</thead>
<tfoot>
<tr class="sectiontablefooter">
<td colspan="6" align="center">
<?php echo $this->pagination->getPagesLinks( $this->rows ); ?>
<?php echo $this->pagination->getResultsCounter( ); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
for ($i=0, $n=count( $this->rows ); $i < $n; $i++)
{
$row = &$this->rows[$i];
$link = JRoute::_('index.php?option=com_injooosm&view=files&layout=file&id='.$row->id);
$profile = getProfileLink($row->uid, $row->user);
?>
<tr class="sectiontableentry<?php echo $k; ?>">
<td align="center"><?php echo $this->pagination->getRowOffset( $i ); ?></td>
<td><a href="<?php echo $link; ?>"><?php echo $row->title; ?></a></td>
<td><img src="<?php echo JURI::base(); ?>/images/injooosm/cats/<?php echo $row->image; ?>" alt="<?php echo $row->cat; ?>" title="<?php echo $row->cat; ?>" width="32px" /></td>
<td><?php echo $profile; ?></td>
<td><?php echo $row->hits; ?></td>
<td>
<?php
if($this->cfg->unit == "Miles") {
echo getMiles($row->distance) . " Miles";
} else {
echo $row->distance . " Km";
}
?>
</td>
</tr>
<?php
$k = 1 - $k;
}
?>
</tbody>
</table>
<input type="hidden" name="option" value="com_injooosm" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
</form>
<?php
echo $this->footer;