mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 09:08:42 +02:00
N°3621 - Add config. parameter to disable "global search" history
This commit is contained in:
@@ -48,6 +48,8 @@ class GlobalSearch extends UIBlock
|
||||
protected $sEndpoint;
|
||||
/** @var array $aLastQueries */
|
||||
protected $aLastQueries;
|
||||
/** @var bool $bShowHistory Whether or not to display the elements in the history */
|
||||
protected $bShowHistory;
|
||||
/** @var int $iMaxHistoryResults Max. number of elements in the history */
|
||||
protected $iMaxHistoryResults;
|
||||
|
||||
@@ -64,6 +66,7 @@ class GlobalSearch extends UIBlock
|
||||
parent::__construct($sId);
|
||||
$this->SetEndpoint(static::DEFAULT_ENDPOINT_REL_URL);
|
||||
$this->SetLastQueries($aLastQueries);
|
||||
$this->bShowHistory = (bool) MetaModel::GetConfig()->Get('global_search.show_history');
|
||||
$this->iMaxHistoryResults = (int) MetaModel::GetConfig()->Get('global_search.max_history_results');
|
||||
}
|
||||
|
||||
@@ -119,6 +122,15 @@ class GlobalSearch extends UIBlock
|
||||
return $this->aLastQueries;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $bShowHistory
|
||||
* @return bool
|
||||
*/
|
||||
public function GetShowHistory(): bool
|
||||
{
|
||||
return $this->bShowHistory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $iMaxHistoryResults
|
||||
* @return int
|
||||
|
||||
Reference in New Issue
Block a user