Correctly set the file name including the language if set

This commit is contained in:
Flavio Copes
2015-08-12 19:05:30 +02:00
parent 4ab28e367b
commit 7b18ddb740

View File

@@ -1148,7 +1148,12 @@ class AdminController
if (isset($input['type']) && !empty($input['type'])) {
$type = (string) strtolower($input['type']);
$name = preg_replace('|.*/|', '', $type) . '.md';
$name = preg_replace('|.*/|', '', $type);
$language = $this->grav['language'];
if ($language->enabled()) {
$name .= '.' . $language->getLanguage();
}
$name .= '.md';
$page->name($name);
$page->template($type);
}