Переглянути джерело

Demo mode: disable the pin button on the left pane (and keeps it open and resizable)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3080 a333f486-631f-4898-b8df-5754b55c2be0
romainq 11 роки тому
батько
коміт
96985337c3
1 змінених файлів з 23 додано та 6 видалено
  1. 23 6
      application/itopwebpage.class.inc.php

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

@@ -111,6 +111,23 @@ function ShowAboutBox()
 }
 EOF
 		);
+
+		if (MetaModel::GetConfig()->Get('demo_mode'))
+		{
+			// Leave the pane opened
+			$sConfigureWestPane = '';
+		}
+		else
+		{
+			$sConfigureWestPane =
+<<<EOF
+				if (GetUserPreference('menu_pane', 'open') == 'closed')
+				{
+					myLayout.close('west');
+				}
+				myLayout.addPinBtn( "#tPinMenu", "west" );
+EOF;
+		}
 		
 		$this->m_sInitScript =
 <<< EOF
@@ -163,13 +180,9 @@ EOF
 					}
 		});
 		window.clearTimeout(iPaneVisWatchDog);
-		myLayout.addPinBtn( "#tPinMenu", "west" );
 		//myLayout.open( "west" );
 		$('.ui-layout-resizer-west .ui-layout-toggler').css({background: 'transparent'});
-		if (GetUserPreference('menu_pane', 'open') == 'closed')
-		{
-			myLayout.close('west');
-		}
+		$sConfigureWestPane
 		
 		$('#left-pane').layout({ resizable: false, spacing_open: 0, south: { size: 94 }, enableCursorHotkey: false });
 	
@@ -214,6 +227,7 @@ EOF
 	}
 EOF
 		;
+
 		$this->add_ready_script(
 <<< EOF
 	
@@ -790,7 +804,10 @@ EOF
 			$sHtml .= ' <div id="top-left"></div><div id="logo"><a href="'.htmlentities($sIconUrl, ENT_QUOTES, 'UTF-8').'"><img src="'.$sDisplayIcon.'" title="'.htmlentities($sVersionString, ENT_QUOTES, 'UTF-8').'" style="border:0; margin-top:16px; margin-right:40px;"/></a></div>';
 			$sHtml .= ' </div>';
 			$sHtml .= ' <div class="header-menu">';
-			$sHtml .= '		<div class="icon ui-state-default ui-corner-all"><span id="tPinMenu" class="ui-icon ui-icon-pin-w">pin</span></div>';
+			if (!MetaModel::GetConfig()->Get('demo_mode'))
+			{
+				$sHtml .= '		<div class="icon ui-state-default ui-corner-all"><span id="tPinMenu" class="ui-icon ui-icon-pin-w">pin</span></div>';
+			}
 			$sHtml .= '		<div style="text-align:center;">'.self::FilterXSS($sForm).'</div>';
 			$sHtml .= ' </div>';
 			$sHtml .= ' </div>';