summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/controllers/admin_themedetails.php12
-rw-r--r--core/helpers/theme.php4
2 files changed, 13 insertions, 3 deletions
diff --git a/core/controllers/admin_themedetails.php b/core/controllers/admin_themedetails.php
index 80d3f187..01054e36 100644
--- a/core/controllers/admin_themedetails.php
+++ b/core/controllers/admin_themedetails.php
@@ -25,7 +25,17 @@ class Admin_Themedetails_Controller extends Admin_Controller {
}
public function save() {
- access::verify_csrf();
+ $form = theme::get_edit_form_admin();
+ $init_array = $form->as_array();
+ if ($form->validate()) {
+ $form_array = $form->as_array();
+ $intersect = array_diff_key($form_array, array('csrf' => 0));
+ foreach ($intersect as $key => $value) {
+ if ($init_array[$key] != $value) {
+ module::set_var("core", $key, $value);
+ }
+ }
+ }
}
}
diff --git a/core/helpers/theme.php b/core/helpers/theme.php
index f36eb371..586ca0cf 100644
--- a/core/helpers/theme.php
+++ b/core/helpers/theme.php
@@ -39,7 +39,7 @@ class theme_Core {
}
static function get_edit_form_admin() {
- $form = new Forge("admin/themes/edit/",
+ $form = new Forge("admin/themedetails/save/",
'', null, array("id" =>"gThemeDetailsForm"));
$group = $form->group("edit_theme");
$group->input("page_size")->label(t("Items per page"))->id("gPageSize")->
@@ -52,7 +52,7 @@ class theme_Core {
rules('required|valid_digit')->
value(module::get_var("core", "resize_size"));
$group->submit("")->value(t("Modify Theme"));
- return $form->render();
+ return $form;
}
static function get_edit_form_content($theme_name) {