mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 19:36:08 +01:00
Added theme whitelabel export functionality
This commit is contained in:
@@ -3,8 +3,10 @@ namespace Grav\Plugin\Admin;
|
||||
|
||||
use Grav\Common\Data\Data;
|
||||
use Grav\Common\Grav;
|
||||
use Grav\Framework\File\File;
|
||||
use RocketTheme\Toolbox\Event\Event;
|
||||
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class WhiteLabel
|
||||
{
|
||||
@@ -66,4 +68,22 @@ class WhiteLabel
|
||||
return [false, ' Could not be recompiled, missing color scheme...'];
|
||||
}
|
||||
|
||||
public function exportPresetScsss($config, $location = 'asset://admin-theme-export.yaml')
|
||||
{
|
||||
|
||||
if (isset($config['color_scheme'])) {
|
||||
|
||||
$color_scheme = $config['color_scheme'];
|
||||
|
||||
$body = Yaml::dump($color_scheme);
|
||||
|
||||
$file = new File($location);
|
||||
$file->save($body);
|
||||
|
||||
return [true, 'File created successfully'];
|
||||
|
||||
} else {
|
||||
return [false, ' Could not export, missing color scheme...'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user