<?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' ); 
?>

<?php if($this->rsfilesConfig['component_title'] == 1) { ?>
<div class="componentheading"><?php echo JText::_('RSFL_DOWNLOADS') ;?></div> 
<?php } ?>
<br/>
<?php if($this->rsfilesConfig['enable_rss'] == 1) { ?> <a href="<?php echo JRoute::_('index.php?option=com_rsfiles&view=files'.$this->currentfolder.'&format=feed&type=rss',false); ?>"><?php echo JHTML::_('image',JURI::root().'images/M_images/livemarks.png',JText::_('RSFL_FEEDBACK'),'style="float:right"'); ?></a> <?php } ?>
<table width="100%">
	<tr>
		<td width="100">
			<a style="text-decoration:none;" href="<?php echo JRoute::_('index.php?option=com_rsfiles&view=files'.$this->itemid); ?>"><img style="vertical-align:middle;" src="<?php echo JURI::root().'components/com_rsfiles/images/icons/home.png'; ?>" alt="<?php echo JText::_('RSFL_HOME'); ?>" /> <?php echo JText::_('RSFL_HOME'); ?></a>
		</td>
		<?php if($this->rsfilesConfig['show_search'] == 1) { ?>
		<td width="100">
			<a style="text-decoration:none;" href="<?php echo JRoute::_('index.php?option=com_rsfiles&view=files&layout=search'.$this->itemid); ?>"><img style="vertical-align:middle;" src="<?php echo JURI::root().'components/com_rsfiles/images/icons/search.png'; ?>" alt="<?php echo JText::_('RSFL_SEARCH'); ?>" /> <?php echo JText::_('RSFL_SEARCH'); ?></a>
		</td>
		<?php } ?>
		<?php if($this->maintenance) { ?>
		
		<?php if($this->rsfilesConfig['enable_upload'] == 1) { ?>
		<td width="100">
			<a style="text-decoration:none;" href="<?php echo JRoute::_('index.php?option=com_rsfiles&view=files&layout=upload'.$this->currentfolder.$this->itemid); ?>"><img style="vertical-align:middle;" src="<?php echo JURI::root().'components/com_rsfiles/images/icons/upload.png'; ?>" alt="<?php echo JText::_('RSFL_UPLOAD'); ?>" /> <?php echo JText::_('RSFL_UPLOAD'); ?></a>
		</td>
		<?php } ?>
		
		<td width="100">
			<a style="text-decoration:none;" class="modal" rel="{size: {x: 450, y: 200}}" href="<?php echo JRoute::_('index.php?option=com_rsfiles&view=files&layout=newfolder&tmpl=component'.$this->currentfolder.$this->itemid); ?>"><img style="vertical-align:middle;" src="<?php echo JURI::root().'components/com_rsfiles/images/icons/newfolder.png'; ?>" alt="<?php echo JText::_('RSFL_NEW_FOLDER'); ?>" /> <?php echo JText::_('RSFL_NEW_FOLDER'); ?></a>
		</td>
		
		<?php if($this->current != $this->rsfilesConfig['download_folder']) { ?>
		<td width="100">
			<a style="text-decoration:none;" onclick="if(!confirm('<?php echo JText::_('RSFL_DELETE_MESSAGE',true); ?>')) return false;" href="<?php echo JRoute::_('index.php?option=com_rsfiles&task=remove&controller=files'.$this->currentfolder.$this->itemid); ?>"><img style="vertical-align:middle;" src="<?php echo JURI::root().'components/com_rsfiles/images/icons/delete.png'; ?>" alt="<?php echo JText::_('RSFL_DELETE'); ?>" /> <?php echo JText::_('RSFL_DELETE'); ?></a>
		</td>
		<?php } } ?>
		<td width="100">
			<a style="text-decoration:none;" href="<?php echo JRoute::_('index.php?option=com_rsfiles&view=files&layout=bookmarks',false); ?>"><img style="vertical-align:middle;" src="<?php echo JURI::root().'components/com_rsfiles/images/icons/bookmarks.png'; ?>" alt="<?php echo JText::_('RSFL_BOOKMARKS'); ?>" /> <?php echo JText::_('RSFL_BOOKMARKS'); ?></a>
		</td>
		
		<?php if($this->current != $this->rsfilesConfig['download_folder']) { ?>
		<td width="100">
			<?php 
				$this->previous = str_replace($this->rsfilesConfig['download_folder'].DS,'',$this->previous);
				$previous = empty($this->previous) ? '' : '&folder='.$this->previous ;
			?>
			<a style="text-decoration:none;" href="<?php echo JRoute::_('index.php?option=com_rsfiles&view=files'.$previous.$this->itemid); ?>"><img style="vertical-align:middle;" src="<?php echo JURI::root().'components/com_rsfiles/images/icons/up.png'; ?>" alt="<?php echo JText::_('RSFL_UP'); ?>" /> <?php echo JText::_('RSFL_UP'); ?></a>
		</td>
		<?php } ?>
		<td>&nbsp;</td>
	</tr>
</table>
<br/><br/>

<?php 
if($this->rsfilesConfig['file_path'] == 1)
{
	if(is_array($this->parts))
	{
		echo ' <a href="'.JRoute::_('index.php?option=com_rsfiles&view=files'.$this->itemid).'">'.JText::_('RSFL_HOME').'</a> <img src="'.JURI::root().'components/com_rsfiles/images/icons/arrow.png" /> ';
		$counter = count($this->parts);
		foreach ($this->parts as $i=>$element) 
		{
			$image = ($i < $counter - 1) ? '<img src="'.JURI::root().'components/com_rsfiles/images/icons/arrow.png" />' : '';
			
			echo '<a href="'.JRoute::_('index.php?option=com_rsfiles&view=files&folder='.$element->fullpath.$this->itemid).'">'.$element->name.'</a> '.$image;
		}
	} else echo $this->parts;
	echo '<br/>';
}
?>

<?php if($this->rsfilesConfig['show_pagination_position'] == 0 || $this->rsfilesConfig['show_pagination_position'] == 2 ) { ?>
<div class="rsfiles-pagination">
	<div class="rsfl_pageslinks">
		<?php echo $this->pagination->getPagesLinks(); ?>
	</div>
	<p class="rsfl_pagescounter">
		<?php echo $this->pagination->getPagesCounter(); ?>
	</p>
</div>
<?php } ?>

<?php
echo $this->fileheader;  
if(!empty($this->layouts))
{
	foreach($this->layouts as $layout)
		echo $layout;
} else echo JText::_('RSFL_NO_FILES');
?>

<?php if($this->rsfilesConfig['show_pagination_position'] == 1 || $this->rsfilesConfig['show_pagination_position'] == 2 ) { ?>
<br/>
<div class="rsfiles-pagination">
	<div class="rsfl_pageslinks">
		<?php echo $this->pagination->getPagesLinks(); ?>
	</div>
	<p class="rsfl_pagescounter">
		<?php echo $this->pagination->getPagesCounter(); ?>
	</p>
</div>
<?php } ?>
