mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 09:08:42 +02:00
N°2847 - Global Search: Fix class images URL, rename internal variable
This commit is contained in:
@@ -52,15 +52,15 @@ class GlobalSearch extends UIBlock
|
||||
* GlobalSearch constructor.
|
||||
*
|
||||
* @param string $sId
|
||||
* @param array $aLastClasses
|
||||
* @param array $aLastQueries
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct($sId = null, $aLastClasses = [])
|
||||
public function __construct($sId = null, $aLastQueries = [])
|
||||
{
|
||||
parent::__construct($sId);
|
||||
$this->SetEndpoint(static::DEFAULT_ENDPOINT_REL_URL);
|
||||
$this->SetLastQueries($aLastClasses);
|
||||
$this->SetLastQueries($aLastQueries);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -101,19 +101,26 @@ class GlobalSearchHelper
|
||||
* @throws \CoreException
|
||||
* @throws \CoreUnexpectedValue
|
||||
* @throws \MySQLException
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function GetLastQueries()
|
||||
{
|
||||
/** @var array $aHistoryEntries */
|
||||
$aHistoryEntries = appUserPreferences::GetPref(static::USER_PREF_CODE, []);
|
||||
|
||||
// Add HTML label if missing
|
||||
for($iIdx = 0; $iIdx < count($aHistoryEntries); $iIdx++)
|
||||
{
|
||||
// Add HTML label if missing
|
||||
if(!isset($aHistoryEntries[$iIdx]['label_html']))
|
||||
{
|
||||
$aHistoryEntries[$iIdx]['label_html'] = utils::HtmlEntities($aHistoryEntries[$iIdx]['query']);
|
||||
}
|
||||
|
||||
// Set absolute URL
|
||||
if(isset($aHistoryEntries[$iIdx]['icon_url']))
|
||||
{
|
||||
$aHistoryEntries[$iIdx]['icon_url'] = utils::GetAbsoluteUrlAppRoot().$aHistoryEntries[$iIdx]['icon_url'];
|
||||
}
|
||||
}
|
||||
|
||||
return $aHistoryEntries;
|
||||
|
||||
Reference in New Issue
Block a user