aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/file/search.php11
-rw-r--r--mod/file/views/default/file/css.php10
-rw-r--r--mod/file/views/default/object/file.php8
-rw-r--r--views/default/css/elements/core.php3
-rw-r--r--views/default/layout/objects/list.php4
-rw-r--r--views/default/layout/objects/list/metadata.php2
6 files changed, 35 insertions, 3 deletions
diff --git a/mod/file/search.php b/mod/file/search.php
index fa6c5ea71..ba6808176 100644
--- a/mod/file/search.php
+++ b/mod/file/search.php
@@ -73,7 +73,12 @@
$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,
@@ -88,6 +93,10 @@
$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>";
diff --git a/mod/file/views/default/file/css.php b/mod/file/views/default/file/css.php
index 206cdc345..bd2a30c43 100644
--- a/mod/file/views/default/file/css.php
+++ b/mod/file/views/default/file/css.php
@@ -14,6 +14,16 @@
-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 {
diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php
index 166ab9cd3..1d3aa7140 100644
--- a/mod/file/views/default/object/file.php
+++ b/mod/file/views/default/object/file.php
@@ -65,7 +65,7 @@ if (elgg_in_context('widgets')) {
$metadata = '';
}
-if ($full) {
+if ($full && !elgg_in_context('gallery')) {
$extra = '';
if (elgg_view_exists("file/specialcontent/$mime")) {
@@ -103,6 +103,12 @@ $file_info
</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
diff --git a/views/default/css/elements/core.php b/views/default/css/elements/core.php
index 879427583..e8e18bec3 100644
--- a/views/default/css/elements/core.php
+++ b/views/default/css/elements/core.php
@@ -199,6 +199,9 @@ h2 {
.elgg-list > li {
border-bottom: 1px dotted #CCCCCC;
}
+.elgg-gallery, .elgg-gallery > li {
+ border: none;
+}
.elgg-list-metadata {
float: right;
margin-left: 15px;
diff --git a/views/default/layout/objects/list.php b/views/default/layout/objects/list.php
index 6d12c5e55..0ab3d5482 100644
--- a/views/default/layout/objects/list.php
+++ b/views/default/layout/objects/list.php
@@ -31,6 +31,10 @@ if (isset($vars['list_class'])) {
$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";
diff --git a/views/default/layout/objects/list/metadata.php b/views/default/layout/objects/list/metadata.php
index 43bfaf50b..f2038f88b 100644
--- a/views/default/layout/objects/list/metadata.php
+++ b/views/default/layout/objects/list/metadata.php
@@ -38,7 +38,7 @@ if ($entity->canEdit() && $handler) {
'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>";
}