123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- $folder = elgg_extract("entity", $vars);
- $full_view = elgg_extract("full_view", $vars, false);
- $time_preference = "date";
- if ($user_time_preference = elgg_get_plugin_user_setting('file_tools_time_display', null, "file_tools")) {
- $time_preference = $user_time_preference;
- } elseif ($site_time_preference = elgg_get_plugin_setting("file_tools_default_time_display", "file_tools")) {
- $time_preference = $site_time_preference;
- }
- if ($time_preference == 'date') {
- $friendlytime = date(elgg_echo("friendlytime:date_format"), $folder->time_created);
- } else {
- $friendlytime = elgg_view_friendly_time($folder->time_created);
- }
- $title = $folder->title;
- if (empty($title)) {
- $title = elgg_echo("untitled");
- }
- $params = array(
- 'text' => elgg_get_excerpt($title, 100),
- 'href' => $folder->getURL(),
- 'is_trusted' => true,
- );
- $title = elgg_view('output/url', $params);
- $entity_menu = "";
- if (!elgg_in_context("widgets")) {
- $entity_menu = elgg_view_menu("entity", array(
- "entity" => $folder,
- "handler" => "file_tools/folder",
- "sort_by" => "priority",
- "class" => "elgg-menu-hz"
- ));
- }
- if ($full_view) {
- // full view
- $icon = elgg_view_entity_icon($folder, "small");
-
- $owner_link = elgg_view("output/url", array("text" => $folder->getOwnerEntity()->name, "href" => $folder->getOwnerEntity()->getURL()));
- $owner_text = elgg_echo("byline", array($owner_link));
-
- $subtitle = "$owner_text $friendlytime";
-
- $params = array(
- "entity" => $folder,
- "title" => $title,
- "metadata" => $entity_menu,
- "tags" => elgg_view("output/tags", array("value" => $folder->tags)),
- "subtitle" => $subtitle
- );
-
- $params = $params + $vars;
- $summary = elgg_view("object/elements/summary", $params);
-
- echo elgg_view("object/elements/full", array(
- "entity" => $folder,
- "title" => false,
- "icon" => $icon,
- "summary" => $summary,
- "body" => elgg_view("output/longtext", array("value" => $folder->description))
- ));
- } else {
- // summary view
- $icon = elgg_view_entity_icon($folder, "tiny");
- $icon_alt = "";
- if (!elgg_in_context("widgets")) {
- $icon_alt = elgg_view("input/checkbox", array("name" => "folder_guids[]", "value" => $folder->getGUID(), "default" => false));
- }
-
- $params = array(
- "entity" => $folder,
- "title" => $title,
- "metadata" => $entity_menu
- );
-
- $params = $params + $vars;
- $list_body = elgg_view("object/elements/summary", $params);
-
- echo elgg_view_image_block($icon, $list_body, array("class" => "file-tools-folder", "image_alt" => $icon_alt));
- }
|