From 34102e5462dcd08e9d5dd1b185e01f299b35b0e9 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 30 Dec 2010 14:00:57 +0000 Subject: updated the object/file view git-svn-id: http://code.elgg.org/elgg/trunk@7770 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/file/views/default/object/file.php | 220 +++++---------------------------- 1 file changed, 28 insertions(+), 192 deletions(-) (limited to 'mod/file/views/default/object/file.php') diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index 0f128eed6..166ab9cd3 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -17,14 +17,23 @@ $container = $file->getContainerEntity(); $categories = elgg_view('categories/view', $vars); $excerpt = elgg_get_excerpt($file->description); $mime = $file->mimetype; +$base_type = substr($mime, 0, strpos($mime,'/')); + +$body = elgg_view('output/longtext', array('value' => $file->description)); -$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)); + +$file_icon = elgg_view('file/icon', array( + 'mimetype' => $mime, + 'thumbnail' => $file->thumbnail, + 'file_guid' => $file->guid, + 'size' => 'small' +)); + if ($file->tags) { $tags = "

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

"; } else { @@ -58,6 +67,19 @@ if (elgg_in_context('widgets')) { if ($full) { + $extra = ''; + if (elgg_view_exists("file/specialcontent/$mime")) { + $extra = elgg_view("file/specialcontent/$mime", $vars); + } else if (elgg_view_exists("file/specialcontent/$base_type/default")) { + $extra = elgg_view("file/specialcontent/$base_type/default", $vars); + } + + $download = elgg_view('output/url', array( + 'href' => "mod/file/download.php?file_guid=$file->guid", + 'text' => elgg_echo("file:download"), + 'class' => 'elgg-action-button', + )); + $header = elgg_view_title($file->title); $params = array( @@ -69,21 +91,15 @@ if ($full) { ); $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)."
"; - } - + $file_info = elgg_view_image_block($file_icon, $list_body); echo << $body - $blah + $extra +

$download

HTML; @@ -99,185 +115,5 @@ HTML; ); $list_body = elgg_view('layout/objects/list/body', $params); - echo elgg_view_image_block($owner_icon, $list_body); + echo elgg_view_image_block($file_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 - -?> -
- - -
- 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, - - )); - ?> -

-
- - -
- - - - - \ No newline at end of file -- cgit v1.2.3