$offset = (int)get_input('offset', 0);
$limit = 10;
- if ($listtype == "gallery") $limit = 12;
+
+ if ($listtype == "gallery") {
+ $limit = 12;
+ elgg_push_context('gallery');
+ }
+
if (!empty($tag)) {
$params = array(
'metadata_name' => $md_type,
$area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'file', 'owner_guid' => $owner_guid, 'limit' => $limit, 'offset' => $offset));
}
+ if ($listtype == "gallery") {
+ elgg_pop_context();
+ }
+
elgg_pop_context();
$content = "<div class='files'>".$area1.$area2."</div>";
-moz-border-radius: 6px;
background: #333333;
}
+.file-gallery-item {
+ float: left;
+ text-align: center;
+ width: 165px;
+ margin: 10px 10px 0 0;
+ padding: 5px;
+ background-color: #eeeeee;
+ -webkit-border-radius: 6px;
+ -moz-border-radius: 6px;
+}
.files .entity-listing .entity-listing-info {
$metadata = '';
}
-if ($full) {
+if ($full && !elgg_in_context('gallery')) {
$extra = '';
if (elgg_view_exists("file/specialcontent/$mime")) {
</div>
HTML;
+} elseif (elgg_in_context('gallery')) {
+ echo '<div class="file-gallery-item">';
+ echo "<h3>" . $file->title . "</h3>";
+ echo "<a href=\"{$file->getURL()}\"><img src=\"".elgg_get_site_url()."mod/file/thumbnail.php?size=medium&file_guid={$vars['entity']->getGUID()}\" /></a>";
+ echo "<p class='subtitle'>$owner_link $date</p>";
+ echo '</div>';
} else {
// brief view
.elgg-list > li {
border-bottom: 1px dotted #CCCCCC;
}
+.elgg-gallery, .elgg-gallery > li {
+ border: none;
+}
.elgg-list-metadata {
float: right;
margin-left: 15px;
$list_class = "{$vars['list_class']} $list_class";
}
+if (elgg_in_context('gallery')) {
+ $list_class = "$list_class elgg-gallery";
+}
+
$item_class = 'elgg-list-item';
if (isset($vars['item_class'])) {
$item_class = "{$vars['item_class']} $item_class";
'text' => '<span class="elgg-icon elgg-icon-delete"></span>',
'title' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm'),
- 'encode' => false,
+ 'text_encode' => false,
));
echo "<li>$delete_link</li>";
}