summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/controllers/admin_themes.php8
-rw-r--r--core/helpers/theme.php3
-rw-r--r--core/views/admin_themes.html.php1
-rw-r--r--themes/admin_default/js/ui.init.js10
4 files changed, 19 insertions, 3 deletions
diff --git a/core/controllers/admin_themes.php b/core/controllers/admin_themes.php
index 9896ce50..278fb8f9 100644
--- a/core/controllers/admin_themes.php
+++ b/core/controllers/admin_themes.php
@@ -28,8 +28,8 @@ class Admin_Themes_Controller extends Admin_Controller {
$file = THEMEPATH . $theme_name . "/theme.info";
$theme_info = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS);
- $details = theme::get_edit_form_admin($theme_info);
$theme_info['id'] = $theme_name;
+ $details = theme::get_edit_form_admin($theme_info);
$theme_info['details'] = $details;
if ($theme_info->admin) {
$admin_themes[$theme_name] = $theme_info;
@@ -61,7 +61,11 @@ class Admin_Themes_Controller extends Admin_Controller {
$form = theme::get_edit_form_admin($theme_info);
$valid = $form->validate();
if ($valid) {
- ;
+ print json_encode(array("result" => "success",
+ "message" => t("Theme was successfully updated")));
+ } else {
+ print json_encode(array("result" => "error",
+ "message" => t("Error saving theme values")));
}
}
diff --git a/core/helpers/theme.php b/core/helpers/theme.php
index 65e1eb20..1d3e4a8f 100644
--- a/core/helpers/theme.php
+++ b/core/helpers/theme.php
@@ -39,7 +39,8 @@ class theme_Core {
}
public static function get_edit_form_admin($theme) {
- $form = new Forge("admin/themes/edit/{$theme->id}/bogus");
+ $form = new Forge("admin/themes/edit/{$theme->id}",
+ '', null, array("id" =>"gThemeDetailsForm"));
$group = $form->group("edit_theme")->label($theme->description);
$group->input("page_size")->label(t("Items per page"))->id("gPageSize")->
value(self::_get_var($theme->id, "page_size", 90));
diff --git a/core/views/admin_themes.html.php b/core/views/admin_themes.html.php
index fffd23da..64df7608 100644
--- a/core/views/admin_themes.html.php
+++ b/core/views/admin_themes.html.php
@@ -75,5 +75,6 @@
</form>
</div>
<div id="gThemeDetails">
+ <p id="gMessage"></p>
<?= $themes[$active]->details ?>
</div>
diff --git a/themes/admin_default/js/ui.init.js b/themes/admin_default/js/ui.init.js
index 8e9da933..95d516fe 100644
--- a/themes/admin_default/js/ui.init.js
+++ b/themes/admin_default/js/ui.init.js
@@ -28,6 +28,16 @@ $(document).ready(function(){
});
$("#gThemeTabs > ul").tabs({ select: updateThemeDetails });
+
+ $("#gThemeDetailsForm").ajaxForm( {
+ dataType: "json",
+ success: function(body, result, set) {
+ if (body.result == "success") {
+ $("#gMessage").append("<span class='gSuccess'>" + body.message + "</span>");
+ } else {
+ $("#gMessage").append("<span class='gError'>" + body.message + "</span>");
+ }
+ }});
});
function updateThemeDetails(evt, ui) {