getOwnerEntity(); $container = $bookmark->getContainerEntity(); $categories = elgg_view('output/categories', $vars); $link = filter_tags(elgg_view('output/url', array('href' => $bookmark->address))); $description = elgg_view('output/longtext', array('value' => $bookmark->description, 'class' => 'pbl')); $owner_link = elgg_view('output/url', array( 'href' => "pg/bookmarks/owner/$owner->username", 'text' => $owner->name, )); $author_text = elgg_echo('byline', array($owner_link)); $tags = elgg_view('output/tags', array('tags' => $bookmark->tags)); $date = elgg_view_friendly_time($bookmark->time_created); $comments_count = $bookmark->countComments(); //only display if there are commments if ($comments_count != 0) { $text = elgg_echo("comments") . " ($comments_count)"; $comments_link = elgg_view('output/url', array( 'href' => $bookmark->getURL() . '#comments', 'text' => $text, )); } else { $comments_link = ''; } $metadata = elgg_view('navigation/menu/metadata', array( 'entity' => $bookmark, 'handler' => 'bookmarks', )); $subtitle = "$author_text $date $categories $comments_link"; // do not show the metadata and controls in widget view if (elgg_in_context('widgets')) { $metadata = ''; } if ($full && !elgg_in_context('gallery')) { $header = elgg_view_title($bookmark->title); $params = array( 'entity' => $bookmark, 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags, ); $bookmark_info = elgg_view('object/elements/list_body', $params); $bookmark_icon = elgg_view_icon('bookmark'); echo << $bookmark_icon

$link

$description HTML; } elseif (elgg_in_context('gallery')) { echo <<

$bookmark->title

$owner_link $date

HTML; } else { // brief view $url = $bookmark->address; $display_text = $url; $excerpt = elgg_get_excerpt($bookmark->description); if ($excerpt) { $excerpt = " - $excerpt"; } if (strlen($url) > 25) { $bits = parse_url($url); if (isset($bits['host'])) { $display_text = $bits['host']; } else { $display_text = elgg_get_excerpt($url, 100); } } $link = filter_tags(elgg_view('output/url', array( 'href' => $bookmark->address, 'text' => $display_text ))); $content = elgg_view_icon('bookmark') . "$link{$excerpt}"; $params = array( 'entity' => $bookmark, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags, 'content' => $content, ); echo elgg_view('object/elements/list_body', $params); }