1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 04:40:44 +02:00

Issue #4940 - Flex panel changes not sticking.

This commit is contained in:
Cameron
2023-04-03 16:27:42 -07:00
parent 3feccca0ec
commit ca31946d1a
2 changed files with 14 additions and 6 deletions

View File

@@ -26,21 +26,25 @@ define('FLEXPANEL_ENABLED', $flepanelEnabled);
// Save rearranged menus to user. // Save rearranged menus to user.
if(e_AJAX_REQUEST) if(e_AJAX_REQUEST)
{ {
if(FLEXPANEL_ENABLED && varset($_POST['core-flexpanel-order'], false)) if(FLEXPANEL_ENABLED && varset($_POST['core-flexpanel-order'], false))
{ {
// If "Apply dashboard preferences to all administrators" is checked. // If "Apply dashboard preferences to all administrators" is checked.
//print_r($_POST);
if($adminPref == 1) if($adminPref == 1)
{ {
e107::getConfig() e107::getConfig()
->setPosted('core-flexpanel-order', $_POST['core-flexpanel-order']) ->setPosted('core-flexpanel-order', $_POST['core-flexpanel-order'])
->save(); ->save(true,true);
} }
else else
{ {
e107::getUser() $result = e107::getUser()
->getConfig() ->getConfig()
->set('core-flexpanel-order', $_POST['core-flexpanel-order']) ->set('core-flexpanel-order', $_POST['core-flexpanel-order'])
->save(); ->save(true,true);
} }
exit; exit;
} }
@@ -56,7 +60,7 @@ e107_require_once(e_ADMIN . 'includes/infopanel.php');
class adminstyle_flexpanel extends adminstyle_infopanel class adminstyle_flexpanel extends adminstyle_infopanel
{ {
private $iconlist = array(); private $iconlist;
/** /**
* Constructor. * Constructor.
@@ -342,7 +346,9 @@ class adminstyle_flexpanel extends adminstyle_infopanel
if(!empty($user_pref['core-flexpanel-order'][$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( $default = array(

View File

@@ -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 () e107.callbacks.flexPanelEmptyPanels = function ()