Index: branches/5.1.x/core/admin_templates/js/script.js =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/js/script.js (.../script.js) (revision 12127) +++ branches/5.1.x/core/admin_templates/js/script.js (.../script.js) (revision 12657) @@ -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,9 +542,37 @@ ); } -function translate_phrase($label, $template) { +function translate_phrase($label, $edit_template, $options) { set_hidden_field('phrases_label', $label); - open_popup('phrases', 'OnNew', $template); + var $event = $options.event === undefined ? 'OnNew' : $options.event; + + if ($options.simple_mode !== undefined) { + 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); + } + + 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) { @@ -850,7 +882,7 @@ $window.top.document.title = (main_title.length ? main_title + ' - ' : '') + $title; if ($modal_windows) { - $window.TB.setWindowTitle($title); + $window.TB.setWindowTitle(''); } }