Skip to content

Commit

Permalink
improv. convert navbar request to new method
Browse files Browse the repository at this point in the history
  • Loading branch information
nivcoo committed Dec 6, 2021
1 parent f20c9ad commit 675a6ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Controller/NavbarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function admin_save_ajax()
if ($this->isConnected and $this->Permissions->can('MANAGE_NAV')) {
if ($this->request->is('post')) {
if (!empty($this->request->data)) {
$data = $this->request->data['xss']['nav'];
$data = $this->request->data['navbar_order'];
$data = explode('&', $data);
$i = 1;
foreach ($data as $key => $value) {
Expand Down
6 changes: 2 additions & 4 deletions app/View/Navbar/admin_index.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@
axis: 'y',
stop: function (event, ui) {
$('#save').empty().html('<?= $Lang->get('NAVBAR__SAVE_IN_PROGRESS') ?>');
var inputs = {};
var nav = $(this).sortable('serialize');
inputs['nav'] = nav;
$('#yolo').text(nav);
let inputs = {};
inputs['navbar_order'] = $(this).sortable('serialize');
inputs['data[_Token][key]'] = '<?= $csrfToken ?>';
$.post("<?= $this->Html->url(['controller' => 'navbar', 'action' => 'save_ajax', 'admin' => true]) ?>", inputs, function (data) {
if (data.statut) {
Expand Down

0 comments on commit 675a6ab

Please sign in to comment.