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,8 +62,10 @@
*/ */
public static function formComponentSave() { public static function formComponentSave() {
if (Request::post('sandbox_component_save')) { if (Request::post('sandbox_component_save')) {
Option::update('sandbox_template', Request::post('sandbox_form_template')); if (Security::check(Request::post('csrf'))) {
Request::redirect('index.php?id=themes'); Option::update('sandbox_template', Request::post('sandbox_form_template'));
Request::redirect('index.php?id=themes');
}
} }
} }
@@ -72,12 +74,15 @@
* Form Component * Form Component
*/ */
public static function formComponent() { public static function formComponent() {
$_templates = Themes::getTemplates();
foreach($_templates as $template) $templates[basename($template, '.template.php')] = basename($template, '.template.php');
$_templates = Themes::getTemplates();
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().