diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-26 01:15:59 -0500 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-26 01:15:59 -0500 |
commit | eaa44dcd0938ad48f4a9f863b24ca5d3a318ae10 (patch) | |
tree | 71d577e01200b3a143971a3a23d8f6b7cdf545fe /lib/ui.lib.php | |
parent | 42133f38d223a2b3b81d309f2d1a983ef2012485 (diff) | |
download | ampache-eaa44dcd0938ad48f4a9f863b24ca5d3a318ae10.tar.gz ampache-eaa44dcd0938ad48f4a9f863b24ca5d3a318ae10.tar.bz2 ampache-eaa44dcd0938ad48f4a9f863b24ca5d3a318ae10.zip |
Continue moving things into UI
check_php_iconv() from lib/debug.lib.php becomes UI::check_iconv()
truncate_with_ellipsis() from lib/ui.lib.php becomes UI::truncate()
Diffstat (limited to 'lib/ui.lib.php')
-rw-r--r-- | lib/ui.lib.php | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/ui.lib.php b/lib/ui.lib.php index f767c55b..72b87f45 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -75,40 +75,6 @@ function return_referer() { } // return_referer /** - * truncate_with_ellipsis - * Function that truncates text to a specific length and appends an ellipsis to - * the end. - */ -function truncate_with_ellipsis($text, $max='') { - - $max = $max ? $max : '27'; - - /* If they want it to be shorter than three, just throw it back */ - if ($max <= 3) { - return $text; - } - - /* Make sure the functions exist before doing the iconv mojo */ - if (function_exists('iconv') && - function_exists('iconv_substr') && - function_exists('iconv_strlen')) { - $charset = Config::get('site_charset'); - if (iconv_strlen($text, $charset) > $max) { - $text = iconv_substr($text, 0, $max-3, $charset); - $text .= iconv("ISO-8859-1", $charset, "..."); - } - } - else { // Use normal substr if we don't have iconv - if (strlen($text) > $max) { - $text = substr($text,0,$max-3)."..."; - } - } // else no iconv - - return $text; - -} // truncate_with_ellipsis - -/** * show_header * This shows the header.inc.php, it may do something * more in the future |