From 8f7a86ebae5f6fd3f64f976a83cfc6712e083c2a Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 29 Dec 2010 13:35:16 +0000 Subject: starting to update the file plugin to use the new html/css git-svn-id: http://code.elgg.org/elgg/trunk@7737 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/file/views/default/object/file.php | 110 +++++++++++++++++++++++++++++++-- 1 file changed, 104 insertions(+), 6 deletions(-) (limited to 'mod/file/views') diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index b4754cb18..0f128eed6 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -1,10 +1,108 @@ 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; -- cgit v1.2.3