Advanced Search WIP: new mechanism for passing the dictionary to the client side. Hopefully faster than before thanks to the browser's cache.

SVN:b1162[5453]
This commit is contained in:
Denis Flaven
2018-03-16 17:44:55 +00:00
parent 52f56e1bb0
commit f8f6e201b9
5 changed files with 135 additions and 32 deletions

View File

@@ -357,5 +357,25 @@ class Dict
// No need to actually load the strings since it's only used to know the list of languages
// at setup time !!
}
/**
* Export all the dictionary entries - of the given language - whose code matches the given prefix
* @param string $sStartingWith
* @return string[]
*/
public static function ExportEntries($sStartingWith)
{
self::InitLangIfNeeded(self::GetUserLanguage());
$aEntries = array();
$iLength = strlen($sStartingWith);
foreach(self::$m_aData[self::GetUserLanguage()] as $sCode => $sEntry)
{
if (substr($sCode, 0, $iLength) == $sStartingWith)
{
$aEntries[$sCode] = $sEntry;
}
}
return $aEntries;
}
}
?>