Index: branches/5.0.x/core/admin_templates/browser/browser_header.tpl =================================================================== diff -u -r12230 -r12320 --- branches/5.0.x/core/admin_templates/browser/browser_header.tpl (.../browser_header.tpl) (revision 12230) +++ branches/5.0.x/core/admin_templates/browser/browser_header.tpl (.../browser_header.tpl) (revision 12320) @@ -25,7 +25,8 @@ Index: branches/5.0.x/core/admin_templates/incs/close_popup.tpl =================================================================== diff -u -r12117 -r12320 --- branches/5.0.x/core/admin_templates/incs/close_popup.tpl (.../close_popup.tpl) (revision 12117) +++ branches/5.0.x/core/admin_templates/incs/close_popup.tpl (.../close_popup.tpl) (revision 12320) @@ -7,7 +7,7 @@ var $is_debug = truefalse; var $use_popups = truefalse; var $redirect_url = ''; - var $modal_windows = truefalse; + var $modal_windows = truefalse; if ($is_debug) { document.write('' + $redirect_url.replace('%5C', '\\') + ''); Index: branches/5.0.x/core/admin_templates/popups/editor.tpl =================================================================== diff -u -r12117 -r12320 --- branches/5.0.x/core/admin_templates/popups/editor.tpl (.../editor.tpl) (revision 12117) +++ branches/5.0.x/core/admin_templates/popups/editor.tpl (.../editor.tpl) (revision 12320) @@ -74,7 +74,11 @@
- + + + + + - +

Index: branches/5.0.x/core/admin_templates/categories/edit_content.tpl =================================================================== diff -u -r12117 -r12320 --- branches/5.0.x/core/admin_templates/categories/edit_content.tpl (.../edit_content.tpl) (revision 12117) +++ branches/5.0.x/core/admin_templates/categories/edit_content.tpl (.../edit_content.tpl) (revision 12320) @@ -55,7 +55,11 @@
- + + + + + - +

Index: branches/5.0.x/core/kernel/languages/phrases_cache.php =================================================================== diff -u -r12299 -r12320 --- branches/5.0.x/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 12299) +++ branches/5.0.x/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 12320) @@ -1,6 +1,6 @@ _phraseEditTemplate = 'regional/phrases_edit'; - $this->_usePopups = $this->Application->ConfigValue('UsePopups'); } /** @@ -222,23 +214,7 @@ if ($this->_editExisting && $allow_editing) { // option to change translation for Labels - if ($this->_usePopups) { - // link to popup when using popups (only in admin) - $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnPrepareUpdate\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});'; - } - else { - // direct link, when not using popups OR on frontend - $url_params = Array( - 'm_opener' => 'd', - 'phrases_label' => $original_label, - 'phrases_event' => 'OnPrepareUpdate', - 'simple_mode' => $this->_simpleEditingMode ? 1 : 0, - 'pass' => 'all,phrases' - ); - - $edit_url = $this->Application->HREF($this->_phraseEditTemplate, '', $url_params, 'index.php'); - } - + $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnPrepareUpdate\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});'; $translated_label = '<' . $this->_translateHtmlTag . ' href="' . $edit_url . '" name="cms-translate-phrase" title="Edit translation">' . $translated_label . '_translateHtmlTag . '>'; if ($this->fromTag) { @@ -265,23 +241,7 @@ $translation = '!' . $label . '!'; if ($this->_editMissing && $allow_editing) { - if ($this->_usePopups) { - // link to popup when using popups (only in admin) - $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnNew\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});'; - } - else { - // direct link, when not using popups OR on frontend - $url_params = Array ( - 'm_opener' => 'd', - 'phrases_label' => $original_label, - 'phrases_event' => 'OnNew', - 'simple_mode' => $this->_simpleEditingMode ? 1 : 0, - 'pass' => 'all,phrases' - ); - - $edit_url = $this->Application->HREF($this->_phraseEditTemplate, '', $url_params, 'index.php'); - } - + $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnNew\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});'; $translation = '<' . $this->_translateHtmlTag . ' href="' . $edit_url . '" class="cms-translate-phrase" title="Translate">!' . $label . '!_translateHtmlTag . '>'; if ($this->fromTag) { Index: branches/5.0.x/core/install/install_data.sql =================================================================== diff -u -r12277 -r12320 --- branches/5.0.x/core/install/install_data.sql (.../install_data.sql) (revision 12277) +++ branches/5.0.x/core/install/install_data.sql (.../install_data.sql) (revision 12320) @@ -103,8 +103,8 @@ INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseSmallHeader', '0', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('UseColumnFreezer', 'la_section_SettingsAdmin', 'la_config_UseColumnFreezer', 'checkbox', '', '', 40.04, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseColumnFreezer', '0', 'In-Portal', 'in-portal:configure_advanced'); -INSERT INTO ConfigurationAdmin VALUES ('UsePopups', 'la_section_SettingsAdmin', 'la_config_UsePopups', 'radio', '', '1=la_Yes,0=la_No', 40.05, 0, 0); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UsePopups', '1', 'In-Portal', 'in-portal:configure_advanced'); +INSERT INTO ConfigurationAdmin VALUES ('UsePopups', 'la_section_SettingsAdmin', 'la_config_UsePopups', 'select', '', '0=la_opt_SameWindow,1=la_opt_PopupWindow,2=la_opt_ModalWindow', 40.05, 0, 0); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UsePopups', '2', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('UseDoubleSorting', 'la_section_SettingsAdmin', 'la_config_UseDoubleSorting', 'radio', '', '1=la_Yes,0=la_No', 40.06, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseDoubleSorting', '0', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('MenuFrameWidth', 'la_section_SettingsAdmin', 'la_prompt_MenuFrameWidth', 'text', NULL, NULL, 40.07, 0, 0); @@ -115,8 +115,6 @@ 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.10, 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.11, 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/5.0.x/core/admin_templates/incs/header.tpl =================================================================== diff -u -r12117 -r12320 --- branches/5.0.x/core/admin_templates/incs/header.tpl (.../header.tpl) (revision 12117) +++ branches/5.0.x/core/admin_templates/incs/header.tpl (.../header.tpl) (revision 12320) @@ -50,7 +50,8 @@ TB.pathToImage = 'js/jquery/thickbox/loadingAnimation.gif'; var t = ''; var popups = '1'; -var $modal_windows = truefalse; +var $use_popups = truefalse; +var $modal_windows = truefalse; var multiple_windows = '1'; var main_title = ''; var tpl_changed = 0; @@ -75,7 +76,6 @@ } -var $use_popups = truefalse; var $use_toolbarlabels = truefalse; Index: branches/5.0.x/core/install/upgrades.sql =================================================================== diff -u -r12277 -r12320 --- branches/5.0.x/core/install/upgrades.sql (.../upgrades.sql) (revision 12277) +++ branches/5.0.x/core/install/upgrades.sql (.../upgrades.sql) (revision 12320) @@ -1444,4 +1444,11 @@ INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseTemplateCompression', '0', 'In-Portal', 'in-portal:configure_advanced'); UPDATE ConfigurationAdmin SET DisplayOrder = DisplayOrder + 0.01 WHERE VariableName IN ('TrimRequiredFields', 'UseCronForRegularEvent', 'UseChangeLog', 'Backup_Path', 'SystemTagCache', 'SocketBlockingMode'); +DELETE FROM ConfigurationAdmin WHERE VariableName = 'UseModalWindows'; +DELETE FROM ConfigurationValues WHERE VariableName = 'UseModalWindows'; +DELETE FROM Phrase WHERE Phrase = 'la_config_UseModalWindows'; + +UPDATE ConfigurationAdmin SET element_type = 'select', ValueList = '0=la_opt_SameWindow,1=la_opt_PopupWindow,2=la_opt_ModalWindow' WHERE VariableName = 'UsePopups'; +UPDATE Phrase SET Translation = 'Editing Window Style' WHERE Phrase = 'la_config_UsePopups'; + UPDATE Modules SET Version = '5.0.1', Loaded = 1 WHERE Name = 'In-Portal'; \ No newline at end of file Index: branches/5.0.x/core/admin_templates/js/script.js =================================================================== diff -u -r12298 -r12320 --- branches/5.0.x/core/admin_templates/js/script.js (.../script.js) (revision 12298) +++ branches/5.0.x/core/admin_templates/js/script.js (.../script.js) (revision 12320) @@ -23,8 +23,12 @@ replaceFireBug(); } -function use_popups($prefix_special, $event) { - return $use_popups; +function use_popups($prefix_special, $event, $mode) { + if ($mode === undefined || $mode == 'popup') { + return $use_popups; + } + + return $modal_windows; } function getArrayValue() @@ -538,14 +542,37 @@ ); } -function translate_phrase($label, $template, $options) { +function translate_phrase($label, $edit_template, $options) { set_hidden_field('phrases_label', $label); + var $event = $options.event === undefined ? 'OnNew' : $options.event; if ($options.simple_mode !== undefined) { - set_hidden_field('simple_mode', $options.simple_mode ? 1 : 0); + Application.SetVar('simple_mode', $options.simple_mode ? 1 : 0); + + if ($options.simple_mode) { + Application.SetVar('front', 1); + } } + else { + Application.SetVar('front', null); + Application.SetVar('simple_mode', null); + Application.SetVar('phrases_label', null); + } - open_popup('phrases', $options.event === undefined ? 'OnNew' : $options.event, $template); + if (use_popups('phrases', $event)) { + open_popup('phrases', $event, $edit_template, null, function() { + Application.SetVar('front', null); + Application.SetVar('simple_mode', null); + }); + } + else { + opener_action('d'); + submit_event('phrases', $event, $edit_template); + + Application.SetVar('front', null); + Application.SetVar('simple_mode', null); + Application.SetVar('phrases_label', null); + } } function direct_edit($prefix_special, $url) { Index: branches/5.0.x/core/units/categories/categories_tag_processor.php =================================================================== diff -u -r12298 -r12320 --- branches/5.0.x/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 12298) +++ branches/5.0.x/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 12320) @@ -1,6 +1,6 @@ Application->HREF('categories/edit_content', ADMIN_DIRECTORY, $url_params, 'index.php'); $edit_code_before = '
-
+
@@ -1353,7 +1353,7 @@ $template = $this->Application->GetVar('t'); $theme_id = $this->Application->GetVar('m_theme'); - $url_params = Array ('block' => '#BLOCK#', 'theme-file_event' => '#EVENT#', 'theme_id' => $theme_id, 'source' => $template, 'pass' => 'all,theme-file', 'front' => 1, 'no_amp' => 1); + $url_params = Array ('block' => '#BLOCK#', 'theme-file_event' => '#EVENT#', 'theme_id' => $theme_id, 'source' => $template, 'pass' => 'all,theme-file', 'front' => 1, 'm_opener' => 'd', 'no_amp' => 1); $edit_template_url = $this->Application->HREF('themes/template_edit', ADMIN_DIRECTORY, $url_params, 'index.php'); $url_params = Array ('theme-file_event' => 'OnSaveLayout', 'source' => $template, 'pass' => 'all,theme-file', 'no_amp' => 1); @@ -1363,7 +1363,10 @@ $ret .= "var aTemplateManager = new TemplateManager('" . $edit_template_url . "', '" . $this_url . "', '" . $save_layout_url . "', " . (int)EDITING_MODE . ");\n"; if (EDITING_MODE != EDITING_MODE_BROWSE) { - $ret .= "var \$modal_windows = " . ($this->Application->ConfigValue('UseModalWindows') ? 'true' : 'false') . ";\n"; + $use_popups = (int)$this->Application->ConfigValue('UsePopups'); + + $ret .= "var \$use_popups = " . ($use_popups > 0 ? 'true' : 'false') . ";\n"; + $ret .= "var \$modal_windows = " . ($use_popups == 2 ? '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"; @@ -1439,10 +1442,10 @@ 'index_file' => 'index.php', ); - $edit_url = $this->Application->HREF('categories/categories_edit', '/admin', $url_params); + $edit_url = $this->Application->HREF('categories/categories_edit', ADMIN_DIRECTORY, $url_params); $edit_btn .= ' -
+
@@ -1463,7 +1466,7 @@ 'index_file' => 'index.php', ); - $edit_url = $this->Application->HREF('themes/file_edit', '/admin', $url_params); + $edit_url = $this->Application->HREF('themes/file_edit', ADMIN_DIRECTORY, $url_params); $edit_btn .= '
@@ -1481,7 +1484,7 @@
-
+
Index: branches/5.0.x/core/units/admin/admin_tag_processor.php =================================================================== diff -u -r12299 -r12320 --- branches/5.0.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 12299) +++ branches/5.0.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 12320) @@ -1,6 +1,6 @@ Application->ConfigValue('UsePopups') || $this->Application->GetVar('_force_popup'); + if ($this->Application->GetVar('_force_popup')) { + return true; + } + + $use_popups = (int)$this->Application->ConfigValue('UsePopups'); + + if (array_key_exists('mode', $params)) { + $mode_mapping = Array ('popup' => 1, 'modal' => 2); + return $use_popups == $mode_mapping[ $params['mode'] ]; + } + + return $use_popups; } function UseToolbarLabels($params) Index: branches/5.0.x/core/admin_templates/js/forms.js =================================================================== diff -u -r12117 -r12320 --- branches/5.0.x/core/admin_templates/js/forms.js (.../forms.js) (revision 12117) +++ branches/5.0.x/core/admin_templates/js/forms.js (.../forms.js) (revision 12320) @@ -62,8 +62,8 @@ // process all FCKEditor instances var iframes = document.getElementsByTagName('IFRAME'); - for (var i=0; i', function() { - window_close(); // submit_event('theme-file', 'OnGoBack'); + a_toolbar.AddButton( + new ToolBarButton( + 'cancel', + '', + function() { + + window_close(); + + submit_event('theme-file', 'OnGoBack'); + } - ) ); + ) + ); a_toolbar.Render(); @@ -39,7 +48,13 @@ - + + + + + + +