<?php

	/**
	 * Template für die Liste der Fußtexte
	 */

?>
<?php if (sizeof($this->view['wpsg_mod_deliverynote']['data']) <= 0) { ?>
<p><?php echo __('Bisher keine Fußtexte angelegt!', 'wpsg'); ?></p>
<?php } else { ?>
<table class="wpsg_foottextlist">			
	<tr>
		<th class="col_kuerzel"><?php echo __('Kürzel', 'wpsg'); ?></th>
		<th class="col_text"><?php echo __('Text', 'wpsg'); ?></th>
		<th class="col_standard"><?php echo __('Standard', 'wpsg'); ?></th>
		<th class="col_aktion"></th>
	</tr>
	<?php foreach ((array)$this->view['wpsg_mod_deliverynote']['data'] as $key => $d) { ?>
	<tr>
		<td class="col_kuerzel wpsg_editable" id="wpsg_foottext_0_<?php echo $key; ?>"><?php echo wpsg_hspc($d[0]); ?></td>
		<td class="col_text wpsg_editable" id="wpsg_foottext_1_<?php echo $key; ?>"><?php echo wpsg_hspc($d[1]); ?></td>
		<td class="col_standard"><input type="radio" value="<?php echo $key; ?>" <?php echo (($this->get_option('wpsg_mod_deliverynote_foottext_standard') == $key)?'checked="checked"':''); ?> class="wpsg_mod_deliverynote_foottext_standard" name="wpsg_mod_deliverynote_foottext_standard" /></td>
		<td class="col_aktion">
		
			<a onclick="return wpsg_removeFooter(<?php echo $key; ?>);" title="<?php echo __('Fußtext löschen', 'wpsg'); ?>'" href="#" class="wpsg_icon wpsg_icon_center wpsg_icon_remove"></a>
			
			<script type="text/javascript">

				jQuery(document).ready(function() {
 
					jQuery('#wpsg_foottext_0_<?php echo $key; ?>').editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_deliverynote&do=inlineEdit&noheader=1', {
						submitdata: { 
				    		field: '0',
				    		field_id: '<?php echo $key; ?>'
						}, 					
						submit: '<?php echo __('Speichern', 'wpsg'); ?>',
						placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
						indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
				    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
					});	
	
					jQuery('#wpsg_foottext_1_<?php echo $key; ?>').editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_deliverynote&do=inlineEdit&noheader=1', {
						submitdata: { 
				    		field: '1',
				    		field_id: '<?php echo $key; ?>'
						}, 					
						submit: '<?php echo __('Speichern', 'wpsg'); ?>',
						placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
						indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
				    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
					});	

				} );
					
			</script>
			
		</td>
	</tr>
	<?php } ?>
</table>
<?php } ?>