Index: branches/RC/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r11919 -r11931 --- branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11919) +++ branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11931) @@ -1,6 +1,6 @@ Application->HREF('', '', Array ('editing_mode' => '#EDITING_MODE#', 'no_amp' => 1)); $ret .= "var aTemplateManager = new TemplateManager('" . $edit_template_url . "', '" . $this_url . "', " . (int)EDITING_MODE . ");\n"; + $ret .= "var \$modal_windows = " . ($this->Application->ConfigValue('UseModalWindows') ? 'true' : 'false') . ";\n"; $ret .= "var main_title = '" . addslashes( $this->Application->ConfigValue('Site_Name') ) . "';" . "\n"; $ret .= "var base_url = '" . $this->Application->BaseURL() . "';" . "\n"; $ret .= 'TB.closeHtml = \'close
\';' . "\n"; Index: branches/RC/core/install/upgrades.sql =================================================================== diff -u -N -r11885 -r11931 --- branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 11885) +++ branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 11931) @@ -1348,5 +1348,8 @@ DELETE FROM Phrase WHERE Phrase IN ('la_title_Adding_Page', 'la_title_Editing_Page', 'la_title_New_Page', 'la_fld_PageId'); +INSERT INTO ConfigurationAdmin VALUES ('UseModalWindows', 'la_section_SettingsAdmin', 'la_config_UseModalWindows', 'checkbox', '', '', 40.10, 0, 0); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseModalWindows', '1', 'In-Portal', 'in-portal:configure_advanced'); + DELETE FROM Modules WHERE Name = 'Proj-Base'; UPDATE Modules SET Version = '5.0.0', Loaded = 1 WHERE Name = 'In-Portal'; \ No newline at end of file Index: branches/RC/core/admin_templates/js/script.js =================================================================== diff -u -N -r11930 -r11931 --- branches/RC/core/admin_templates/js/script.js (.../script.js) (revision 11930) +++ branches/RC/core/admin_templates/js/script.js (.../script.js) (revision 11931) @@ -255,28 +255,28 @@ var $window_name = 'select_' + t.replace(/(\/|-)/g, '_'); var $options = { - onAfterShow: function () { - getFrame('main').initTranslatorOnAfterShow(prefix, field, t, multi_line, $before_callback); + onAfterShow: function ($popup_window) { + if ($modal_windows) { + getFrame('main').initTranslatorOnAfterShow(prefix, field, t, multi_line, $before_callback); + } + else { + initTranslatorOnAfterShow(prefix, field, t, multi_line, $before_callback, $popup_window); + } } }; openwin('', $window_name, 750, 400, $options); } -function initTranslatorOnAfterShow(prefix, field, t, multi_line, $before_callback) { - var $popup_window = $('#' + TB.getId('TB_iframeContent')).get(0).contentWindow; +function initTranslatorOnAfterShow(prefix, field, t, multi_line, $before_callback, $popup_window) { + var $window_name = 'select_' + t.replace(/(\/|-)/g, '_'); - if (!$.isFunction($popup_window.onLoad)) { + $popup_window = onAfterWindowOpen($window_name, undefined, $popup_window); + if ($popup_window === false) { // iframe onload happens on frame content change too -> don't react on it return ; } - var $window_name = 'select_' + t.replace(/(\/|-)/g, '_'); - - $popup_window.onLoad(); - $popup_window.name = $window_name; - TB.setWindowMetaData('window_name', $window_name); // used to simulate window.opener functionality - var $opener = getWindowOpener($popup_window); var $prev_opener = get_hidden_field('m_opener'); @@ -335,49 +335,70 @@ var $settings = { url: base_url + 'core/admin_templates/blank.html?width=' + $width + '&height=' + $height + '&TB_iframe=true&modal=true', caption: 'Loading ...', - onAfterShow: function () { - getFrame('main').onAfterWindowOpen($url, $name); + onAfterShow: function ($popup_window) { + if ($modal_windows) { + getFrame('main').onAfterWindowOpen($name, $url); + } + else { + onAfterWindowOpen($name, $url, $popup_window); + } } }; if ($options !== undefined) { $.extend($settings, $options); } - if (window.name != 'main') { - // all popups are opened based on main frame - return getFrame('main').TB.show($settings); - } + if ($modal_windows) { + if (window.name != 'main') { + // all popups are opened based on main frame + return getFrame('main').TB.show($settings); + } - TB.show($settings); + TB.show($settings); - return ; + return ; + } // prevent window from opening larger, then screen resolution on user's computer (to Kostja) + var left = Math.round((screen.width - $width) / 2); + var top = Math.round((screen.height - $height) / 2); + var cur_x = document.all ? window.screenLeft : window.screenX; + var cur_y = document.all ? window.screenTop : window.screenY; - var left = Math.round((screen.width - $width)/2); - var top = Math.round((screen.height - $height)/2); + var $window_params = 'left='+left+',top='+top+',width='+$width+',height='+$height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no'; + var $popup_window = window.open($url, $name, $window_params); - cur_x = is.ie ? window.screenLeft : window.screenX; - cur_y = is.ie ? window.screenTop : window.screenY; + if ( $.isFunction($settings.onAfterShow) ) { + $settings.onAfterShow($popup_window); + } - var $window_params = 'left='+left+',top='+top+',width='+$width+',height='+$height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no'; - return window.open($url,$name,$window_params); + return $popup_window; } -function onAfterWindowOpen($url, $window_name) { +function onAfterWindowOpen($window_name, $url, $popup_window) { // this is always invoked from "main" frame - var $popup_window = $('#' + TB.getId('TB_iframeContent')).get(0).contentWindow; - if (!$.isFunction($popup_window.onLoad)) { - // iframe onload happens on frame content change too -> don't react on it - return ; + if ($popup_window === undefined) { + var $popup_window = $('#' + TB.getId('TB_iframeContent')).get(0).contentWindow; + if (!$.isFunction($popup_window.onLoad)) { + // iframe onload happens on frame content change too -> don't react on it + return false; + } + + $popup_window.onLoad(); } - $popup_window.onLoad(); $popup_window.name = $window_name; - $popup_window.location.href = $url; - TB.setWindowMetaData('window_name', $window_name); // used to simulate window.opener functionality + if ($url !== undefined) { + $popup_window.location.href = $url; + } + + if ($modal_windows) { + TB.setWindowMetaData('window_name', $window_name); // used to simulate window.opener functionality + } + + return $popup_window; } function OnResizePopup(e) { @@ -427,32 +448,34 @@ var $window_name = $t.replace(/(\/|-)/g, '_'); // replace "/" and "-" with "_" var $options = { - onAfterShow: function () { - getFrame('main').onAfterOpenPopup($prefix_special, $event, $t); + onAfterShow: function ($popup_window) { + if ($modal_windows) { + getFrame('main').onAfterOpenPopup($prefix_special, $event, $t); + } + else { + onAfterOpenPopup($prefix_special, $event, $t, $popup_window); + } + if ($onAfterOpenPopup !== undefined && $.isFunction($onAfterOpenPopup)) { - $onAfterOpenPopup(); + $onAfterOpenPopup($popup_window); } } }; openwin('', $window_name, $window_size[0], $window_size[1], $options); } -function onAfterOpenPopup($prefix_special, $event, $t) { +function onAfterOpenPopup($prefix_special, $event, $t, $popup_window) { // this is always invoked from "main" frame - var $popup_window = $('#' + TB.getId('TB_iframeContent')).get(0).contentWindow; - if (!$.isFunction($popup_window.onLoad)) { + var $window_name = $t.replace(/(\/|-)/g, '_'); // replace "/" and "-" with "_" + + $popup_window = onAfterWindowOpen($window_name, undefined, $popup_window); + if ($popup_window === false) { // iframe onload happens on frame content change too -> don't react on it return ; } - var $window_name = $t.replace(/(\/|-)/g, '_'); // replace "/" and "-" with "_" - - $popup_window.onLoad(); - $popup_window.name = $window_name; - TB.setWindowMetaData('window_name', $window_name); // used to simulate window.opener functionality - var $opener = getWindowOpener($popup_window); if ($opener === null) { // we are already in main window @@ -825,7 +848,10 @@ } $window.top.document.title = (main_title.length ? main_title + ' - ' : '') + $title; - $window.TB.setWindowTitle($title); + + if ($modal_windows) { + $window.TB.setWindowTitle($title); + } } function set_filter($prefix_special, $filter_id, $filter_value, $ajax) @@ -1687,6 +1713,10 @@ function getWindowOpener($window) { // use this intead of "window.opener" + if (!$modal_windows) { + return $window.opener; + } + if ($window.name == 'main' || $window.name == 'main_frame') { return null; } @@ -1696,6 +1726,16 @@ function window_close($close_callback) { // use this instead of "window.close();" + if (!$modal_windows) { + if ($.isFunction($close_callback)) { + // use close callback, because iframe will be removed later in this method + $close_callback(); + } + + window.close(); + return ; + } + if (window.name == 'main') { return ; } Index: branches/RC/core/install/english.lang =================================================================== diff -u -N -r11885 -r11931 --- branches/RC/core/install/english.lang (.../english.lang) (revision 11885) +++ branches/RC/core/install/english.lang (.../english.lang) (revision 11931) @@ -271,6 +271,7 @@ VHJhY2sgZGF0YWJhc2UgY2hhbmdlcyB0byBjaGFuZ2UgbG9n VXNlIENvbHVtbiBGcmVlemVy VXNlIERvdWJsZSBTb3J0aW5n + VXNlIE1vZGFsIFdpbmRvd3MgZm9yIEVkaXRpbmc= RW5hYmxlIEhUTUwgR1pJUCBjb21wcmVzc2lvbg== VXNlIFBhZ2VIaXQgY291bnRlcg== VXNlIFBvcHVwcyBmb3IgRWRpdGluZw== Index: branches/RC/core/install/install_data.sql =================================================================== diff -u -N -r11749 -r11931 --- branches/RC/core/install/install_data.sql (.../install_data.sql) (revision 11749) +++ branches/RC/core/install/install_data.sql (.../install_data.sql) (revision 11931) @@ -112,6 +112,8 @@ INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AutoRefreshIntervals', '1,5,15,30,60,120,240', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('DebugOnlyFormConfigurator', 'la_section_SettingsAdmin', 'la_config_DebugOnlyFormConfigurator', 'checkbox', '', '', 40.09, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'DebugOnlyFormConfigurator', '0', 'In-Portal', 'in-portal:configure_advanced'); +INSERT INTO ConfigurationAdmin VALUES ('UseModalWindows', 'la_section_SettingsAdmin', 'la_config_UseModalWindows', 'checkbox', '', '', 40.10, 0, 0); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseModalWindows', '1', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('Smtp_Server', 'la_section_SettingsMailling', 'la_prompt_mailserver', 'text', NULL, NULL, 50.01, 0, 1); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Smtp_Server', DEFAULT, 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('Smtp_Port', 'la_section_SettingsMailling', 'la_prompt_mailport', 'text', NULL, NULL, 50.02, 0, 1); Index: branches/RC/core/admin_templates/incs/close_popup.tpl =================================================================== diff -u -N -r11665 -r11931 --- branches/RC/core/admin_templates/incs/close_popup.tpl (.../close_popup.tpl) (revision 11665) +++ branches/RC/core/admin_templates/incs/close_popup.tpl (.../close_popup.tpl) (revision 11931) @@ -7,6 +7,7 @@ var $is_debug = truefalse; var $use_popups = truefalse; var $redirect_url = ''; + var $modal_windows = truefalse; if ($is_debug) { document.write('' + $redirect_url.replace('%5C', '\\') + ''); @@ -98,8 +99,19 @@ return $main_window.parent; } + // copied locally, because won't work, when called via getFrame('main').window_close(...); function window_close($close_callback) { // use this instead of "window.close();" + if (!$modal_windows) { + if (getFrame('main').$.isFunction($close_callback)) { + // use close callback, because iframe will be removed later in this method + $close_callback(); + } + + window.close(); + return ; + } + if (window.name == 'main') { return ; } Index: branches/RC/core/admin_templates/incs/header.tpl =================================================================== diff -u -N -r11623 -r11931 --- branches/RC/core/admin_templates/incs/header.tpl (.../header.tpl) (revision 11623) +++ branches/RC/core/admin_templates/incs/header.tpl (.../header.tpl) (revision 11931) @@ -50,6 +50,7 @@ TB.pathToImage = 'js/jquery/thickbox/loadingAnimation.gif'; var t = ''; var popups = '1'; +var $modal_windows = truefalse; var multiple_windows = '1'; var main_title = ''; var tpl_changed = 0; @@ -67,7 +68,10 @@ if (!window.name.match(/_$/)) { window.name += '_'; // change window name only once per window - getFrame('main').TB.setWindowMetaData('window_name', window.name); // used to simulate window.opener functionality + + if ($modal_windows) { + getFrame('main').TB.setWindowMetaData('window_name', window.name); // used to simulate window.opener functionality + } }