diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-01 17:55:18 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-01 17:55:18 +0000 |
commit | 7b8a18ab7f993aa5f4f7f643478f06a8e3f7ed52 (patch) | |
tree | 1070be6b85c5a2327163cb0326dfbcbc62f10d62 /mod/file/views/default/widgets/filerepo/content.php | |
parent | 07ffe6464b453fd90cd2833fc55f804c57c52b4a (diff) | |
download | elgg-7b8a18ab7f993aa5f4f7f643478f06a8e3f7ed52.tar.gz elgg-7b8a18ab7f993aa5f4f7f643478f06a8e3f7ed52.tar.bz2 |
almost finished updating the file plugin to work with new html/css
git-svn-id: http://code.elgg.org/elgg/trunk@7804 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/file/views/default/widgets/filerepo/content.php')
-rw-r--r-- | mod/file/views/default/widgets/filerepo/content.php | 68 |
1 files changed, 15 insertions, 53 deletions
diff --git a/mod/file/views/default/widgets/filerepo/content.php b/mod/file/views/default/widgets/filerepo/content.php index 130b5e3de..d2cd246ae 100644 --- a/mod/file/views/default/widgets/filerepo/content.php +++ b/mod/file/views/default/widgets/filerepo/content.php @@ -6,65 +6,27 @@ */ -$owner_guid = $vars['entity']->owner_guid; -$number = $vars['entity']->num_display; +$num = $vars['entity']->num_display; -//get the layout view which is set by the user in the edit panel -$get_view = (int) $vars['entity']->gallery_list; -if (!$get_view || $get_view == 1) { - $view = "list"; -} else { - $view = "gallery"; -} - -//get the user's files $options = array( 'type' => 'object', 'subtype' => 'file', - 'limit' => $number, - 'container_guid' => $owner_guid + 'container_guid' => $vars['entity']->owner_guid, + 'limit' => $num, + 'full_view' => FALSE, + 'pagination' => FALSE, ); -$files = elgg_get_entities($options); - -//if there are some files, go get them -if ($files) { - - echo "<div id='filerepo_widget_layout'>"; - - if ($view == "gallery") { - - echo "<div class='filerepo_widget_galleryview'>"; +$content = elgg_list_entities($options); - //display in gallery mode - foreach ($files as $f) { +echo $content; - $mime = $f->mimetype; - echo "<a href=\"{$f->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $f->thumbnail, 'file_guid' => $f->guid)) . "</a>"; - } - - echo "</div>"; - } else { - - //display in list mode - foreach ($files as $f) { - - $mime = $f->mimetype; - echo "<div class='filerepo_widget_singleitem clearfix'>"; - echo "<div class='filerepo_listview_icon'><a href=\"{$f->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $f->thumbnail, 'file_guid' => $f->guid)) . "</a></div>"; - echo "<div class='filerepo_widget-content'>"; - echo "<div class='filerepo_listview_title'><p class='filerepo_title'>" . $f->title . "</p></div>"; - echo "<div class='filerepo_listview_date'><p class='filerepo_timestamp'><small>" . elgg_view_friendly_time($f->time_created) . "</small></p></div>"; - echo "</div></div>"; - } - } - - - //get a link to the users files - $users_file_url = elgg_get_site_url() . "pg/file/" . get_user($f->owner_guid)->username; - - echo "<div class='filerepo_widget_singleitem_more'><a href=\"{$users_file_url}\">" . elgg_echo('file:more') . "</a></div>"; - echo "</div>"; +if ($content) { + $url = "pg/file/owner/" . elgg_get_page_owner()->username; + $more_link = elgg_view('output/url', array( + 'href' => $url, + 'text' => elgg_echo('file:more'), + )); + echo "<span class=\"elgg-widget-more\">$more_link</span>"; } else { - - echo "<p class='margin-top'>" . elgg_echo("file:none") . "</p>"; + echo elgg_echo('file:none'); } |