Browse Source

Hide menu pane automatically if requested. Useful for automation.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2576 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 12 years ago
parent
commit
1f51e431fc
1 changed files with 8 additions and 6 deletions
  1. 8 6
      application/itopwebpage.class.inc.php

+ 8 - 6
application/itopwebpage.class.inc.php

@@ -83,6 +83,13 @@ class iTopWebPage extends NiceWebPage
 		$sSearchAny = addslashes(Dict::S('UI:SearchValue:Any'));
 		$sSearchAny = addslashes(Dict::S('UI:SearchValue:Any'));
 		$sSearchNbSelected = addslashes(Dict::S('UI:SearchValue:NbSelected'));
 		$sSearchNbSelected = addslashes(Dict::S('UI:SearchValue:NbSelected'));
 		
 		
+		$bForceMenuPane = utils::ReadParam('force_menu_pane', null);
+		$sInitClosed = '';
+		if (($bForceMenuPane !== null) && ($bForceMenuPane == 0))
+		{
+			$sInitClosed = 'initClosed: true,';
+		}
+		
 		$this->m_sInitScript =
 		$this->m_sInitScript =
 <<< EOF
 <<< EOF
 	try
 	try
@@ -93,7 +100,7 @@ class iTopWebPage extends NiceWebPage
 		paneSize = GetUserPreference('menu_size', 300)
 		paneSize = GetUserPreference('menu_size', 300)
 		myLayout = $('body').layout({
 		myLayout = $('body').layout({
 			west :	{
 			west :	{
-						minSize: 200, size: paneSize, spacing_open: 16, spacing_close: 16, slideTrigger_open: "mouseover", hideTogglerOnSlide: true, enableCursorHotkey: false,
+						$sInitClosed minSize: 200, size: paneSize, spacing_open: 16, spacing_close: 16, slideTrigger_open: "mouseover", hideTogglerOnSlide: true, enableCursorHotkey: false,
 						onclose_end: function(name, elt, state, options, layout)
 						onclose_end: function(name, elt, state, options, layout)
 						{
 						{
 								if (state.isSliding == false)
 								if (state.isSliding == false)
@@ -320,11 +327,6 @@ EOF
 	$('.caselog_header').click( function () { $(this).toggleClass('open').next('.caselog_entry').toggle(); });
 	$('.caselog_header').click( function () { $(this).toggleClass('open').next('.caselog_entry').toggle(); });
 EOF
 EOF
 		);
 		);
-		$bForceMenuPane = utils::ReadParam('force_menu_pane', null);
-		if ($bForceMenuPane !== null)
-		{
-			appUserPreferences::SetPref('menu_pane',  ($bForceMenuPane) ? 'open' : 'closed');
-		}
 		$sUserPrefs = appUserPreferences::GetAsJSON();
 		$sUserPrefs = appUserPreferences::GetAsJSON();
 		$this->add_script(
 		$this->add_script(
 <<<EOF
 <<<EOF