Converts theme settings to configuration.
array $theme_settings: An array of theme settings from system setting form or a Drupal 7 variable.
Config $config: The configuration object to update.
The Config object with updated data.
system_theme_settings_submit()
function theme_settings_convert_to_config(array $theme_settings, Config $config) {
foreach ($theme_settings as $key => $value) {
if ($key == 'default_logo') {
$config
->set('logo.use_default', $value);
}
else {
if ($key == 'logo_path') {
$config
->set('logo.path', $value);
}
else {
if ($key == 'default_favicon') {
$config
->set('favicon.use_default', $value);
}
else {
if ($key == 'favicon_path') {
$config
->set('favicon.path', $value);
}
else {
if ($key == 'favicon_mimetype') {
$config
->set('favicon.mimetype', $value);
}
else {
if (substr($key, 0, 7) == 'toggle_') {
$config
->set('features.' . drupal_substr($key, 7), $value);
}
else {
if (!in_array($key, array(
'theme',
'logo_upload',
))) {
$config
->set($key, $value);
}
}
}
}
}
}
}
}
return $config;
}