summaryrefslogtreecommitdiffstats
path: root/lib/helper.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2012-11-12 13:56:29 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2012-11-12 13:56:29 +0100
commit28671d92c02ec8a8636f45511f9bb79110b49d58 (patch)
treef06dfc359b781a349a0462c237dc37a7ac7e00d6 /lib/helper.php
parentbb56581192e062e4c8ec2aa7c0874433760e7fa9 (diff)
downloadnextcloud-server-28671d92c02ec8a8636f45511f9bb79110b49d58.tar.gz
nextcloud-server-28671d92c02ec8a8636f45511f9bb79110b49d58.zip
move code to better places
Diffstat (limited to 'lib/helper.php')
-rw-r--r--lib/helper.php10
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;
+ }
+
}