1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-29 16:00:15 +02:00

Flextype Box Plugin: Admin #125 #117

- Templates Controller/Views implementation
This commit is contained in:
Awilum
2019-05-28 23:38:25 +03:00
parent dceac6700f
commit 160b767dc4

View File

@@ -111,7 +111,21 @@ class TemplatesController extends Controller
public function editProcess($request, $response, $args)
{
$type = $request->getParsedBody()['type_current'];
if ($type == 'partial') {
$_type = '/templates/partials/';
} else {
$_type = '/templates/';
}
if (Filesystem::write( PATH['themes'] . '/' . $this->registry->get('settings.theme') . $_type . $request->getParsedBody()['id'] . '.html', $request->getParsedBody()['data'])) {
$this->flash->addMessage('success', __('admin_message_'.$type.'_saved'));
} else {
$this->flash->addMessage('error', __('admin_message_'.$type.'_was_not_saved'));
}
return $response->withRedirect($this->container->get('router')->pathFor('admin.fieldsets.index'));
}
public function rename($request, $response, $args)