mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
add content locale filter #14
This commit is contained in:
parent
0c26c0ac9b
commit
bbd54b3a14
3 changed files with 37 additions and 4 deletions
|
|
@ -4,7 +4,20 @@ class AppControllerModuleSearch
|
|||
{
|
||||
public function render()
|
||||
{
|
||||
$query = empty($_GET['query']) ? false : urldecode($_GET['query']);
|
||||
$query = empty($_GET['query']) ? false : urldecode($_GET['query']);
|
||||
$locale = empty($_GET['locale']) ? 'all' : urldecode($_GET['locale']);
|
||||
|
||||
$locales = [];
|
||||
|
||||
foreach (Environment::config('locales') as $key => $value)
|
||||
{
|
||||
$locales[$key] = (object)
|
||||
[
|
||||
'key' => $key,
|
||||
'value' => $value[0],
|
||||
'active' => $key === $locale // false !== stripos($_SERVER['HTTP_ACCEPT_LANGUAGE'], $key) ? true : false,
|
||||
];
|
||||
}
|
||||
|
||||
include __DIR__ . '../../../view/theme/default/module/search.phtml';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue