mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-01 13:20:55 +01:00
Admin language switcher. Enabled only if multilang is active. Allows to switch pages content to the desired language
This commit is contained in:
@@ -1028,6 +1028,21 @@ class AdminController
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function taskSwitchlanguage() {
|
||||
$language = $this->grav['uri']->param('lang');
|
||||
|
||||
if ($language) {
|
||||
$this->grav['session']->admin_lang = $language ?: 'en';
|
||||
}
|
||||
|
||||
$redirect = 'pages';
|
||||
|
||||
$this->admin->setMessage('Successfully switched language', 'info');
|
||||
$this->setRedirect($redirect);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare and return POST data.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user