aboutsummaryrefslogtreecommitdiff
path: root/mod/file/views/default/icon
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
committerSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
commite53d410129701ea1c9d19529afa493f11b5f5b70 (patch)
treed9963b24bf8932654b4a47e36602c75975e50dba /mod/file/views/default/icon
parent377da25d2965c64941f83baae119fc970ec60982 (diff)
parent08a962c98e2923724f8013d6eaae89101243752a (diff)
downloadelgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz
elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2
Merge github.com:Elgg/Elgg
Conflicts: engine/lib/input.php
Diffstat (limited to 'mod/file/views/default/icon')
-rw-r--r--mod/file/views/default/icon/object/file.php25
1 files changed, 19 insertions, 6 deletions
diff --git a/mod/file/views/default/icon/object/file.php b/mod/file/views/default/icon/object/file.php
index 6357d418f..a3190310b 100644
--- a/mod/file/views/default/icon/object/file.php
+++ b/mod/file/views/default/icon/object/file.php
@@ -2,9 +2,11 @@
/**
* 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
+ * @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
+ * @uses $vars['img_class'] Optional CSS class added to img
+ * @uses $vars['link_class'] Optional CSS class added to link
*/
$entity = $vars['entity'];
@@ -16,6 +18,7 @@ if (!in_array($vars['size'], $sizes)) {
}
$title = $entity->title;
+$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8', false);
$url = $entity->getURL();
if (isset($vars['href'])) {
@@ -23,8 +26,13 @@ if (isset($vars['href'])) {
}
$class = '';
+if (isset($vars['img_class'])) {
+ $class = $vars['img_class'];
+}
if ($entity->thumbnail) {
- $class = 'class="elgg-photo"';
+ $class = "class=\"elgg-photo $class\"";
+} else if ($class) {
+ $class = "class=\"$class\"";
}
$img_src = $entity->getIconURL($vars['size']);
@@ -32,10 +40,15 @@ $img_src = elgg_format_url($img_src);
$img = "<img $class src=\"$img_src\" alt=\"$title\" />";
if ($url) {
- echo elgg_view('output/url', array(
+ $params = array(
'href' => $url,
'text' => $img,
- ));
+ 'is_trusted' => true,
+ );
+ if (isset($vars['link_class'])) {
+ $params['class'] = $vars['link_class'];
+ }
+ echo elgg_view('output/url', $params);
} else {
echo $img;
}