aboutsummaryrefslogtreecommitdiff
path: root/mod/file/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'mod/file/views/default')
-rw-r--r--mod/file/views/default/file/css.php18
-rw-r--r--mod/file/views/default/file/specialcontent/image/default.php9
-rw-r--r--mod/file/views/default/icon/object/file.php40
3 files changed, 50 insertions, 17 deletions
diff --git a/mod/file/views/default/file/css.php b/mod/file/views/default/file/css.php
index 53fa94e46..5476ed7e2 100644
--- a/mod/file/views/default/file/css.php
+++ b/mod/file/views/default/file/css.php
@@ -5,25 +5,11 @@
* @package ElggFile
*/
?>
-.file-image {
+.file-photo {
text-align: center;
-}
-.file-image img {
- padding: 10px;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- background: #333333;
+ margin-bottom: 15px;
}
.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;
-}
-.file-gallery-item img {
- margin: 5px 0;
}
diff --git a/mod/file/views/default/file/specialcontent/image/default.php b/mod/file/views/default/file/specialcontent/image/default.php
index a55b97eb5..91ec11064 100644
--- a/mod/file/views/default/file/specialcontent/image/default.php
+++ b/mod/file/views/default/file/specialcontent/image/default.php
@@ -3,6 +3,13 @@
* Display an image
*/
+$image_url = elgg_get_site_url() . "mod/file/thumbnail.php?file_guid={$vars['entity']->getGUID()}&size=large";
+$download_url = elgg_get_site_url() . "mod/file/download.php?file_guid={$vars['entity']->getGUID()}";
+
if ($vars['full'] && $smallthumb = $vars['entity']->smallthumb) {
- echo "<p class=\"file-image\"><a href=\"".elgg_get_site_url()."mod/file/download.php?file_guid={$vars['entity']->getGUID()}\"><img src=\"".elgg_get_site_url()."mod/file/thumbnail.php?file_guid={$vars['entity']->getGUID()}&size=large\" /></a></p>";
+ echo <<<HTML
+ <div class="file-photo">
+ <a href="$download_url"><img class="elgg-photo" src="$image_url" /></a>
+ </div>
+HTML;
}
diff --git a/mod/file/views/default/icon/object/file.php b/mod/file/views/default/icon/object/file.php
new file mode 100644
index 000000000..249dd9c99
--- /dev/null
+++ b/mod/file/views/default/icon/object/file.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * File icon view
+ *
+ * @uses $vars['entity'] The entity the icon represents - uses getIconURL() method
+ * @uses $vars['size'] topbar, tiny, small, medium (default), large, master
+ * @uses $vars['href'] Optional override for link
+ */
+
+$entity = $vars['entity'];
+
+$sizes = array('small', 'medium', 'large', 'tiny', 'master', 'topbar');
+// Get size
+if (!in_array($vars['size'], $sizes)) {
+ $vars['size'] = "medium";
+}
+
+$title = $entity->title;
+
+$url = $entity->getURL();
+if (isset($vars['href'])) {
+ $url = $vars['href'];
+}
+
+$class = '';
+if ($entity->thumbnail) {
+ $class = 'class="elgg-photo"';
+}
+
+$img_src = $entity->getIconURL($vars['size']);
+$img = "<img $class src=\"$img_src\" alt=\"$title\" />";
+
+if ($url) {
+ echo elgg_view('output/url', array(
+ 'href' => $url,
+ 'text' => $img,
+ ));
+} else {
+ echo $img;
+}