<table>
	<col class='column_source'/>
	<col class='column_delete'/>
	<col class='column_name'/>
<?php if($this->has_tables): ?>
	<col class='column_delete'/>
	<col class='column_table'/>
<?php endif?>
<?php if($this->settings_instructionTitle()!=""): ?>
	<col class='column_instruction'/>
<?php endif?>
<?php if($this->settings_actionTitle()!=""): ?>
	<col class='column_action'/>
<?php endif?>
	<col class='column_slack'/>	
	<thead> 
		<tr>
			<th class='icon_copy' title='Select the item to be copied when create new forms.'></th>
			<th class='icon_delete' title='Select forms to delete, or reset.'></th>
			<th>Name</th>
<?php if($this->has_tables): ?>
			<th class='icon_delete' title='Select tables to delete.'></th>
			<th>Table</th>
<?php endif?>
<?php if($this->settings_instructionTitle()!=""): ?>
			<th><?php echo $this->settings_instructionTitle();?></th>
<?php endif?>
<?php if($this->settings_actionTitle()!=""): ?>
			<th><?php echo $this->settings_actionTitle();?></th>
<?php endif?>
			<th></th>
		</tr>
	</thead>
	<tbody>
<?php $this->alternate();foreach($this->forms as $this->name=>$this->form):?>
		<tr class='<?php echo $this->alternate();?>'>
<?php if(null!==$this->form['name']): ?>
			<td>
				<input type = 'radio' <?php $this->checked('default',$this->name);?> name='source_setting' value='<?php echo $this->name;?>' />
			</td>
			<td>
				<input type = 'checkbox' name='delete_setting[]' value='<?php echo $this->name;?>' />
			</td>
			<td>
				<?php echo $this->form['name'];?>
			</td>
<?php else:?>
	<td colspan=3></td>
<?php endif?>
<?php if($this->has_tables): ?>
	<?php if(null!==$this->form['table']): ?>
			<td>
				<input type = 'checkbox' name='delete_table[]' value='<?php echo $this->form['table'];?>' />
			</td>
			<td>
			<a href='<?php echo $this->control_url ( $this->application ()->slug . "/{$this->form['name']}/all.csv" )?>' title='Click to download table as CSV file'>
			<?php echo $this->form['table'];?> (<?php echo $this->form['count'];?>)
			</a>
	<?php endif?>
			</td>
<?php endif?>
<?php if($this->settings_instructionTitle()!=""): ?>
			<td><?php echo $this->settings_instructionColumn()?></td>
<?php endif?>
<?php if($this->settings_actionTitle()!=""): ?>
			<td><?php echo $this->settings_actionColumn()?></td>
<?php endif?>
			<td></td>
		</tr>
	</tbody>
<?php endforeach?>
<tr>
<td colspan=2><label for='new_form'>New</label></td>
<?php if($this->has_tables): ?>
<td colspan = 6>
<?php else:?>
<td colspan = 4>
<?php endif?>
	<input type='text' name='new_form' id='new_form'/>
</td>
</tr>
</table>
<input type='submit' class='button' value='Apply' />
