diff --git a/application/itopwebpage.class.inc.php b/application/itopwebpage.class.inc.php
index fa94cc53b..139d0cb6c 100644
--- a/application/itopwebpage.class.inc.php
+++ b/application/itopwebpage.class.inc.php
@@ -26,6 +26,7 @@
require_once("../application/nicewebpage.class.inc.php");
require_once("../application/usercontext.class.inc.php");
require_once("../application/applicationcontext.class.inc.php");
+require_once("../application/user.preferences.class.inc.php");
/**
* Web page with some associated CSS and scripts (jquery) for a fancier display
*/
@@ -95,15 +96,44 @@ class iTopWebPage extends NiceWebPage
$(document).ready(function () {
// Layout
+ paneSize = GetUserPreference('menu_size', 300)
myLayout = $('body').layout({
- west : { minSize: 200, size: 300 /* TO DO: read from a cookie ?*/, spacing_open: 16, spacing_close: 16, slideTrigger_open: "mouseover", hideTogglerOnSlide: true }
+ west : {
+ minSize: 200, size: paneSize, spacing_open: 16, spacing_close: 16, slideTrigger_open: "mouseover", hideTogglerOnSlide: true,
+ onclose_end: function(name, elt, state, options, layout)
+ {
+ if (state.isSliding == false)
+ {
+ SetUserPreference('menu_pane', 'closed', true);
+ }
+ },
+ onresize_end: function(name, elt, state, options, layout)
+ {
+ if (state.isSliding == false)
+ {
+ SetUserPreference('menu_size', state.size, true);
+ }
+ },
+
+ onopen_end: function(name, elt, state, options, layout)
+ {
+ if (state.isSliding == false)
+ {
+ SetUserPreference('menu_pane', 'open', true);
+ }
+ }
+ }
});
myLayout.addPinBtn( "#tPinMenu", "west" );
//myLayout.open( "west" );
$('.ui-layout-resizer-west').html('
');
+ if (GetUserPreference('menu_pane', 'open') == 'closed')
+ {
+ myLayout.close('west');
+ }
// Accordion Menu
- $("#accordion").accordion({ header: "h3", navigation: true, autoHeight: false });
+ $("#accordion").accordion({ header: "h3", navigation: true, autoHeight: false, collapsible: false });
});
//$("div[id^=tabbedContent] > ul").tabs( 1, { fxFade: true, fxSpeed: 'fast' } ); // tabs
@@ -128,11 +158,13 @@ class iTopWebPage extends NiceWebPage
catch(err)
{
// Do something with the error !
+ alert(err);
}
//$('.display_block').draggable(); // make the blocks draggable
EOF
);
+ $sUserPrefs = appUserPreferences::GetAsJSON();
$this->add_script("
// For automplete
function findValue(li) {
@@ -173,6 +205,8 @@ EOF
$('#rawOutput').dialog( {autoOpen: true, modal:false});
}
}
+
+ var oUserPreferences = $sUserPrefs;
");
// Add the standard menus
@@ -223,36 +257,56 @@ EOF
public function GetSiloSelectionForm()
{
- $sHtml = '