Преглед изворни кода

New flag to open/collapse the search form at the top of a page in an OQLMenuNode.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4052 a333f486-631f-4898-b8df-5754b55c2be0
dflaven пре 9 година
родитељ
комит
88714bf58c
2 измењених фајлова са 6 додато и 3 уклоњено
  1. 4 2
      application/menunode.class.inc.php
  2. 2 1
      setup/compiler.class.inc.php

+ 4 - 2
application/menunode.class.inc.php

@@ -618,6 +618,7 @@ class OQLMenuNode extends MenuNode
 	protected $sPageTitle;
 	protected $sOQL;
 	protected $bSearch;
+	protected $bSearchFormOpen;
 	
 	/**
 	 * Extra parameters to be passed to the display block to fine tune its appearence
@@ -637,12 +638,13 @@ class OQLMenuNode extends MenuNode
 	 * @param integer $iAllowedResults Expected "rights" for the action: either UR_ALLOWED_YES, UR_ALLOWED_NO, UR_ALLOWED_DEPENDS or a mix of them...
 	 * @return MenuNode
 	 */
-	public function __construct($sMenuId, $sOQL, $iParentIndex, $fRank = 0, $bSearch = false, $sEnableClass = null, $iActionCode = null, $iAllowedResults = UR_ALLOWED_YES, $sEnableStimulus = null)
+	public function __construct($sMenuId, $sOQL, $iParentIndex, $fRank = 0, $bSearch = false, $sEnableClass = null, $iActionCode = null, $iAllowedResults = UR_ALLOWED_YES, $sEnableStimulus = null, $bSearchFormOpen = true)
 	{
 		parent::__construct($sMenuId, $iParentIndex, $fRank, $sEnableClass, $iActionCode, $iAllowedResults, $sEnableStimulus);
 		$this->sPageTitle = "Menu:$sMenuId+";
 		$this->sOQL = $sOQL;
 		$this->bSearch = $bSearch;
+		$this->bSearchFormOpen = $bSearchFormOpen;
 		$this->m_aParams = array();
 		$this->aReflectionProperties['oql'] = $sOQL;
 		$this->aReflectionProperties['do_search'] = $bSearch;
@@ -671,7 +673,7 @@ class OQLMenuNode extends MenuNode
 			Dict::S($this->sPageTitle),
 			'Menu_'.$this->GetMenuId(),
 			$this->bSearch, // Search pane
-			true, // Search open
+			$this->bSearchFormOpen, // Search open
 			$oPage, 
 			array_merge($this->m_aParams, $aExtraParams),
 			true

+ 2 - 1
setup/compiler.class.inc.php

@@ -1738,7 +1738,8 @@ EOF;
 		case 'OQLMenuNode':
 			$sOQL = self::QuoteForPHP($oMenu->GetChildText('oql'));
 			$bSearch = ($oMenu->GetChildText('do_search') == '1') ? 'true' : 'false';
-			$sNewMenu = "new OQLMenuNode('$sMenuId', $sOQL, $sParentSpec, $fRank, $bSearch);";
+			$sSearchFormOpen = ($oMenu->GetChildText('search_form_open') == '1') ? 'true' : 'false';
+			$sNewMenu = "new OQLMenuNode('$sMenuId', $sOQL, $sParentSpec, $fRank, $bSearch, $sSearchFormOpen);";
 			break;
 
 		case 'NewObjectMenuNode':