Index: branches/RC/core/units/admin/admin_tag_processor.php =================================================================== diff -u -N -r11661 -r11665 --- branches/RC/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 11661) +++ branches/RC/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 11665) @@ -1083,6 +1083,28 @@ return $ret; } + + /** + * Checks, that new window should be opened in "incs/close_popup" template instead of refreshing parent window + * + * @param Array $params + * @return bool + */ + function OpenNewWindow($params) + { + if (!$this->UsePopups($params)) { + return false; + } + + $diff = array_key_exists('diff', $params) ? $params['diff'] : 0; + $wid = $this->Application->GetVar('m_wid'); + + $stack_name = rtrim('opener_stack_' . $wid, '_'); + $opener_stack = $this->Application->RecallVar($stack_name); + $opener_stack = $opener_stack ? unserialize($opener_stack) : Array (); + + return count($opener_stack) >= 2 - $diff; + } } ?> \ No newline at end of file