2018-11-07 15:40:22 +01:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.'); ?>
|
2017-04-17 12:49:03 +02:00
|
|
|
|
2018-11-07 15:40:22 +01:00
|
|
|
<?php echo Bootstrap::formOpen(array('id'=>'jsform')); ?>
|
2017-04-17 12:49:03 +02:00
|
|
|
|
2018-11-07 15:40:22 +01:00
|
|
|
<div class="align-middle">
|
|
|
|
<div class="float-right mt-1">
|
|
|
|
<button type="submit" class="btn btn-primary btn-sm" name="save"><?php $L->p('Save') ?></button>
|
|
|
|
<button type="button" class="btn btn-danger btn-sm" data-toggle="modal" data-target="#jsdeleteModal"><?php $L->p('Delete') ?></button>
|
|
|
|
<a class="btn btn-secondary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>" role="button"><?php $L->p('Cancel') ?></a>
|
|
|
|
</div>
|
|
|
|
<?php echo Bootstrap::pageTitle(array('title'=>$L->g('Edit Category'), 'icon'=>'cog')); ?>
|
|
|
|
</div>
|
2017-04-17 12:49:03 +02:00
|
|
|
|
2018-11-07 15:40:22 +01:00
|
|
|
<?php
|
|
|
|
// Token CSRF
|
2018-04-22 17:45:31 +02:00
|
|
|
echo Bootstrap::formInputHidden(array(
|
2017-04-17 12:49:03 +02:00
|
|
|
'name'=>'tokenCSRF',
|
2018-07-17 19:13:01 +02:00
|
|
|
'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'
|
|
|
|
));
|
|
|
|
|
2018-04-22 17:45:31 +02:00
|
|
|
echo Bootstrap::formInputHidden(array(
|
2018-04-27 20:36:43 +02:00
|
|
|
'name'=>'oldKey',
|
|
|
|
'value'=>$categoryMap['key']
|
2017-04-17 12:49:03 +02:00
|
|
|
));
|
|
|
|
|
2018-11-02 00:25:17 +01:00
|
|
|
echo Bootstrap::formInputText(array(
|
2018-04-27 20:36:43 +02:00
|
|
|
'name'=>'name',
|
2018-08-05 17:54:20 +02:00
|
|
|
'label'=>$L->g('Name'),
|
2018-04-27 20:36:43 +02:00
|
|
|
'value'=>$categoryMap['name'],
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
2018-11-02 00:25:17 +01:00
|
|
|
echo Bootstrap::formTextarea(array(
|
2018-08-02 17:06:53 +02:00
|
|
|
'name'=>'description',
|
2018-08-05 17:54:20 +02:00
|
|
|
'label'=>$L->g('Description'),
|
2018-08-02 17:06:53 +02:00
|
|
|
'value'=>isset($categoryMap['description'])?$categoryMap['description']:'',
|
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>'',
|
|
|
|
'rows'=>3
|
|
|
|
));
|
|
|
|
|
2018-11-02 00:25:17 +01:00
|
|
|
echo Bootstrap::formInputText(array(
|
2018-04-27 20:36:43 +02:00
|
|
|
'name'=>'template',
|
2018-08-05 17:54:20 +02:00
|
|
|
'label'=>$L->g('Template'),
|
2018-04-27 20:36:43 +02:00
|
|
|
'value'=>isset($categoryMap['template'])?$categoryMap['template']:'',
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>''
|
2017-04-17 12:49:03 +02:00
|
|
|
));
|
|
|
|
|
2018-11-02 00:25:17 +01:00
|
|
|
echo Bootstrap::formInputText(array(
|
2018-08-05 17:54:20 +02:00
|
|
|
'name'=>'newKey',
|
|
|
|
'label'=>$L->g('Friendly URL'),
|
|
|
|
'value'=>$categoryMap['key'],
|
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
2018-11-02 00:25:17 +01:00
|
|
|
'tip'=>DOMAIN_CATEGORIES.$categoryMap['key']
|
2018-08-05 17:54:20 +02:00
|
|
|
));
|
|
|
|
|
2018-04-22 17:45:31 +02:00
|
|
|
echo Bootstrap::formClose();
|
2018-07-25 23:42:00 +02:00
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<!-- Modal for delete category -->
|
|
|
|
<?php
|
|
|
|
echo Bootstrap::modal(array(
|
2018-08-05 17:54:20 +02:00
|
|
|
'buttonPrimary'=>$L->g('Delete'),
|
2018-11-07 15:40:22 +01:00
|
|
|
'buttonPrimaryClass'=>'btn-danger jsbuttonDeleteAccept',
|
2018-08-05 17:54:20 +02:00
|
|
|
'buttonSecondary'=>$L->g('Cancel'),
|
2018-11-07 15:40:22 +01:00
|
|
|
'buttonSecondaryClass'=>'btn-secondary',
|
2018-08-05 17:54:20 +02:00
|
|
|
'modalTitle'=>$L->g('Delete category'),
|
|
|
|
'modalText'=>$L->g('Are you sure you want to delete this category?'),
|
2018-07-25 23:42:00 +02:00
|
|
|
'modalId'=>'jsdeleteModal'
|
|
|
|
));
|
|
|
|
?>
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
// Delete content
|
|
|
|
$(".jsbuttonDeleteAccept").on("click", function() {
|
|
|
|
$("#jsaction").val("delete");
|
|
|
|
$("#jsform").submit();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|