diff --git a/src/app/controller/page.php b/src/app/controller/page.php index 0d0d873..b891592 100644 --- a/src/app/controller/page.php +++ b/src/app/controller/page.php @@ -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' => [], diff --git a/src/app/view/theme/default/page/form/description.phtml b/src/app/view/theme/default/page/form/description.phtml index 33df21b..483f6da 100644 --- a/src/app/view/theme/default/page/form/description.phtml +++ b/src/app/view/theme/default/page/form/description.phtml @@ -13,6 +13,30 @@

+
+ + + + + + + +