mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-29 13:38:44 +02:00
N°2847 - Global search: Add config. parameter for max. history results ('global_search.max_history_results')
This commit is contained in:
@@ -21,6 +21,7 @@ namespace Combodo\iTop\Application\UI\Component\GlobalSearch;
|
||||
|
||||
|
||||
use Combodo\iTop\Application\UI\UIBlock;
|
||||
use MetaModel;
|
||||
use utils;
|
||||
|
||||
/**
|
||||
@@ -47,6 +48,8 @@ class GlobalSearch extends UIBlock
|
||||
protected $sEndpoint;
|
||||
/** @var array $aLastQueries */
|
||||
protected $aLastQueries;
|
||||
/** @var int $iMaxHistoryResults Max. number of elements in the history */
|
||||
protected $iMaxHistoryResults;
|
||||
|
||||
/**
|
||||
* GlobalSearch constructor.
|
||||
@@ -61,6 +64,7 @@ class GlobalSearch extends UIBlock
|
||||
parent::__construct($sId);
|
||||
$this->SetEndpoint(static::DEFAULT_ENDPOINT_REL_URL);
|
||||
$this->SetLastQueries($aLastQueries);
|
||||
$this->iMaxHistoryResults = (int) MetaModel::GetConfig()->Get('quick_create.max_history_results');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,4 +118,13 @@ class GlobalSearch extends UIBlock
|
||||
{
|
||||
return $this->aLastQueries;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $iMaxHistoryResults
|
||||
* @return int
|
||||
*/
|
||||
public function GetMaxHistoryResults(): int
|
||||
{
|
||||
return $this->iMaxHistoryResults;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user