diff options
author | dchill42 <dchill42@gmail.com> | 2012-07-31 15:41:01 +0200 |
---|---|---|
committer | dchill42 <dchill42@gmail.com> | 2012-07-31 15:41:01 +0200 |
commit | 7e92b7332ea4d28648e69eabcb93cead35dbca26 (patch) | |
tree | b7714536b89557129ed51fe675725fe28639c1e0 /system/helpers/url_helper.php | |
parent | 57486009573a86d9e286a49c92216ba17aae0d5a (diff) | |
parent | 3a2d573a96241c01124d15c1ce517078e07c6235 (diff) |
Merge branch 'develop' of github.com:/EllisLab/CodeIgniter into session
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 |