diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-11-12 13:56:29 +0100 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-11-12 13:56:29 +0100 |
commit | 28671d92c02ec8a8636f45511f9bb79110b49d58 (patch) | |
tree | f06dfc359b781a349a0462c237dc37a7ac7e00d6 /lib/helper.php | |
parent | bb56581192e062e4c8ec2aa7c0874433760e7fa9 (diff) | |
download | nextcloud-server-28671d92c02ec8a8636f45511f9bb79110b49d58.tar.gz nextcloud-server-28671d92c02ec8a8636f45511f9bb79110b49d58.zip |
move code to better places
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/helper.php b/lib/helper.php index ccceb58cd4c..5a93e6533de 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -712,4 +712,14 @@ class OC_Helper { return false; } + + + public static function ellipsis($str, $maxlen) { + if (strlen($str) > $maxlen) { + $characters = floor($maxlen / 2); + return substr($str, 0, $characters) . '...' . substr($str, -1 * $characters); + } + return $str; + } + } |