Index: branches/RC/core/admin_templates/js/frame_resizer.js =================================================================== diff -u -r9238 -r9239 --- branches/RC/core/admin_templates/js/frame_resizer.js (.../frame_resizer.js) (revision 9238) +++ branches/RC/core/admin_templates/js/frame_resizer.js (.../frame_resizer.js) (revision 9239) @@ -1,16 +1,19 @@ -function FrameResizer($show_title, $hide_title, $frameset) { +function FrameResizer($show_title, $hide_title, $frameset, $save_url) { this.StatusIcon = {0: 'img/list_arrow_desc.gif', 1 : 'img/list_arrow_no.gif'}; this.StatusText = {0: $hide_title, 1 : $show_title}; - this.StatusImage = document.getElementById('menu_toggle'); + this.StatusImage = document.getElementById('menu_toggle_img'); + this.StatusLink = document.getElementById('menu_toggle_link'); this.Frameset = $frameset; - + this.SaveURL = $save_url; + this.SubFrameset = $frameset.document.getElementById('sub_frameset'); this.TopFrameset = $frameset.document.getElementById('top_frameset'); } FrameResizer.prototype.InitControls = function ($instance) { - this.StatusImage.onclick = function () { + this.StatusLink.onclick = function () { $instance.FrameToggle(); + return false; } } @@ -20,11 +23,29 @@ FrameResizer.prototype.SetStatus = function ($status) { this.StatusImage.src = this.StatusIcon[$status]; - this.StatusImage.alt = this.StatusText[$status]; - this.StatusImage.title = this.StatusText[$status]; + this.StatusImage.alt = this.StatusLink.title = this.StatusText[$status]; document.getElementById('site_logo').style.display = $status ? 'none' : 'block'; + + // save via ajax + var $url = this.SaveURL.replace('#NAME#', 'ShowAdminMenu').replace('#VALUE#', $status); + Request.makeRequest($url, false, '', this.successCallback, this.errorCallback, '', this); } +FrameResizer.prototype.successCallback = function($request, $params, $object) { + /*var $responce = $request.responseText; + var $match_redirect = new RegExp('^#redirect#(.*)').exec($responce); + if ($match_redirect != null) { + $object.showProgress(100); + // redirect to external template requested + window.location.href = $match_redirect[1]; + return false; + }*/ +} + +FrameResizer.prototype.errorCallback = function($request, $params, $object) { + alert('AJAX Error; class: FrameResizer; ' + Request.getErrorHtml($request)); +} + FrameResizer.prototype.FrameToggle = function () { if (this.MenuVisible()) { this.TopFrameset.setAttribute('rows', '25,*'); Index: branches/RC/core/units/admin/admin_events_handler.php =================================================================== diff -u -r8953 -r9239 --- branches/RC/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 8953) +++ branches/RC/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 9239) @@ -196,6 +196,25 @@ } /** + * Saves various admin settings via ajax + * + * @param kEvent $event + */ + function OnSaveSetting(&$event) + { + if ($this->Application->GetVar('ajax') != 'yes') { + return ; + } + + $var_name = $this->Application->GetVar('var_name'); + $var_value = $this->Application->GetVar('var_value'); + + $this->Application->StorePersistentVar($var_name, $var_value); + + $event->status = erSTOP; + } + + /** * Just closes popup & deletes last_template & opener_stack if popup, that is closing * * @param kEvent $event Index: branches/RC/core/admin_templates/index.tpl =================================================================== diff -u -r9238 -r9239 --- branches/RC/core/admin_templates/index.tpl (.../index.tpl) (revision 9238) +++ branches/RC/core/admin_templates/index.tpl (.../index.tpl) (revision 9239) @@ -16,17 +16,22 @@ " name="head" scrolling="no" noresize="noresize"> - + 2000,*" border="0"> " name="menu" target="main" noresize scrolling="auto" marginwidth="0" marginheight="0"> " name="main" marginwidth="0" marginheight="0" frameborder="no" noresize scrolling="auto">