aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-18 02:22:04 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-18 02:22:04 +0000
commit67d48d8bc7307eda7d7f9bac2c412120f1df2d02 (patch)
tree9b65f037ac389ff10b35e54f5ef4a2ace2d7d5e6 /mod
parent1c3b6bd38eb0318dbad8cd64379055e4e5accc0a (diff)
downloadelgg-67d48d8bc7307eda7d7f9bac2c412120f1df2d02.tar.gz
elgg-67d48d8bc7307eda7d7f9bac2c412120f1df2d02.tar.bz2
improved .elgg-gallery and added .elgg-photo
git-svn-id: http://code.elgg.org/elgg/trunk@8281 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-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;
+}