* @copyright Curverider Ltd 2008-2010 * @link http://elgg.org/ */ $owner = $vars['entity']->getOwnerEntity(); $friendlytime = friendly_time($vars['entity']->time_created); $parsed_url = parse_url($vars['entity']->address); $faviconurl = $parsed_url['scheme'] . "://" . $parsed_url['host'] . "/favicon.ico"; //sort out the access level for display $object_acl = get_readable_access_level($vars['entity']->access_id); //files with these access level don't need an icon $general_access = array('Public', 'Logged in users', 'Friends'); //set the right class for access level display - need it to set on groups and shared access only $is_group = get_entity($vars['entity']->container_guid); if($is_group instanceof ElggGroup){ //get the membership type open/closed $membership = $is_group->membership; //we decided to show that the item is in a group, rather than its actual access level $object_acl = "Group: " . $is_group->name; if($membership == 2) $access_level = "class='group_open'"; else $access_level = "class='group_closed'"; }elseif($object_acl == 'Private'){ $access_level = "class='private'"; }else{ if(!in_array($object_acl, $general_access)) $access_level = "class='shared_collection'"; else $access_level = "class='entity_access'"; } if($vars['entity']->description != '') $view_notes = "note"; else $view_notes = ''; if (@file_exists($faviconurl)) { $icon = ""; } else { $icon = elgg_view("profile/icon", array('entity' => $owner,'size' => 'tiny',)); } //delete if($vars['entity']->canEdit()){ $delete .= "" . elgg_view('output/confirmlink',array( 'href' => $vars['url'] . "action/bookmarks/delete?bookmark_guid=" . $vars['entity']->guid, 'text' => elgg_echo("delete"), 'confirm' => elgg_echo("bookmarks:delete:confirm"), )) . ""; } $info = "
"; //include edit and delete options if($vars['entity']->canEdit()){ $info .= ""; $info .= ""; } $info .= "
{$object_acl}username}/edit/{$vars['entity']->getGUID()}\">" . elgg_echo('edit') . "".$delete."
"; $info .= "

address}\">{$vars['entity']->title}

"; $info .= "

Bookmarked by username}\">{$owner->name} {$friendlytime} {$view_notes}

"; $tags = elgg_view('output/tags', array('tags' => $vars['entity']->tags)); if (!empty($tags)) { $info .= '

' . $tags . '

'; } if($view_notes != ''){ $info .= ""; } //display echo elgg_view_listing($icon, $info);