mirror of
https://github.com/flextype/flextype.git
synced 2025-08-17 18:36:39 +02:00
@@ -113,6 +113,7 @@ class FieldsetsController extends Controller
|
||||
|
||||
public function editProcess($request, $response)
|
||||
{
|
||||
$id = $request->getParsedBody()['id'];
|
||||
$data = $request->getParsedBody()['data'];
|
||||
|
||||
if (v::json()->validate($data)) {
|
||||
@@ -123,11 +124,11 @@ class FieldsetsController extends Controller
|
||||
$this->flash->addMessage('error', __('admin_message_fieldset_was_not_saved'));
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->router->pathFor('admin.fieldsets.index'));
|
||||
return $response->withRedirect($this->router->pathFor('admin.fieldsets.edit') . '?id=' . $id);
|
||||
|
||||
} else {
|
||||
$this->flash->addMessage('error', __('admin_message_json_invalid'));
|
||||
return $response->withRedirect($this->router->pathFor('admin.fieldsets.index'));
|
||||
return $response->withRedirect($this->router->pathFor('admin.fieldsets.edit') . '?id=' . $id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -158,7 +158,7 @@ class SnippetsController extends Controller
|
||||
$this->flash->addMessage('error', __('admin_message_snippet_was_not_saved'));
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->router->pathFor('admin.snippets.index'));
|
||||
return $response->withRedirect($this->router->pathFor('admin.snippets.edit') . '?id=' . $id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -163,6 +163,7 @@ class TemplatesController extends Controller
|
||||
*/
|
||||
public function editProcess(Request $request, Response $response) : Response
|
||||
{
|
||||
$id = $request->getParsedBody()['id'];
|
||||
$type = $request->getParsedBody()['type'];
|
||||
|
||||
if (Filesystem::write(PATH['themes'] . '/' . $this->registry->get('settings.theme') . '/' . $this->_type_location($type) . $request->getParsedBody()['id'] . '.html', $request->getParsedBody()['data'])) {
|
||||
@@ -171,7 +172,7 @@ class TemplatesController extends Controller
|
||||
$this->flash->addMessage('error', __('admin_message_' . $type . '_was_not_saved'));
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->router->pathFor('admin.templates.index'));
|
||||
return $response->withRedirect($this->router->pathFor('admin.templates.edit') . '?id=' . $id . '&type=' . $type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user