mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-28 08:46:45 +01:00
slugifying the name
This commit is contained in:
@@ -2196,14 +2196,14 @@ class AdminController extends AdminBaseController
|
|||||||
|
|
||||||
$data = ['color_scheme' => $this->data['whitelabel']['color_scheme'] ?? null];
|
$data = ['color_scheme' => $this->data['whitelabel']['color_scheme'] ?? null];
|
||||||
$name = $this->data['whitelabel']['color_scheme']['name'] ?? 'theme';
|
$name = $this->data['whitelabel']['color_scheme']['name'] ?? 'theme';
|
||||||
//todo slugify name
|
|
||||||
$location = 'asset://' . $name . '.yaml';
|
$location = 'asset://' . \Grav\Plugin\Admin\Utils::slug($name) . '.yaml';
|
||||||
|
|
||||||
[$status, $msg] = $this->grav['admin-whitelabel']->exportPresetScsss($data, $location);
|
[$status, $msg] = $this->grav['admin-whitelabel']->exportPresetScsss($data, $location);
|
||||||
|
|
||||||
$json_response = [
|
$json_response = [
|
||||||
'status' => 'success' ,
|
'status' => $status ? 'success' : 'error',
|
||||||
'message' => 'Theme Export Ready',
|
'message' => $msg,
|
||||||
'files' => [
|
'files' => [
|
||||||
'download' => Utils::url($location)
|
'download' => Utils::url($location)
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user