// default case
if ($content === '') {
- $additionalParameters = ' data-object-id="' . $object->getObjectID() . '"';
$content = $object->getFormattedUsername();
- if (isset($tagArgs['class'])) {
- $tagArgs['class'] = 'userLink ' . $tagArgs['class'];
- } else {
- $tagArgs['class'] = 'userLink';
+ if ($object->getObjectID()) {
+ $additionalParameters = ' data-object-id="' . $object->getObjectID() . '"';
+ if (isset($tagArgs['class'])) {
+ $tagArgs['class'] = 'userLink ' . $tagArgs['class'];
+ } else {
+ $tagArgs['class'] = 'userLink';
+ }
}
}
. '="' . StringUtil::encodeHTML($value) . '"';
}
+ if (!$object->getObjectID()) {
+ return '<span' . $additionalParameters . '>' . $content . '</span>';
+ }
+
return '<a href="' . StringUtil::encodeHTML($object->getLink() . $append) . '"' . $additionalParameters . '>' . $content . '</a>';
}
}