aboutsummaryrefslogtreecommitdiff
path: root/views/default/icon/object
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2011-11-08 21:44:25 +0100
committerSem <sembrestels@riseup.net>2011-11-08 21:44:25 +0100
commit2d806df7a3ffe4ec57781ada8829b3b86bd91632 (patch)
tree9d3607b1c7fa733a3f920246caebd5151154e5ef /views/default/icon/object
parentc07236c9235ddf86830a780465e9c0bf57cc2b9f (diff)
downloadelgg-2d806df7a3ffe4ec57781ada8829b3b86bd91632.tar.gz
elgg-2d806df7a3ffe4ec57781ada8829b3b86bd91632.tar.bz2
Video icons.
Diffstat (limited to 'views/default/icon/object')
-rw-r--r--views/default/icon/object/videolist/large.php11
-rw-r--r--views/default/icon/object/videolist/master.php11
-rw-r--r--views/default/icon/object/videolist/medium.php11
-rw-r--r--views/default/icon/object/videolist/small.php11
-rw-r--r--views/default/icon/object/videolist/tiny.php11
-rw-r--r--views/default/icon/object/videolist/topbar.php11
-rw-r--r--views/default/icon/object/videolist_item.php46
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;
+}