diff options
Diffstat (limited to 'views/default/icon/object')
-rw-r--r-- | views/default/icon/object/videolist/large.php | 11 | ||||
-rw-r--r-- | views/default/icon/object/videolist/master.php | 11 | ||||
-rw-r--r-- | views/default/icon/object/videolist/medium.php | 11 | ||||
-rw-r--r-- | views/default/icon/object/videolist/small.php | 11 | ||||
-rw-r--r-- | views/default/icon/object/videolist/tiny.php | 11 | ||||
-rw-r--r-- | views/default/icon/object/videolist/topbar.php | 11 | ||||
-rw-r--r-- | views/default/icon/object/videolist_item.php | 46 |
7 files changed, 46 insertions, 66 deletions
diff --git a/views/default/icon/object/videolist/large.php b/views/default/icon/object/videolist/large.php deleted file mode 100644 index 62815f7c4..000000000 --- a/views/default/icon/object/videolist/large.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Display a video's icon. - */ - -$entity = elgg_get_array_value('entity', $vars, NULL); -$size = 'large'; - -if ($entity) { - echo videolist_get_entity_icon_url($entity, $size); -}
\ No newline at end of file diff --git a/views/default/icon/object/videolist/master.php b/views/default/icon/object/videolist/master.php deleted file mode 100644 index 65d0ea6e0..000000000 --- a/views/default/icon/object/videolist/master.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Display a video's icon. - */ - -$entity = elgg_get_array_value('entity', $vars, NULL); -$size = 'master'; - -if ($entity) { - echo videolist_get_entity_icon_url($entity, $size); -}
\ No newline at end of file diff --git a/views/default/icon/object/videolist/medium.php b/views/default/icon/object/videolist/medium.php deleted file mode 100644 index c2d85cf6e..000000000 --- a/views/default/icon/object/videolist/medium.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Display a video's icon. - */ - -$entity = elgg_get_array_value('entity', $vars, NULL); -$size = 'medium'; - -if ($entity) { - echo videolist_get_entity_icon_url($entity, $size); -}
\ No newline at end of file diff --git a/views/default/icon/object/videolist/small.php b/views/default/icon/object/videolist/small.php deleted file mode 100644 index 34d08cd1e..000000000 --- a/views/default/icon/object/videolist/small.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Display a video's icon. - */ - -$entity = elgg_get_array_value('entity', $vars, NULL); -$size = 'small'; - -if ($entity) { - echo videolist_get_entity_icon_url($entity, $size); -}
\ No newline at end of file diff --git a/views/default/icon/object/videolist/tiny.php b/views/default/icon/object/videolist/tiny.php deleted file mode 100644 index 2dce0f06d..000000000 --- a/views/default/icon/object/videolist/tiny.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Display a video's icon. - */ - -$entity = elgg_get_array_value('entity', $vars, NULL); -$size = 'tiny'; - -if ($entity) { - echo videolist_get_entity_icon_url($entity, $size); -}
\ No newline at end of file diff --git a/views/default/icon/object/videolist/topbar.php b/views/default/icon/object/videolist/topbar.php deleted file mode 100644 index 82b38c0a0..000000000 --- a/views/default/icon/object/videolist/topbar.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Display a video's icon. - */ - -$entity = elgg_get_array_value('entity', $vars, NULL); -$size = 'topbar'; - -if ($entity) { - echo videolist_get_entity_icon_url($entity, $size); -}
\ No newline at end of file diff --git a/views/default/icon/object/videolist_item.php b/views/default/icon/object/videolist_item.php new file mode 100644 index 000000000..38b805021 --- /dev/null +++ b/views/default/icon/object/videolist_item.php @@ -0,0 +1,46 @@ +<?php +/** + * Generic icon view. + * + * @package Elgg + * @subpackage Core + * + * @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'); +$img_width = array('tiny' => 25, 'small' => 40, 'medium' => 100, 'large' => 200); + +// Get size +if (!in_array($vars['size'], $sizes)) { + $size = "medium"; +} else { + $size = $vars['size']; +} + +if (isset($entity->name)) { + $title = $entity->name; +} else { + $title = $entity->title; +} + +$url = $entity->getURL(); +if (isset($vars['href'])) { + $url = $vars['href']; +} + +$img_src = $entity->getIconURL($vars['size']); +$img = "<img src=\"$img_src\" alt=\"$title\" width=\"{$img_width[$size]}\" />"; + +if ($url) { + echo elgg_view('output/url', array( + 'href' => $url, + 'text' => $img, + )); +} else { + echo $img; +} |