Admin language switcher. Enabled only if multilang is active. Allows to switch pages content to the desired language

This commit is contained in:
Flavio Copes
2015-08-14 19:12:04 +02:00
parent dd41509c79
commit ecfc77df1c
4 changed files with 53 additions and 2 deletions

View File

@@ -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.
*