<?php
/**
* @version 1.0.0
* @package RSEvents! 1.0.0
* @copyright (C) 2009 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/

defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.tooltip');
?>
<script language="javascript" type="text/javascript">
	function createFilter(filter)
	{
		document.getElementById('filter').value = filter;
		submitform();
	}
	
	function eraseFilter()
	{
		document.getElementById('filter').value = '';
		submitform();
	}
</script>
<form action="index.php?option=com_rsevents&task=listdesigns" method="post" name="adminForm">
	<table class="adminform">
		<tr>
			<td><?php echo JText::_('RSE_FILTER'); ?> <input type="text" name="rs_filter" id="rs_filter" class="text_area" value="<?php echo $this->filter; ?>"/> <input type="button" value="<?php echo JText::_('RSE_FILTER'); ?> " onclick="createFilter(document.getElementById('rs_filter').value);return false;" /> <input type="button" onclick="eraseFilter();" value="<?php echo JText::_('RSE_CLEAR_FILTER'); ?> " />
			</td>
		</tr>
	</table>
	<div id="editcell1">
		<table class="adminlist" width="100%">
			<thead>
			<tr>
				<th width="1%">
					<?php echo JText::_( 'RSE_#' ); ?>
				</th>
				<th width="1%">
					<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->data); ?>);"/>
				</th>
				<th width="50%">
					<?php
						$msg=JText::_('RSE_DESIGN_NAME');
						echo JHTML::_('grid.sort',$msg,'#__rsevents_designs.DesignName',$this->sortOrder,$this->sortColumn);
					?>
				</th>
				<th width="3%">
					<?php
						$msg=JText::_('RSE_DESIGN_DEFAULT');
						echo JHTML::_('grid.sort',$msg,'#__rsevents_designs.DesignDefault',$this->sortOrder,$this->sortColumn);
					?>
				</th>
				<th width="3%">
					<?php
						$msg=JText::_('RSE_PUBLISHED');
						echo JHTML::_('grid.sort',$msg,'#__rsevents_designs.published',$this->sortOrder,$this->sortColumn);
					?>
				</th>
				<th width="5%">
					<?php
						$msg=JText::_('RSE_ORDER');
						echo JHTML::_('grid.sort',$msg,'#__rsevents_designs.ordering',$this->sortOrder,$this->sortColumn);
						echo '&nbsp;&nbsp;';
						echo JHTML::_('grid.order',$this->data);
					?>
				</th>
			</tr>
			</thead>
	<?php
	$k = 0;
	for ($i=0,$n=count($this->data);$i<$n;$i++)
	{
		$row =& $this->data[$i];
		$checked=JHTML::_('grid.id',$i,$row->RecordId);
		$publish=JHTML::_('grid.published',$row,$i);
	?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $row->RecordId; ?></td>
				<td align="center"><?php echo $checked; ?></td>
				<td><?php $img_path = JURI::root().'components/com_rsevents/designs/'.$row->DesignName.'/'.$row->DesignName.'.png'; ?>
						<span class="editlinktip hasTip" title="<?php echo $row->DesignName;?>::
<img border=&quot;1&quot; src=&quot;<?php echo $img_path; ?>&quot; name=&quot;imagelib&quot; alt=&quot;<?php echo JText::_( 'RSE_DESIGN_NO_IMAGE' ); ?>&quot; width=&quot;150&quot; height=&quot;100&quot; />">
						<?php
						/* href="index.php?option=com_rsevents&task=editdesign&cid=<?php echo $row->RecordId;?>"*/
						?>
						<a style="cursor:pointer;">
						<?php echo $row->DesignName;?></a></span>
				</td>
				<td align="center"><?php

				if ($row->DesignDefault == 1) {
?>
								<img src="<?php echo JURI::root();?>administrator/components/com_rsevents/images/icons/default.png" alt="<?php echo JText::_( 'RSE_DESIGN_DEFAULT' ); ?>" />
								<?php

				} else {
?>
								&nbsp;
								<?php

				}
?></td>
				<td align="center"><?php echo $publish; ?></td>
				<td class="order" align="center">
					<span><?php echo $this->pagination->orderUpIcon( $i, true, 'orderup', 'Move Up', 'ordering'); ?></span>
					<span><?php echo $this->pagination->orderDownIcon( $i, $n, true, 'orderdown', 'Move Down', 'ordering' ); ?></span>
					<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align:center;" />
				</td>
			</tr>
	<?php
		$k=1-$k;
	}
	?>
		<tfoot>
			<tr>
				<td colspan="6"><?php echo $this->pagination->getListFooter(); ?></td>
			</tr>
		</tfoot>
		</table>
	</div>
	<?php echo JHTML::_( 'form.token' ); ?>
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="task" value="listdesigns" />
	<input type="hidden" name="option" value="com_rsevents" />
	<input type="hidden" name="view" value="designs" />
	<input type="hidden" name="controller" value="designs" />
	<input type="hidden" name="filter_order" value="<?php echo $this->sortColumn; ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->sortOrder; ?>" />
	<input type="hidden" name="rs_filter" value="" id="filter" />
	</form>