bludit/bl-kernel/admin/views/edit-category.php

92 lines
2.2 KiB
PHP
Raw Normal View History

<?php defined('BLUDIT') or die('Bludit CMS.');
2017-04-17 12:49:03 +02:00
2018-06-24 13:37:45 +02:00
echo Bootstrap::pageTitle(array('title'=>$L->g('Edit Category'), 'icon'=>'tags'));
2017-04-17 12:49:03 +02:00
2018-07-25 23:42:00 +02:00
echo Bootstrap::formOpen(array('id'=>'jsform'));
2017-04-17 12:49:03 +02:00
echo Bootstrap::formInputHidden(array(
2017-04-17 12:49:03 +02:00
'name'=>'tokenCSRF',
'value'=>$security->getTokenCSRF()
2017-04-17 12:49:03 +02:00
));
2018-07-25 23:42:00 +02:00
echo Bootstrap::formInputHidden(array(
'name'=>'action',
'value'=>'edit'
));
echo Bootstrap::formInputHidden(array(
'name'=>'oldKey',
'value'=>$categoryMap['key']
2017-04-17 12:49:03 +02:00
));
echo Bootstrap::formInputTextBlock(array(
'name'=>'name',
'label'=>$L->g('Category name'),
'value'=>$categoryMap['name'],
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formInputGroupText(array(
'name'=>'newKey',
'label'=>$L->g('Category key'),
'labelInside'=>DOMAIN_CATEGORIES,
'value'=>$categoryMap['key'],
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
2018-08-02 17:06:53 +02:00
echo Bootstrap::formTextareaBlock(array(
'name'=>'description',
'label'=>$L->g('Category description'),
'value'=>isset($categoryMap['description'])?$categoryMap['description']:'',
'class'=>'',
'placeholder'=>'',
'tip'=>'',
'rows'=>3
));
echo Bootstrap::formInputTextBlock(array(
'name'=>'template',
'label'=>$L->g('Category template'),
'value'=>isset($categoryMap['template'])?$categoryMap['template']:'',
'class'=>'',
'placeholder'=>'',
'tip'=>''
2017-04-17 12:49:03 +02:00
));
echo '
<div class="form-group mt-4">
2018-07-25 23:42:00 +02:00
<button type="submit" class="btn btn-primary">'.$L->g('Save').'</button>
<a class="btn btn-secondary" href="'.HTML_PATH_ADMIN_ROOT.'categories" role="button">'.$L->g('Cancel').'</a>
2018-07-25 23:42:00 +02:00
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#jsdeleteModal">'.$L->g('Delete').'</button>
</div>
';
2017-04-17 12:49:03 +02:00
echo Bootstrap::formClose();
2018-07-25 23:42:00 +02:00
?>
<!-- Modal for delete category -->
<?php
echo Bootstrap::modal(array(
'buttonPrimary'=>'Delete',
'buttonPrimaryClass'=>'jsbuttonDeleteAccept',
'buttonSecondary'=>'Cancel',
'buttonSecondaryClass'=>'',
'modalTitle'=>'Delete category',
'modalText'=>'Are you sure you want to delete the category ?',
'modalId'=>'jsdeleteModal'
));
?>
<script>
$(document).ready(function() {
// Delete content
$(".jsbuttonDeleteAccept").on("click", function() {
$("#jsaction").val("delete");
$("#jsform").submit();
});
});
</script>