diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-18 02:22:04 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-18 02:22:04 +0000 |
commit | 67d48d8bc7307eda7d7f9bac2c412120f1df2d02 (patch) | |
tree | 9b65f037ac389ff10b35e54f5ef4a2ace2d7d5e6 /mod/file/views/default/icon | |
parent | 1c3b6bd38eb0318dbad8cd64379055e4e5accc0a (diff) | |
download | elgg-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/file/views/default/icon')
-rw-r--r-- | mod/file/views/default/icon/object/file.php | 40 |
1 files changed, 40 insertions, 0 deletions
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; +} |