<?php

	/**
	 * Template für das Anlegen/Bearbeiten einer Produktgruppe
	 */
	//wpsg_debug($this->view['data']);
?>
<div class="wrap columns-2 wpsg_produkt_addedit">
	<div class="icon32 icon32-posts-post" id="icon-edit"><br /></div>
	<h2>
		<?php echo wpsg_translate(__('Produktgruppe #1#', 'wpsg'), $this->view['data']['name']); ?>
	</h2>
	<br />

	<?php echo $this->writeBackendMessage(); ?>
	
	<form method="POST" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Productgroups&wpsg_mod_action=save&noheader=1" enctype="multipart/form-data"> 
		
		<div id="postbox" class="metabox-holder has-right-sidebar">

			<div id="side-info-column" class="inner-sidebar">
				<div id="side-sortables" class="meta-box-sortables ui-sortable">
					
					<?php $this->callMods('wpsg_mod_productgroups_addedit_sidebar', array(&$this->view['data'])); ?>		
					
				</div>
			</div>

			<div id="post-body">	
				<div id="post-body-content">
					<div class="postbox" id="postbox_kunde_anschrift">
						<div title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></div>		
						<h3 class="hndle"><span><?php echo __('Name', 'wpsg'); ?></span></h3>
						<div class="inside">
						
							<?php echo wpsg_drawForm_Input('wpsg_mod_productgroups_name', __('Name', 'wpsg'), $this->view['data']['name']); ?>
							
							<?php if (wpsg_isSizedArray($this->view['languages'])) { ?>
							<?php foreach ($this->view['languages'] as $l) { if ($l['locale'] != $this->getDefaultLanguage()) { ?>
							
							<?php echo wpsg_drawForm_Input(
								'lang['.$l['locale'].'][name]', 
								__('Name', 'wpsg').'&nbsp;('.$l['name'].'&nbsp;<img src="'.$this->getFlagURL().$l['flag'].'" alt="'.$l['Name'].'" />)',
								$this->view['data']['lang'][$l['locale']]['name']
							); ?>							
														
							<?php } } ?>
							<?php } ?>
							
							<?php echo wpsg_drawForm_Select('wpsg_mod_productgroups_template', __('Template', 'wpsg'), $this->view['templates'], $this->view['data']['template_file']); ?>
							<?php echo wpsg_drawForm_Select('wpsg_mod_productgroups_infopage', __('Info Seite', 'wpsg'), $this->view['pages'], $this->view['data']['infopage']); ?>
				
						</div>
					</div>
				
					<p class="submit">
						<input type="submit" value="<?php echo __('Produktgruppe speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" />
						<input type="submit" value="<?php echo __('Produktgruppe speichern und zur Übersicht', 'wpsg'); ?>" class="button-primary" id="submit_index" name="submit_index" />
					</p>
			
				</div>
			</div>
			
		</div>
		
		<?php if (isset($this->view['data']['id']) && $this->view['data']['id'] > 0) { ?>
		<input type="hidden" name="edit_id" value="<?php echo $this->view['data']['id']; ?>" />
		<?php } ?>
	
	</form>
	
</div>