getOwnerEntity(); $container = $file->getContainerEntity(); $categories = elgg_view('categories/view', $vars); $excerpt = elgg_get_excerpt($file->description); $mime = $file->mimetype; $body = autop($file->description); $owner_icon = elgg_view('profile/icon', array('entity' => $owner, 'size' => 'tiny')); $owner_link = elgg_view('output/url', array( 'href' => "pg/file/owner/$owner->username", 'text' => $owner->name, )); $author_text = elgg_echo('blog:author_by_line', array($owner_link)); if ($file->tags) { $tags = "

" . elgg_view('output/tags', array('tags' => $file->tags)) . "

"; } else { $tags = ""; } $date = elgg_view_friendly_time($file->time_created); $comments_count = elgg_count_comments($file); //only display if there are commments if ($comments_count != 0) { $text = elgg_echo("comments") . " ($comments_count)"; $comments_link = elgg_view('output/url', array( 'href' => $file->getURL() . '#file-comments', 'text' => $text, )); } else { $comments_link = ''; } $metadata = elgg_view('layout/objects/list/metadata', array( 'entity' => $file, 'handler' => 'file', )); $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) { $header = elgg_view_title($file->title); $params = array( 'entity' => $file, 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags, ); $list_body = elgg_view('layout/objects/list/body', $params); $file_info = elgg_view_image_block($owner_icon, $list_body); if (elgg_view_exists('file/specialcontent/' . $mime)) { $blah = "
".elgg_view('file/specialcontent/' . $mime, $vars)."
"; } else if (elgg_view_exists("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default")) { $blah = "
".elgg_view("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default", $vars)."
"; } echo << $body $blah HTML; } else { // brief view $params = array( 'entity' => $file, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags, 'content' => $excerpt, ); $list_body = elgg_view('layout/objects/list/body', $params); echo elgg_view_image_block($owner_icon, $list_body); } return true; global $CONFIG; $file = $vars['entity']; $file_guid = $file->getGUID(); $tags = $file->tags; $title = $file->title; $desc = $file->description; $owner = $vars['entity']->getOwnerEntity(); $friendlytime = elgg_view_friendly_time($vars['entity']->time_created); $mime = $file->mimetype; if (!$title) { $title = elgg_echo('untitled'); } if (elgg_get_context() == "search") { // Start search listing version if (get_input('listtype') == "gallery") { echo ""; } else { $info = "

getURL()}\">{$title}

"; $info .= "

username}\">{$owner->name} {$friendlytime}"; $numcomments = elgg_count_comments($file); if ($numcomments) $info .= ", getURL()}\">" . elgg_echo("comments") . " (" . $numcomments . ")"; $info .= "

"; $icon = "getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid, 'size' => 'small')) . ""; echo elgg_view_listing($icon, $info); } } else { // Start main version ?>
$mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid)); ?>
guid . "&listtype=gallery"; ?>

$owner, 'size' => 'tiny')); ?>

name; ?>

$desc)); ?>

$tags)); ?>

".elgg_view('file/specialcontent/' . $mime, $vars)."
"; } else if (elgg_view_exists("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default")) { echo "
".elgg_view("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default", $vars)."
"; } ?>

canEdit()) { ?>

  "action/file/delete?file=" . $file->getGUID(), 'text' => elgg_echo("delete"), 'confirm' => elgg_echo("file:delete:confirm"), 'is_action' => true, )); ?>