mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-25 22:51:43 +01:00
Push updated preferences to client so favorites don't re-appear / disappear
This commit is contained in:
parent
562ffe972f
commit
0e89b309e3
@ -922,6 +922,12 @@ class etemplate_widget_nextmatch extends etemplate_widget
|
|||||||
$result = $prefs->add($app,$pref_name,$filters,$type);
|
$result = $prefs->add($app,$pref_name,$filters,$type);
|
||||||
$prefs->save_repository(false,$type);
|
$prefs->save_repository(false,$type);
|
||||||
|
|
||||||
|
// Update preferences client side, or it could disappear
|
||||||
|
$pref = $GLOBALS['egw']->preferences->read_repository(false);
|
||||||
|
$pref = $pref[$app];
|
||||||
|
if(!$pref) $pref = Array();
|
||||||
|
egw_json_response::get()->script('window.egw.set_preferences('.json_encode($pref).', "'.$app.'");');
|
||||||
|
|
||||||
egw_json_response::get()->data(isset($result[$app][$pref_name]));
|
egw_json_response::get()->data(isset($result[$app][$pref_name]));
|
||||||
return isset($result[$app][$pref_name]);
|
return isset($result[$app][$pref_name]);
|
||||||
}
|
}
|
||||||
@ -930,6 +936,12 @@ class etemplate_widget_nextmatch extends etemplate_widget
|
|||||||
$result = $prefs->delete($app,$pref_name, $type);
|
$result = $prefs->delete($app,$pref_name, $type);
|
||||||
$prefs->save_repository(false,$type);
|
$prefs->save_repository(false,$type);
|
||||||
|
|
||||||
|
// Update preferences client side, or it could come back
|
||||||
|
$pref = $GLOBALS['egw']->preferences->read_repository(false);
|
||||||
|
$pref = $pref[$app];
|
||||||
|
if(!$pref) $pref = Array();
|
||||||
|
egw_json_response::get()->script('window.egw.set_preferences('.json_encode($pref).', "'.$app.'");');
|
||||||
|
|
||||||
egw_json_response::get()->data(!isset($result[$app][$pref_name]));
|
egw_json_response::get()->data(!isset($result[$app][$pref_name]));
|
||||||
return !isset($result[$app][$pref_name]);
|
return !isset($result[$app][$pref_name]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user