Commit d6ef5363 authored by gbyte.co's avatar gbyte.co

Split configuration into separate configurations

parent 21719c4f
node: []
taxonomy_term: []
menu_link_content: []
custom:
-
path: /
priority: 1.0
entity_types:
node: []
taxonomy_term: []
menu_link_content: []
settings:
max_links: 2000
cron_generate: true
remove_duplicates: true
skip_untranslated: false
batch_process_limit: 1500
max_links: 2000
cron_generate: true
remove_duplicates: true
skip_untranslated: false
batch_process_limit: 1500
simple_sitemap.settings:
type: config_object
mapping:
settings:
type: mapping
mapping:
max_links:
label: 'Max links'
type: integer
cron_generate:
label: 'Cron generate'
type: boolean
remove_duplicates:
label: 'Remove duplicates'
type: boolean
skip_untranslated:
label: 'Skip untranslated'
type: boolean
batch_process_limit:
label: 'Batch process limit'
type: integer
custom:
label: 'Custom'
max_links:
label: 'Max links'
type: integer
cron_generate:
label: 'Cron generate'
type: boolean
remove_duplicates:
label: 'Remove duplicates'
type: boolean
skip_untranslated:
label: 'Skip untranslated'
type: boolean
batch_process_limit:
label: 'Batch process limit'
type: integer
simple_sitemap.entity_types:
type: config_object
mapping:
type: sequence
sequence:
type: sequence
sequence:
type: mapping
mapping:
path:
label: 'Path'
type: string
index:
label: 'Index'
type: integer
priority:
label: 'Priority'
type: float
entity_types:
label: 'Entity types'
type: sequence
sequence:
type: sequence
sequence:
type: mapping
mapping:
index:
label: 'Index'
type: integer
priority:
label: 'Priority'
type: float
entities:
label: 'Entities'
type: sequence
sequence:
type: mapping
mapping:
index:
label: 'Index'
type: integer
priority:
label: 'Priority'
type: float
simple_sitemap.custom:
type: config_object
sequence:
type: mapping
mapping:
path:
label: 'Path'
type: string
priority:
label: 'Priority'
type: float
......@@ -59,7 +59,9 @@ class Simplesitemap {
* The requested configuration.
*/
public function getConfig($key) {
return $this->configFactory->get('simple_sitemap.settings')->get($key);
$config = $this->configFactory->get("simple_sitemap.$key")->get();
unset($config['_core']);
return $config;
}
/**
......@@ -82,8 +84,8 @@ class Simplesitemap {
* @return $this
*/
public function saveConfig($key, $value) {
$this->configFactory->getEditable('simple_sitemap.settings')
->set($key, $value)->save();
$this->configFactory->getEditable("simple_sitemap.$key")
->setData($value)->save();
return $this;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment