2018-11-07 15:40:22 +01:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.'); ?>
|
2018-02-06 18:26:59 +01:00
|
|
|
|
2018-11-07 15:40:22 +01:00
|
|
|
<?php echo Bootstrap::formOpen(array('id'=>'jsform', 'class'=>'tab-content')); ?>
|
2018-02-06 18:26:59 +01:00
|
|
|
|
2018-11-07 15:40:22 +01:00
|
|
|
<div class="align-middle">
|
|
|
|
<div class="float-right mt-1">
|
|
|
|
<button type="button" class="btn btn-primary btn-sm jsbuttonSave" name="save"><?php $L->p('Save') ?></button>
|
|
|
|
<a class="btn btn-secondary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>" role="button"><?php $L->p('Cancel') ?></a>
|
|
|
|
</div>
|
|
|
|
<?php echo Bootstrap::pageTitle(array('title'=>$L->g('Plugins position'), 'icon'=>'tags')); ?>
|
|
|
|
</div>
|
2018-02-06 18:26:59 +01:00
|
|
|
|
2018-11-07 15:40:22 +01:00
|
|
|
<div class="alert alert-primary"><?php $L->p('Drag and Drop to sort the plugins') ?></div>
|
2018-02-06 18:26:59 +01:00
|
|
|
|
2018-11-07 15:40:22 +01:00
|
|
|
<?php
|
2018-07-20 18:36:47 +02:00
|
|
|
// Token CSRF
|
|
|
|
echo Bootstrap::formInputHidden(array(
|
|
|
|
'name'=>'tokenCSRF',
|
|
|
|
'value'=>$security->getTokenCSRF()
|
|
|
|
));
|
2018-02-06 18:26:59 +01:00
|
|
|
|
2018-07-20 18:36:47 +02:00
|
|
|
echo Bootstrap::formInputHidden(array(
|
|
|
|
'name'=>'plugin-list',
|
|
|
|
'value'=>''
|
|
|
|
));
|
2018-02-06 18:26:59 +01:00
|
|
|
|
2018-07-20 18:36:47 +02:00
|
|
|
echo '<ul class="list-group list-group-sortable">';
|
|
|
|
foreach ($plugins['siteSidebar'] as $Plugin) {
|
|
|
|
echo '<li class="list-group-item" data-plugin="'.$Plugin->className().'"><span class="oi oi-move"></span> '.$Plugin->name().'</li>';
|
|
|
|
}
|
|
|
|
echo '</ul>';
|
2018-02-06 18:26:59 +01:00
|
|
|
?>
|
|
|
|
|
2018-11-07 15:40:22 +01:00
|
|
|
<?php echo Bootstrap::formClose(); ?>
|
|
|
|
|
2018-02-06 18:26:59 +01:00
|
|
|
<script>
|
2018-07-20 18:36:47 +02:00
|
|
|
$(document).ready(function() {
|
|
|
|
$('.list-group-sortable').sortable({
|
|
|
|
placeholderClass: 'list-group-item'
|
|
|
|
});
|
|
|
|
|
|
|
|
$(".jsbuttonSave").on("click", function() {
|
2018-02-06 18:26:59 +01:00
|
|
|
var tmp = [];
|
2018-07-20 18:36:47 +02:00
|
|
|
$("li.list-group-item").each(function() {
|
2018-02-06 18:26:59 +01:00
|
|
|
tmp.push( $(this).attr("data-plugin") );
|
|
|
|
});
|
2018-07-20 18:36:47 +02:00
|
|
|
$("#jsplugin-list").attr("value", tmp.join(",") );
|
|
|
|
$("#jsform").submit();
|
2018-02-06 18:26:59 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|