<?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');
?>
<script language="javascript" type="text/javascript">

function submitbutton(task)
{
	var form = document.adminForm;
	
	if(task == 'cancel')
	{
		submitform(task);
	}
	else  
	{
		ret = true;
		if(form.ThemeName.value=='') { form.ThemeName.className = 'jdError'; ret=false; } else { form.ThemeName.className = '';  }	
		if(ret) submitform(task);
	}
	return false;
	 
}
</script>
<form action="index.php" method="post" name="adminForm" id="adminForm">
	<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td valign="top">
				<table  class="adminform">
					<tr>
						<td>
							<label for="published">
								<?php echo JText::_( 'RSFL_PUBLISHED' ).':'; ?>
							</label>
						</td>
						<td>						
							<?php echo JHTML::_('select.booleanlist','published','class="inputbox"',$this->data->published); ?>
						</td>
					</tr>
					<tr>
						<td>
							<label for="title">
								<?php echo JText::_( 'RSFL_THEME_NAME' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="ThemeName" value="<?php echo $this->data->ThemeName; ?>" size="50" /> (*)
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
	
<div id="editcell1">
	<table class="adminlist" width="100%">
		<thead>
		<tr>
			<th width="1%">#</th>
			<th width="50%">
				<?php echo JText::_('RSFL_TEMPLATE_NAME'); ?>
			</th>
		</tr>
		</thead>
		<tbody>
<?php
$k = 0;
for ($i=0,$n=count($this->templates);$i<$n;$i++)
{
	$row =& $this->templates[$i];
?>
		<tr class="<?php echo "row$k"; ?>">
			<td><?php echo $row->IdTemplate; ?></td>
			<td><?php echo '<a href="index.php?option=com_rsfiles&task=edittemplate&cid='.$row->IdTemplate.'&IdTheme='.$this->data->IdTheme.'">'.$row->TemplateName.'</a>'; ?></td>
		</tr>
<?php
	$k=1-$k;
}
?>
	</tbody>
	</table>
</div>
<?php echo JHTML::_( 'form.token' ); ?>
<input type="hidden" name="option" value="com_rsfiles" />
<input type="hidden" name="cid" value="<?php echo $this->data->IdTheme; ?>" />
<input type="hidden" name="IdTheme" value="<?php echo $this->data->IdTheme; ?>" />
<input type="hidden" name="controller" value="themes" />
<input type="hidden" name="view" value="themes" />
<input type="hidden" name="task" value="save" />
</form>

<?php
//keep session alive while editing
JHTML::_('behavior.keepalive');
?>