diff options
author | Eric Roberts <eric@cryode.com> | 2012-08-03 22:39:04 +0200 |
---|---|---|
committer | Eric Roberts <eric@cryode.com> | 2012-08-03 22:39:04 +0200 |
commit | 17636e8bb20a4d53fec8fd8aaf530f53bd22d612 (patch) | |
tree | a844b9aff5ecb42ce2c49ea4e187ef44cc4d39a8 /system/helpers/url_helper.php | |
parent | da038d2ebccb4d45ea6d819c914563b2bc009a86 (diff) | |
parent | 6c94c2dcfb6557947c9ac67e419b2856fd80e01d (diff) |
Merge branch 'develop' of https://github.com/EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/helpers/url_helper.php')
-rw-r--r-- | system/helpers/url_helper.php | 50 |
1 files changed, 4 insertions, 46 deletions
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 39e6343a6..57208c948 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -165,7 +165,7 @@ if ( ! function_exists('anchor')) if ($attributes !== '') { - $attributes = _parse_attributes($attributes); + $attributes = _stringify_attributes($attributes); } return '<a href="'.$site_url.'"'.$attributes.'>'.$title.'</a>'; @@ -221,10 +221,10 @@ if ( ! function_exists('anchor_popup')) unset($attributes[$key]); } - $attributes = empty($attributes) ? '' : _parse_attributes($attributes); + $attributes = _stringify_attributes($attributes); return '<a href="'.$site_url - .'" onclick="window.open(\''.$site_url."', '".$window_name."', '"._parse_attributes($atts, TRUE)."'); return false;\"" + .'" onclick="window.open(\''.$site_url."', '".$window_name."', '"._stringify_attributes($atts, TRUE)."'); return false;\"" .$attributes.'>'.$title.'</a>'; } } @@ -250,7 +250,7 @@ if ( ! function_exists('mailto')) $title = $email; } - return '<a href="mailto:'.$email.'"'._parse_attributes($attributes).'>'.$title.'</a>'; + return '<a href="mailto:'.$email.'"'._stringify_attributes($attributes).'>'.$title.'</a>'; } } @@ -560,47 +560,5 @@ if ( ! function_exists('redirect')) } } -// ------------------------------------------------------------------------ - -if ( ! function_exists('_parse_attributes')) -{ - /** - * Parse out the attributes - * - * Some of the functions use this - * - * @param array - * @param bool - * @return string - */ - function _parse_attributes($attributes, $javascript = FALSE) - { - if (is_string($attributes)) - { - return ($attributes !== '') ? ' '.$attributes : ''; - } - - $att = ''; - foreach ($attributes as $key => $val) - { - if ($javascript === TRUE) - { - $att .= $key.'='.$val.','; - } - else - { - $att .= ' '.$key.'="'.$val.'"'; - } - } - - if ($javascript === TRUE && $att !== '') - { - return substr($att, 0, -1); - } - - return $att; - } -} - /* End of file url_helper.php */ /* Location: ./system/helpers/url_helper.php */
\ No newline at end of file |