<div class="tabbable">
	<ul class="nav nav-tabs">
		<li class="active"><a href="#tab0" data-toggle="tab"><i class="icon-tasks"></i> <?php echo __('admin.informations'); ?></a></li>
		<?php $i = 1; ?>
		<?php foreach($languages as $l): ?>
		<li><a href="#tab<?php echo  $i++; ; ?>" data-toggle="tab"><img src="<?php echo  URL::to_asset('image/flag_'.strtoupper($l->short)); ?>.png" title="<?php echo $l->short; ?>" style="margin-bottom:2px;" alt=""> <?php echo  $l->name ; ?></a></li>
		<?php endforeach; ?>
		<li><a href="#tabfiles" data-toggle="tab"><i class="icon-folder-open"></i> <?php echo __('admin.fichiers'); ?></a></li>
	</ul>
	<div class="tab-content">
		<div class="tab-pane active" id="tab0">
			<table class="table table-striped table-hover">
				<tr <?php if($errors->first('filetype_id')) echo 'class="error"'; ?>>
					<td style="width:300px">Type de fichier *</td>
					<td>
						<?php echo  Form::select('filetype_id', $filetypes, Input::old('filetype_id', (isset($filegroup) ? $filegroup->filetype_id : NULL))); ; ?>
						<?php echo  $errors->first('filetype_id', '<span class="help-inline">:message</span>') ; ?>
					</td>
				</tr>
				<?php if($filegroup): ?>
				<tr>
					<td style="width:300px">Date d'ajout</td>
					<td><?php echo $filegroup->created_at; ?></td>
				</tr>
				<tr>
					<td style="width:300px">Dernière modification</td>
					<td><?php echo $filegroup->updated_at; ?></td>
				</tr>
				<?php endif; ?>
			</table>
		</div>
		
		<?php $i = 1; ?>
		<?php foreach($languages as $l): ?> 
		<div class="tab-pane" id="tab<?php echo $i; ?>">
			<table class="table table-striped">
				<tr <?php if($errors->first($l->short.'_desc')) echo 'class="error"'; ?>>
					<td width="250px">Description</td>
					<td>
						<?php echo  Form::textarea($l->short.'_desc', Input::old($l->short.'_desc', (isset($filegroup) ? $filegroup->content[$l->id -1]->desc : NULL)), array('style'=>'width:98%')) ; ?>
						<?php echo  $errors->first($l->short.'_desc', '<span class="help-inline">:message</span>') ; ?>
					</td>
				</tr>
				<tr <?php if($errors->first($l->short.'_keywords')) echo 'class="error"'; ?>>
					<td width="250px">Mots clés</td>
					<td>
						<?php echo  Form::textarea($l->short.'_keywords', Input::old($l->short.'_keywords', (isset($filegroup) ? $filegroup->content[$l->id -1]->keywords : NULL)), array('style'=>'width:98%;height:60px;','placeholder'=>'Mots clés qui vont permettront d\'identifier les fichiers envoyés dans ce groupe de fichiers, séparés par virgules. Ex : Cefira, Elearning, Formation')) ; ?>
						<?php echo  $errors->first($l->short.'_keywords', '<span class="help-inline">:message</span>') ; ?>
					</td>
				</tr>
			</table>
		</div>
		<?php $i++; ?>
		<?php endforeach; ?>
	
		<div class="tab-pane" id="tabfiles">
			<div style="margin-bottom: 10px;">
				<?php echo __('admin.organiser_fichiers'); ?>
			</div>
			<div>
				<ul id="sortable2" class="unstyled">
				<?php if(isset($filegroup)): ?>
				<?php foreach($filegroup->files as $f): ?>
				<li>
					<input type="hidden" name="files[]" value="<?php echo  $f->id ; ?>">
					<br /><a href="<?php echo URL::to_asset('uploads/files/general/'.$f->name);; ?>" target="_blank"><?php echo  substr($f->short_name(),0,24) ; ?></a>
					<br /><br />
					<?php echo  Form::select('visible_'.$f->id, array('public'=>'Public', 'prive'=>'Membres identifiés seulement'), Input::old('visible_'.$f->id, ((isset($f) && $f->visible!='') ? $f->visible : 'public')), array('style'=>'width:180px;')); ; ?>
					<br /><br />
					<a class="btn btn-danger delete_file"><?php echo __('admin.supprimer'); ?></a></li>
				<?php endforeach; ?>
				<?php endif; ?>
				</ul>
				<div style="clear:both"><br /></div>	
			</div>	

			<input class="btn" id="file_upload2" name="file_upload2" type="file" multiple="true">
			<div style="clear:both; margin-bottom: 15px;"></div>
			<div id="queue2"></div>
		</div>
	</div>
</div>
<script type="text/javascript">
$('.datepicker').datepicker({
	dateFormat: 'yy-mm-d'
});
var upload_script = '<?php echo URL::to_action('backend::filegroups@file'); ?>';
</script>