<?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.TemplateName.value=='') { form.TemplateName.className = 'jdError'; ret=false; } else { form.TemplateName.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 width="100">
							<label for="TemplateName">
								<?php echo JText::_( 'RSFL_TEMPLATE_NAME' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="TemplateName" value="<?php echo $this->data->TemplateName; ?>" size="50" /> (*)
						</td>
					</tr>
					<?php if($this->data->Type == 1) { ?>
					<tr>
						<td width="100">
							<label for="TemplateHeader">
								<?php echo JText::_( 'RSFL_TEMPLATE_HEADER' ).':'; ?>
							</label>
						</td>
						<td>						
							<textarea  cols="90" rows="20" name="TemplateHeader"><?php echo $this->data->TemplateHeader; ?></textarea>
						</td>
					</tr>
					<?php } ?>
					<tr>
						<td>
							<label for="TemplateLayout">
								<?php echo JText::_( 'RSFL_TEMPLATE_LAYOUT' ).':'; ?>
							</label>
						</td>
						<td>						
							<textarea  cols="90" rows="20" name="TemplateLayout"><?php echo $this->data->TemplateLayout; ?></textarea>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
<?php echo JHTML::_( 'form.token' ); ?>
<input type="hidden" name="option" value="com_rsfiles" />
<input type="hidden" name="IdTemplate" value="<?php echo $this->data->IdTemplate; ?>" />
<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="savetemplate" />
</form>

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