diff --git a/admin/components.php b/admin/components.php index 8e841dc67..cb8384317 100644 --- a/admin/components.php +++ b/admin/components.php @@ -73,7 +73,6 @@ exec_action('component-save'); // @hook component-save before saving components data file XMLsave($xml, GSDATAOTHERPATH.GSCOMPONENTSFILE); $update = 'comp-success'; - // redirect('components.php?upd=comp-success'); get_components_xml(true); } @@ -82,9 +81,9 @@ # perform the undo restore_datafile(GSDATAOTHERPATH.GSCOMPONENTSFILE); - $update = 'comp-restored'; check_for_csrf("undo"); - // redirect('components.php?upd=comp-restored'); + if(!requestIsAjax()) redirect('components.php?upd=comp-restored'); // redirect to prevent refresh undos + $update = 'comp-restored'; get_components_xml(true); } diff --git a/admin/inc/common.php b/admin/inc/common.php index 021ede1bd..9357a5f35 100644 --- a/admin/inc/common.php +++ b/admin/inc/common.php @@ -88,7 +88,7 @@ 'GSEDITORTOOL' => 'basic', // (str) wysiwyg editor toobar 'GSEDITORCONFIGFILE' => 'config.js', // (str) wysiwyg editor toobar 'GSEMAILLINKBACK' => 'http://get-simple.info/', // (str) url used in email template - 'GSAJAXSAVE' => false, // (bool) use ajax for saving themes, components, and pages + 'GSAJAXSAVE' => true, // (bool) use ajax for saving themes, components, and pages 'GSCHMOD' => 0644, // (octal) chmod mode legacy 'GSCHMODFILE' => 0644, // (octal) chmod mode for files 'GSCHMODDIR' => 0755, // (octal) chmod mode for dirs diff --git a/admin/snippets.php b/admin/snippets.php index cd792ac15..90f72f79e 100644 --- a/admin/snippets.php +++ b/admin/snippets.php @@ -72,8 +72,8 @@ } exec_action('snippet-save'); // @hook component-save before saving components data file XMLsave($xml, GSDATAOTHERPATH.GSSNIPPETSFILE); + $update = 'snippet-success'; - // redirect('components.php?upd=comp-success'); get_snippets_xml(true); } @@ -82,9 +82,9 @@ # perform the undo restore_datafile(GSDATAOTHERPATH.GSSNIPPETSFILE); - $update = 'snippet-restored'; check_for_csrf("undo"); - // redirect('components.php?upd=comp-restored'); // @todo fix redirect is necessary so you cant refresh undo links + if(!requestIsAjax()) redirect('snippets.php?upd=comp-restored'); // redirect to prevent refresh undos + $update = 'snippet-restored'; get_snippets_xml(true); } diff --git a/theme/Cardinal/template.php b/theme/Cardinal/template.php index de28d0eb4..23b81bc07 100644 --- a/theme/Cardinal/template.php +++ b/theme/Cardinal/template.php @@ -45,7 +45,8 @@