mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-06 03:46:12 +02:00
Merge branch 'develop' into feature/integrate-with-admin-pro
This commit is contained in:
15
admin.php
15
admin.php
@@ -352,6 +352,14 @@ class AdminPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize Admin Language if needed
|
||||
/** @var Language $language */
|
||||
$language = $this->grav['language'];
|
||||
if ($language->enabled() && empty($this->grav['session']->admin_lang)) {
|
||||
$this->grav['session']->admin_lang = $language->getLanguage();
|
||||
}
|
||||
|
||||
|
||||
// Decide admin template and route.
|
||||
$path = trim(substr($this->uri->route(), strlen($this->base)), '/');
|
||||
$this->template = 'dashboard';
|
||||
@@ -362,13 +370,6 @@ class AdminPlugin extends Plugin
|
||||
$this->route = array_shift($array);
|
||||
}
|
||||
|
||||
/** @var Language $language */
|
||||
// $require_language = ['pages', 'translations'];
|
||||
// $language = $this->grav['language'];
|
||||
// if ($language->isLanguageInUrl() && !in_array($this->template, $require_language)) {
|
||||
// $this->grav->redirect($this->uri->route());
|
||||
// }
|
||||
|
||||
// Initialize admin class.
|
||||
require_once __DIR__ . '/classes/admin.php';
|
||||
$this->admin = new Admin($this->grav, $this->base, $this->template, $this->route);
|
||||
|
||||
Reference in New Issue
Block a user