Skip to content

Commit

Permalink
Issue #4940 - Flex panel changes not sticking.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Apr 3, 2023
1 parent 3feccca commit ca31946
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 11 additions & 5 deletions e107_admin/includes/flexpanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,25 @@
// Save rearranged menus to user.
if(e_AJAX_REQUEST)
{

if(FLEXPANEL_ENABLED && varset($_POST['core-flexpanel-order'], false))
{
// If "Apply dashboard preferences to all administrators" is checked.
//print_r($_POST);
if($adminPref == 1)
{

e107::getConfig()
->setPosted('core-flexpanel-order', $_POST['core-flexpanel-order'])
->save();
->save(true,true);

}
else
{
e107::getUser()
$result = e107::getUser()
->getConfig()
->set('core-flexpanel-order', $_POST['core-flexpanel-order'])
->save();
->save(true,true);
}
exit;
}
Expand All @@ -56,7 +60,7 @@
class adminstyle_flexpanel extends adminstyle_infopanel
{

private $iconlist = array();
private $iconlist;

/**
* Constructor.
Expand Down Expand Up @@ -342,7 +346,9 @@ function getMenuPosition($id)

if(!empty($user_pref['core-flexpanel-order'][$id]))
{
return $user_pref['core-flexpanel-order'][$id];
$arr = $user_pref['core-flexpanel-order'][$id];

return ['area' => $arr['area'], 'weight' => (int) $arr['weight']];
}

$default = array(
Expand Down
4 changes: 3 additions & 1 deletion e107_web/js/core/admin.flexpanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
}
});

$.post(window.location.href, {'core-flexpanel-order': NewOrder});
$.post(window.location.href, {'core-flexpanel-order': NewOrder}).done(function( data ) {
console.log(data);
});
};

e107.callbacks.flexPanelEmptyPanels = function ()
Expand Down

0 comments on commit ca31946

Please sign in to comment.