1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-17 18:36:39 +02:00

feat(default-theme): fix grid view for root entries

This commit is contained in:
Awilum
2020-02-18 20:28:27 +03:00
parent 70538a1947
commit d2677f5196

View File

@@ -1098,10 +1098,11 @@ class EntriesController extends Controller
if ($post_data['id'] == '') {
$data = [];
Arr::set($data, 'plugins.admin.entries.items_view_default', $post_data['items_view']);
//Filesystem::write(PATH['config']['site'] . '/settings.yaml', $this->parser->encode(array_replace_recursive($this->registry->get('settings'), $data), 'yaml'));
$admin_plugin_settings = $this->parser->decode(Filesystem::read(PATH['config']['site'] . '/plugins/admin/settings.yaml'), 'yaml');
$admin_plugin_settings['entries']['items_view_default'] = $post_data['items_view'];
Filesystem::write(PATH['config']['site'] . '/plugins/admin/settings.yaml', $this->parser->encode($admin_plugin_settings, 'yaml'));
} else {
$this->entries->update($post_data['id'], ['items_view' => $post_data['items_view']]);
$this->entries->update($post_data['id'], ['items_view_default' => $post_data['items_view']]);
}
return $response->withRedirect($this->router->pathFor('admin.entries.index') . '?id=' . $post_data['id']);