1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-03 19:57:57 +02:00

Sandbox Plugin: updates

This commit is contained in:
Awilum
2012-10-03 23:11:38 +03:00
parent ef7b209fca
commit 632a8aa27b

View File

@@ -62,10 +62,12 @@
*/ */
public static function formComponentSave() { public static function formComponentSave() {
if (Request::post('sandbox_component_save')) { if (Request::post('sandbox_component_save')) {
if (Security::check(Request::post('csrf'))) {
Option::update('sandbox_template', Request::post('sandbox_form_template')); Option::update('sandbox_template', Request::post('sandbox_form_template'));
Request::redirect('index.php?id=themes'); Request::redirect('index.php?id=themes');
} }
} }
}
/** /**
@@ -74,10 +76,13 @@
public static function formComponent() { public static function formComponent() {
$_templates = Themes::getTemplates(); $_templates = Themes::getTemplates();
foreach($_templates as $template) $templates[basename($template, '.template.php')] = basename($template, '.template.php'); foreach($_templates as $template) {
$templates[] = basename($template, '.template.php');
}
echo ( echo (
Form::open(). Form::open().
Form::hidden('csrf', Security::token()).
Form::label('sandbox_form_template', __('Sandbox template')). Form::label('sandbox_form_template', __('Sandbox template')).
Form::select('sandbox_form_template', $templates, Option::get('sandbox_template')). Form::select('sandbox_form_template', $templates, Option::get('sandbox_template')).
Html::br(). Html::br().