forked from leftypol/leftypol
context.php: handle the search.flag_filter configuration option
This commit is contained in:
parent
d695ff2582
commit
8028c1bd9a
1 changed files with 8 additions and 6 deletions
|
|
@ -72,12 +72,14 @@ function build_context(array $config): Context {
|
|||
},
|
||||
SearchService::class => function($c) {
|
||||
$config = $c->get('config');
|
||||
|
||||
$flags = null;
|
||||
if ($config['search']['flag_filter']) {
|
||||
if ($config['user_flag']) {
|
||||
$flags = $config['user_flags'];
|
||||
} elseif ($config['country_flags']) {
|
||||
$flags = Flags::EMBEDDED_FLAGS;
|
||||
} else {
|
||||
$flags = null;
|
||||
}
|
||||
}
|
||||
|
||||
$board_uris = $config['search']['boards'] ?? null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue