From 81c3208b79cca353b27ecd4bdf00d4b6e7c91b2c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 16 Jun 2012 21:21:46 +0300 Subject: anchor_popup() improvements --- system/helpers/url_helper.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'system') diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 58bde17b4..40ce807df 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -199,15 +199,23 @@ if ( ! function_exists('anchor_popup')) if ($attributes === FALSE) { - return '".$title.''; + return '".$title.''; } if ( ! is_array($attributes)) { $attributes = array($attributes); + + // Ref: http://www.w3schools.com/jsref/met_win_open.asp + $window_name = '_blank'; + } + elseif ( ! empty($attributes['window_name'])) + { + $window_name = $attributes['window_name']; + unset($attributes['window_name']); } - foreach (array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0', ) as $key => $val) + foreach (array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0') as $key => $val) { $atts[$key] = isset($attributes[$key]) ? $attributes[$key] : $val; unset($attributes[$key]); @@ -215,7 +223,9 @@ if ( ! function_exists('anchor_popup')) $attributes = empty($attributes) ? '' : _parse_attributes($attributes); - return ''.$title.''; + return ''.$title.''; } } -- cgit v1.2.3-24-g4f1b