{$FORM}
<div class="row">
	<div class ="pull-left">
	<h1>{$txt.HEADING_BEITRAEGE_EDIT}</h1>
	</div>
	<div class ="pull-right">
		<input class="btn btn-success" type="submit" value="{$txt.BUTTON_SAVE}" />
		<a class="btn btn-default" href="blog.php">{$txt.BUTTON_CANCEL}</a>
	</div>
</div>
<div class="row">
	<ul class="nav nav-tabs">
		<li class="active"><a Daten-Toggle="Register" href="#{$txt.TABLE_HEADING_DEFAULT}" data-toggle="tab">{$txt.TABLE_HEADING_DEFAULT}</a></li>
		{foreach name=itemedit item=module_item from=$ITEM_EDIT}
		<li><a Daten-Toggle="Register" href="#{$module_item.langname}" data-toggle="tab">{$module_item.lang_images} {$module_item.langname}</a></li>
		{/foreach}
		{if $ITEMEX == 'true'}
		<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">{$txt.HEADING_NAVIGATION_VERWALUNG}<span class="caret"></span> </a>
			<ul class="dropdown-menu">
				<li><a Daten-Toggle="Register" href="#Block" data-toggle="tab">{$txt.HEADING_NAVIGATION_OVERVIEW}</a></li>
				<li class="divider"></li>
				<li><a Daten-Toggle="Register" href="#Text" data-toggle="tab">{$txt.HEADING_TEXT}</a></li>
				<li><a Daten-Toggle="Register" href="#Images" data-toggle="tab">{$txt.HEADING_IMG}</a></li>
				<li><a Daten-Toggle="Register" href="#Artikel" data-toggle="tab">{$txt.HEADING_ART}</a></li>
				<li><a Daten-Toggle="Register" href="#Kategorie" data-toggle="tab">{$txt.HEADING_KAT}</a></li>
				<li><a Daten-Toggle="Register" href="#Blogitem" data-toggle="tab">{$txt.HEADING_BLOG_I}</a></li>
			</ul>
		</li>
		{/if}
	</ul>
	<div class="tab-content">
		<div class="tab-pane fade in active" id="{$txt.TABLE_HEADING_DEFAULT}">
			<div class="panel panel-default">
				<div class="panel-heading">
					<div class="panel-title"><b>{$txt.CHOOSE_CATEGORIE}</b></div>
				</div>
				<table class="table table-striped">
					<tr>
						<td class="col-xs-3"><b>{$txt.CHOOSE_CATEGORIE}</b></td>
						<td class="col-xs-9">{$ITEMEDIT}</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_NEWCATEGORIE_POSITION}</b></td>
						<td>{$position}</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_BLOG_IMAGE}</b></td>
						<td>{$blog_image} {if $blog_image_name}{$blog_image_prev}{/if}<br>{$blog_image_name} {$blog_image_delete}</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_DATE}</b></td>
						<td>{$date}</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_DATE_UPDATE}</b></td>
						<td>{$date_update}</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_DATE_RELEASE}</b></td>
						<td>{$date_release}</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_DATE_OUT}</b></td>
						<td>{$date_out}</td>
					</tr>
				</table>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading">
					<div class="panel-title"><b>{$txt.HEADING_DATE_CALENDERS}</b></div>
				</div>
				<table class="table table-striped">
					<tr>
						<td class="col-xs-3"><b>{$txt.HEADING_DATE_CALENDER}</b></td>
						<td class="col-xs-9">
							<input type="radio" name="calender" value="0" {if $calender == 0 || $calender == ''}checked="checked"{else}{/if} /> Nein<br>
							<input type="radio" name="calender" value="1" {if $calender == 1}checked="checked"{else}{/if}/> Normal<br>
							<input type="radio" name="calender" value="2" {if $calender == 2}checked="checked"{else}{/if}/> Wichtig<br>
						</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_DATE_CALENDER}</b></td>
						<td>vom: {$datestart} bis: {$dateend}</td>
					</tr>
				</table>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading">
					<div class="panel-title"><b>{$txt.FOOTER_STATUS}</b></div>
				</div>
				<div class="panel-body">{$status}</div>
			</div>
			{if $GRUPPE}
				<div class="panel panel-default">
					<div class="panel-heading">
						<div class="panel-title"><b>{$KGRUPPE}</b></div>
					</div>
					<div class="panel-body">
						{foreach name=catedit item=module_grp from=$GRUPPE}
						{$module_grp.KGRUPPE}
						{/foreach}
					</div>
				</div>
			{/if}
		</div> 
		{foreach name=catedit item=module_item from=$ITEM_EDIT}
		<div class="tab-pane fade in" id="{$module_item.langname}">
			<div class="panel panel-default">
				<div class="panel-heading">
					<div class="panel-title">{$module_cat.lang_images} <b>{$txt.HEADING_NEWCATEGORIE_NAME}</b></div>
				</div>
				<table class="table table-striped">
					<tr>
						<td><b>{$txt.HEADING_SLIDERSET}</b></td>
						<td>{$module_item.field_slider}</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_NEWITEM_TITLE}</b></td>
						<td>{$module_item.fieldname}</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_NEWITEM_NAME}</b></td>
						<td>{$module_item.fieldtitle}</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_CANONICAL}</b></td>
						<td>{$module_item.canonical}</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_META_TITLE}</b></td>
						<td>{$module_item.field_mtitle}</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_META_DESCRIPTION}</b></td>
						<td>{$module_item.field_mdesc}</td>
					</tr>
					<tr>
						<td><b>{$txt.HEADING_META_KEYWORDS}</b></td>
						<td>{$module_item.field_mkeys}</td>
					</tr>
				</table>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading">
					<div class="panel-title"><b>{$txt.TABLE_HEADING_SHORT_DESCRIPTION}</b></div>
				</div>
				<div class="panel-body">
					{$module_item.field_sdesc}
					{if $module_item.field_sdesc_wy == '1'}
					<script>
						CKEDITOR.replace(shortdesc_{$module_item.langid}, {
							toolbar: "ImageMapper",
							language: "{$module_item.language_code}",
							baseHref: "{$module_item.basepath}",
							filebrowserBrowseUrl: "includes/ckeditor/filemanager/index.html"
						});
					</script>
					{/if}            
				</div>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading">
					<div class="panel-title"><b>{$txt.TABLE_HEADING_DESCRIPTION}</b></div>
				</div>
				<div class="panel-body">
					{$module_item.field_ldesc}
					{if $module_item.field_sdesc_wy == '1'}
					<script>
						CKEDITOR.replace(description_{$module_item.langid}, {
							toolbar: "ImageMapper",
							language: "{$module_item.language_code}",
							baseHref: "{$module_item.basepath}",
							filebrowserBrowseUrl: "includes/ckeditor/filemanager/index.html"
						});
					</script>
					{/if}
				</div>
			</div>
		</div>
		{/foreach}    
		{if $ITEMEX == 'true'}
		<div class="tab-pane fade in" id="Block">
			<div class="panel panel-default">
				<div class="panel-heading">
					<b>{$txt.HEADING_BLOCK}</b>
				</div>		
				<div class="panel-body">
					{foreach name=cateditbl item=module_bl from=$BLOECKE}
					<div class="panel panel-default" id="{$module_bl.typ}{$module_bl.tblock_id}">
						<div class="panel-heading" ><b>Typ:{$module_bl.typ} {$module_bl.tblock_id}</b></div>
						<div class="panel-body">
							<b>Pos.:&nbsp{$module_bl.position}</b>
							{if $module_bl.typ == 'SlideShow'}
							 <img src="{$module_bl.description}" />
							{else}
							 Desc:{$module_bl.description|truncate:60}	
							{/if}

							<a data-toggle="modal" href="#" data-target="#Modal{$module_bl.typ}{$module_bl.tblock_id}">
								<button type="button" class="btn btn-danger btn-sm float_right w60">
										<span class="glyphicon glyphicon-trash"></span>
								</button>	
							</a>
							<a data-toggle="modal" href="blog_edit_block.php?updateblock={$module_bl.tblock_id}&typ={$module_bl.typ}&cat={$smarty.get.cat}" data-target="#Modale{$module_bl.typ}{$module_bl.tblock_id}">
								<button type="button" class="btn btn-success btn-sm float_right w60">
									<span class="glyphicon glyphicon-pencil"></span>
								</button>
							</a>
						</div>
					</div>
					<div class="modal fade" id="Modale{$module_bl.typ}{$module_bl.tblock_id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-dialog modal-lg">
							<div class="modal-content">
								
							</div>
						</div>
					</div>
					<div class="modal fade" id="Modal{$module_bl.typ}{$module_bl.tblock_id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-dialog modal-sm">
							<div class="modal-content">
									<div class="modal-header">
									  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
									  <h4 class="modal-title">{$txt.BLOCKENF}</h4>
									</div>	
										<div class="modal-body">
										  <p>{$txt.BLOCKENTFTEXT}</p>
										</div>										
									  <div class="modal-footer">
										<button type="button" class="btn btn-default" data-dismiss="modal">{$txt.BUTTON_CANCEL}</button>
										<button type="button" class="btn btn-danger" data-dismiss="modal" id="delete{$module_bl.typ}{$module_bl.tblock_id}">{$txt.BLOCKENF}</button>
									  </div>
							</div>
						</div>
					</div>					
					{literal}
						<script type="text/javascript">
							$(document).ready(function(){

								$("#delete{/literal}{$module_bl.typ}{$module_bl.tblock_id}{literal}").bind("click", function(){
									$.ajax({
										url: 		"blog_edit_block.php?item={/literal}{$myitem}{literal}&typ={/literal}{$module_bl.typ}{literal}&deleteblock={/literal}{$module_bl.tblock_id}{literal}",
										type: 		"GET",
										async:		false,
										timeout: 	2000,
										error: 		function(){ console.log('error'); },
										success: 	function(){ 
														console.log('success'); 
														$("#{/literal}{$module_bl.typ}{$module_bl.tblock_id}{literal}").remove();
													}
									});
									return true;
								});
							});
						</script>
						{/literal}					
					{/foreach}
				</div>
			</div>
		</div>

		<div class="tab-pane fade in" id="Text">
			<div class="panel panel-default">
				<div class="panel-heading">
					<b>{$txt.POSITION}</b>
				</div>
				<div class="panel-body">
					{$TPOS}
				</div>
				<div class="panel-heading">
					<b>{$txt.HEADING_TEXT}</b>
				</div>	
				{foreach name=catedit item=module_item from=$ITEM_EDIT2}				
				<div class="panel-body">
					<b>{$module_item.langname}</b>
					{$module_item.field_mydesc}
					{if $module_item.field_sdesc_wy == '1'}
					<script type="text/javascript">
						var newCKEdit = CKEDITOR.replace(mydesc_{$module_item.langid});
						CKFinder.setupCKEditor(newCKEdit, 'includes/editor/ckfinder/');		
					</script>
					{/if}            
				</div>				
				{/foreach}
			</div>
		</div>

		<div class="tab-pane fade in" id="Images">
			<div class="panel panel-default">
				<div class="panel-heading">
					<b>{$txt.HEADING_IMG}</b>
				</div>		
				<div class="panel-body">

					<b>{$txt.SLIDERCONF}</b><br>
					<div class="panel panel-default">
						<div class="panel-heading">{$txt.BREITE}:</div>
						<div class="panel-body">{$BILDER2.width}</div>
					</div>
					<div class="panel panel-default">
						<div class="panel-heading">{$txt.HOHE}:</div>
						<div class="panel-body">{$BILDER2.height}</div>
					</div>
					<div class="panel panel-default">
						<div class="panel-heading">{$txt.FLOAT}:</div>
						<div class="panel-body">{$BILDER2.floating}</div>
					</div>
					<div class="panel panel-default">
						<div class="panel-heading">{$txt.POSITION}:</div>
						<div class="panel-body">{$BILDER2.position}</div>
					</div>					
				<b>{$txt.SLIDBILD}</b><br>
				{foreach name=bilder item=module_img from=$BILDER}
				<div class="panel panel-default">
					<div class="panel-heading">{$module_img.bildfeld1}</div>
					<div class="panel-body">
						<input type="file" name="{$module_img.bildfeld3}" />
					</div>
				</div>
				{/foreach}		
				</div>
			</div>
		</div>

		<div class="tab-pane fade in" id="Artikel">
			<div class="panel panel-default">
				<div class="panel-heading">
					<b>{$txt.POSITION}</b>
				</div>
				<div class="panel-body">
					{$APOS}
				</div>
				<div class="panel-heading">
					<b>{$txt.HEADING_ART}</b>
				</div>		
				<div class="panel-body">	
					{$MEART}
				</div>
			</div>
		</div>
		<div class="tab-pane fade in" id="Kategorie">
			<div class="panel panel-default">
				<div class="panel-heading">
					<b>{$txt.POSITION}</b>
				</div>
				<div class="panel-body">
					{$KPOS}
				</div>
				<div class="panel-heading">
					<b>{$txt.HEADING_KAT}</b>
				</div>		
				<div class="panel-body">	
					{$MEKATS}
				</div>
			</div>
		</div>
		<div class="tab-pane fade in" id="Blogitem">
			<div class="panel panel-default">
				<div class="panel-heading">
					<b>{$txt.POSITION}</b>
				</div>
				<div class="panel-body">
					{$BIPOS}
				</div>
				<div class="panel-heading">
					<b>{$txt.HEADING_BLOG_I}</b>
				</div>		
				<div class="panel-body">	
					{$MEBART}
				</div>
			</div>
		</div>
		{/if}
	</div>
</div>
{$action}{$item}
<div class="row">
	<div class ="text-right">
		<input class="btn btn-success" type="submit" value="{$txt.BUTTON_SAVE}" />
		<a class="btn btn-default" href="blog.php">{$txt.BUTTON_CANCEL}</a>
	</div>
</div>
{$FORM_END}