Skip to content

Commit

Permalink
improv. convert social request to new method (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sytorex authored Dec 7, 2021
1 parent 41385da commit cb5403c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Controller/SocialController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function admin_save_ajax() {
if ($this->isConnected AND $this->Permissions->can('MANAGE_SOCIAL')) {
if ($this->request->is('post')) {
if (!empty($this->request->data)) {
$data = $this->request->data['xss']['social_button_order'];
$data = $this->request->data['social_button_order'];
$data = explode('&', $data);
$i = 1;
foreach ($data as $key => $value) {
Expand Down
7 changes: 3 additions & 4 deletions app/View/Social/admin_index.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@
items: '.item:not(.fixed)',
stop: function (event, ui) {
$('#save').empty().html('<?= $Lang->get('SOCIAL__SAVE_IN_PROGRESS') ?>');
var inputs = {};
var social_button_order = $(this).sortable('serialize');
inputs['social_button_order'] = social_button_order;
$('#social_button_order').text(social_button_order);
let inputs = {};
inputs['social_button_order'] = $(this).sortable('serialize');
inputs['data[_Token][key]'] = '<?= $csrfToken ?>';
$.post("<?= $this->Html->url(array('controller' => 'social', 'action' => 'save_ajax', 'admin' => true)) ?>", inputs, function(data) {
if(data.statut) {
Expand All @@ -79,3 +77,4 @@
});
});
</script>

0 comments on commit cb5403c

Please sign in to comment.