mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-02 01:55:31 +00:00
add content language selection #14
This commit is contained in:
parent
d77ad74d32
commit
0d840a5ab5
4 changed files with 100 additions and 52 deletions
|
|
@ -46,9 +46,32 @@ class AppControllerPage
|
|||
|
||||
public function renderFormDescription()
|
||||
{
|
||||
// Prepare locales
|
||||
$locales = [];
|
||||
|
||||
foreach (Environment::config('locales') as $key => $value)
|
||||
{
|
||||
$locales[$key] = (object)
|
||||
[
|
||||
'key' => $key,
|
||||
'value' => $value[0],
|
||||
'active' => false !== stripos($_SERVER['HTTP_ACCEPT_LANGUAGE'], $key) ? true : false,
|
||||
];
|
||||
}
|
||||
|
||||
// Init form
|
||||
$form = (object)
|
||||
[
|
||||
'locale' => (object)
|
||||
[
|
||||
'error' => [],
|
||||
'values' => $locales,
|
||||
'attribute' => (object)
|
||||
[
|
||||
'value' => null,
|
||||
'placeholder' => _('Page content language'),
|
||||
]
|
||||
],
|
||||
'title' => (object)
|
||||
[
|
||||
'error' => [],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue