<?php defined('KOBLOG') or die('Koblog CMS.'); ?>

<?php echo Bootstrap::formOpen(array('id'=>'jsform', 'class'=>'tab-content')); ?>

<div class="d-flex justify-content-between mb-2">
<?php echo Bootstrap::pageTitle(array('title'=>$L->g(string: 'New category'), 'icon'=>'tag')); ?>
	<div>
		<button type="submit" class="btn btn-primary" name="save"><?php $L->p('Save') ?></button>
		<a class="btn btn-secondary" href="<?php echo HTML_PATH_ADMIN_ROOT.'categories' ?>" role="button"><?php $L->p('Cancel') ?></a>
	</div>
</div>

<div class="card"><div class="card-body">
<?php
	echo Bootstrap::formInputHidden(array(
		'name'=>'tokenCSRF',
		'value'=>$security->getTokenCSRF()
	));

	echo Bootstrap::formInputText(array(
		'name'=>'name',
		'label'=>$L->g('Name'),
		'value'=>isset($_POST['category'])?$_POST['category']:'',
		'class'=>'',
		'placeholder'=>'',
		'tip'=>''
	));

	echo Bootstrap::formTextarea(array(
		'name'=>'description',
		'label'=>$L->g('Description'),
		'value'=>isset($_POST['description'])?$_POST['description']:'',
		'class'=>'',
		'placeholder'=>'',
		'tip'=>'',
		'rows'=>3
	));
?>
</div>
</div>

<?php echo Bootstrap::formClose(); ?>
