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

defined('_JEXEC') or die('Restricted access');
?>
<form action="index.php?option=com_rsfiles&task=files" method="post" id="adminForm" name="adminForm" enctype="multipart/form-data">
	<table align="center" class="jdUpload">
		<tr>
			<td>
				<input id="upload" name="upload" type="file" size="57" /><button type="button" onclick="submitbutton('upload');"><?php echo JText::_('RSFL_UPLOAD'); ?></button>
			</td>
		</tr>
		<tr>
			<td>
				<input size="70" type="text" name="newfolder" /> <button onclick="submitbutton('newdir');"><?php echo JText::_('RSFL_NEW_FOLDER_BUTTON'); ?></button>
			</td>
		</tr>
	</table>
	<br/>
	<div id="editcell1">
		<table class="adminlist">
			<thead>
			<tr>
				<th width="20"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo $this->count; ?>);"/></th>
				<th><?php echo JText::_('RSFL_FILES'); ?></th>
				<th><?php echo JText::_('RSFL_PUBLISHED'); ?></th>
				<th width="20"><?php echo JText::_('RSFL_REPORTS'); ?></th>
			</tr>
			</thead>
			<?php if($this->current != $this->rsfilesConfig['download_folder']) { ?>
			<tr>
				<td>&nbsp;</td>
				<td><a href="<?php echo JRoute::_($this->link.'&folder='.$this->previous); ?>"><img src="<?php echo JURI::root().'administrator/components/com_rsfiles/assets/images/imgs/folder.gif'; ?>" />...</a></td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
			</tr>
			<?php } ?>
	<?php
	$i = 0;
	foreach ($this->folders as $folder)
	{
	?>
		<tr>
			<td><?php echo JHTML::_('grid.id', $i, $folder->fullpath); ?></td>
			<td><img src="<?php echo JURI::root().'administrator/components/com_rsfiles/assets/images/imgs/folder.gif'; ?>" /> <a href="<?php echo JRoute::_($this->link.'&folder='.$folder->fullpath); ?>"><?php echo $folder->name; ?></a> &nbsp;&nbsp;&nbsp; <a href="index.php?option=com_rsfiles&task=editfile&cid=<?php echo $folder->fullpath; ?>"><?php echo JText::_('RSFL_EDIT_FILE'); ?></a></td>
			<td width="20" align="center"><?php echo JHTML::_('grid.published',$folder,$i); ?></td>
			<td>&nbsp;</td>
		</tr>
	<?php
		$i++;
	}
		$j = $i;
		foreach ($this->files as $file)
		{
		?>
			<tr>
				<td><?php echo JHTML::_('grid.id', $j, $file->fullpath); ?></td>
				<td><img src="<?php echo JURI::root().'administrator/components/com_rsfiles/assets/images/imgs/file.png'; ?>" /> <a href="<?php echo JRoute::_('index.php?option=com_rsfiles&task=editfile&cid='.$file->fullpath); ?>"><?php echo $file->name; ?></a></td>
				<td width="20" align="center"><?php echo JHTML::_('grid.published',$file,$j); ?></td>
				<td align="center"><a class="editlinktip hasTip" title="<?php echo JText::_('RSFL_REPORTS'). '::'.$file->reports; ?>" href="index.php?option=com_rsfiles&task=reports&id=<?php echo $file->fullpath; ?>"><img src="<?php echo JURI::root(); ?>administrator/components/com_rsfiles/assets/images/icons/info.png" alt="<?php echo JText::_('RSFL_REPORTS'); ?>"/></a></td>
			</tr>
		<?php
			$j++;
		}
	?>
		</table>
	</div>
	
	<?php echo JHTML::_( 'form.token' ); ?>
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="task" value="files" />
	<input type="hidden" name="option" value="com_rsfiles" />
	<input type="hidden" name="view" value="files" />
	<input type="hidden" name="controller" value="files" />
	<input type="hidden" name="path" value="<?php echo $this->current; ?>" />
	</form>