From ad6e04d0bbf812dfe048f1fdbde7aa5c787b6d1a Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 1 Dec 2010 00:57:18 +0000 Subject: Fixes #2555 content.php is the new display view for widgets git-svn-id: http://code.elgg.org/elgg/trunk@7484 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/widgets/filerepo/content.php | 71 ++++++++++++++++++++++ mod/file/views/default/widgets/filerepo/view.php | 71 ---------------------- 2 files changed, 71 insertions(+), 71 deletions(-) create mode 100644 mod/file/views/default/widgets/filerepo/content.php delete mode 100644 mod/file/views/default/widgets/filerepo/view.php (limited to 'mod/file/views') diff --git a/mod/file/views/default/widgets/filerepo/content.php b/mod/file/views/default/widgets/filerepo/content.php new file mode 100644 index 000000000..41a968dce --- /dev/null +++ b/mod/file/views/default/widgets/filerepo/content.php @@ -0,0 +1,71 @@ +owner_guid; +$number = $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 +); +$files = elgg_get_entities($options); + +//if there are some files, go get them +if ($files) { + + echo "
"; + + if ($view == "gallery") { + + echo "
"; + + //display in gallery mode + foreach ($files as $f) { + + $mime = $f->mimetype; + echo "getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $f->thumbnail, 'file_guid' => $f->guid)) . ""; + } + + echo "
"; + } else { + + //display in list mode + foreach ($files as $f) { + + $mime = $f->mimetype; + echo "
"; + echo ""; + echo "
"; + echo "

" . $f->title . "

"; + echo "

" . elgg_view_friendly_time($f->time_created) . "

"; + echo "
"; + } + } + + + //get a link to the users files + $users_file_url = elgg_get_site_url() . "pg/file/" . get_user($f->owner_guid)->username; + + echo ""; + echo "
"; +} else { + + echo "

" . elgg_echo("file:none") . "

"; +} +?> \ No newline at end of file diff --git a/mod/file/views/default/widgets/filerepo/view.php b/mod/file/views/default/widgets/filerepo/view.php deleted file mode 100644 index 41a968dce..000000000 --- a/mod/file/views/default/widgets/filerepo/view.php +++ /dev/null @@ -1,71 +0,0 @@ -owner_guid; -$number = $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 -); -$files = elgg_get_entities($options); - -//if there are some files, go get them -if ($files) { - - echo "
"; - - if ($view == "gallery") { - - echo "
"; - - //display in gallery mode - foreach ($files as $f) { - - $mime = $f->mimetype; - echo "getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $f->thumbnail, 'file_guid' => $f->guid)) . ""; - } - - echo "
"; - } else { - - //display in list mode - foreach ($files as $f) { - - $mime = $f->mimetype; - echo "
"; - echo ""; - echo "
"; - echo "

" . $f->title . "

"; - echo "

" . elgg_view_friendly_time($f->time_created) . "

"; - echo "
"; - } - } - - - //get a link to the users files - $users_file_url = elgg_get_site_url() . "pg/file/" . get_user($f->owner_guid)->username; - - echo ""; - echo "
"; -} else { - - echo "

" . elgg_echo("file:none") . "

"; -} -?> \ No newline at end of file -- cgit v1.2.3