Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion ting.entities.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Entity classes for ting objects and collections.
*/

define('TING_OBJ_DESCRIPTION_LENGTH', 180);

/**
* Object representing a relation between TingEntites.
*/
Expand Down Expand Up @@ -324,7 +326,17 @@ class TingEntity extends DingEntity {
}

function getDescription() {
return !empty($this->reply->record['dc:description'][''][0]) ? $this->reply->record['dc:description'][''][0] : FALSE;
$description = FALSE;
if (!empty($this->reply->record['dc:description'][''][0])) {
$description = $this->reply->record['dc:description'][''][0];
if (drupal_strlen($description) > TING_OBJ_DESCRIPTION_LENGTH) {
$description = truncate_utf8($description, TING_OBJ_DESCRIPTION_LENGTH, TRUE, TRUE);
}
else {
$description .= t('...');
}
}
return $description;
}

/**
Expand Down