From 05dd641817d5d02d600eea6478c8eaa592562a88 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 16 Dec 2008 11:33:11 +0000 Subject: [PATCH] ENHANCEMENT Allow choosing ellipsis for truncated text on Text->LimitWordCountXML() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69224 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/fieldtypes/Text.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/model/fieldtypes/Text.php b/core/model/fieldtypes/Text.php index a74394e56..44a2f0b2c 100644 --- a/core/model/fieldtypes/Text.php +++ b/core/model/fieldtypes/Text.php @@ -81,10 +81,11 @@ class Text extends DBField { * are converted to & * * @param int $numWords Number of words to limit by + * @param string $add Ellipsis to add to the end of truncated string * @return string */ - function LimitWordCountXML($numWords = 26) { - $ret = $this->LimitWordCount($numWords); + function LimitWordCountXML($numWords = 26, $add = '...') { + $ret = $this->LimitWordCount($numWords, $add); return Convert::raw2xml($ret); }