aboutsummaryrefslogtreecommitdiffstats
path: root/lib/helper.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2012-11-12 14:04:23 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2012-11-12 14:04:23 +0100
commit0ce5e9257e71dd8bf21379c3cbe774be8e4efd7b (patch)
treeab3b418679015b34c9cf1c7d8ee05d84f4450cd0 /lib/helper.php
parent28671d92c02ec8a8636f45511f9bb79110b49d58 (diff)
downloadnextcloud-server-0ce5e9257e71dd8bf21379c3cbe774be8e4efd7b.tar.gz
nextcloud-server-0ce5e9257e71dd8bf21379c3cbe774be8e4efd7b.zip
add php-doc for ellipsis
Diffstat (limited to 'lib/helper.php')
-rw-r--r--lib/helper.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/helper.php b/lib/helper.php
index 5a93e6533de..02e36d601d2 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -712,8 +712,14 @@ class OC_Helper {
return false;
}
-
+ /**
+ * Shortens str to maxlen by replacing characters in the middle with '...', eg.
+ * ellipsis('a very long string with lots of useless info to make a better example', 14) becomes 'a very ...example'
+ * @param string $str the string
+ * @param string $maxlen the maximum length of the result
+ * @return string with at most maxlen characters
+ */
public static function ellipsis($str, $maxlen) {
if (strlen($str) > $maxlen) {
$characters = floor($maxlen / 2);
@@ -721,5 +727,5 @@ class OC_Helper {
}
return $str;
}
-
+
}