aboutsummaryrefslogtreecommitdiff
path: root/views
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
parentc07236c9235ddf86830a780465e9c0bf57cc2b9f (diff)
downloadelgg-2d806df7a3ffe4ec57781ada8829b3b86bd91632.tar.gz
elgg-2d806df7a3ffe4ec57781ada8829b3b86bd91632.tar.bz2
Video icons.
Diffstat (limited to 'views')
-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
-rw-r--r--views/default/object/videolist_item.php3
8 files changed, 47 insertions, 68 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;
+}
diff --git a/views/default/object/videolist_item.php b/views/default/object/videolist_item.php
index 2a08508bb..2be1f2a9a 100644
--- a/views/default/object/videolist_item.php
+++ b/views/default/object/videolist_item.php
@@ -27,8 +27,7 @@ $owner_link = elgg_view('output/url', array(
));
$author_text = elgg_echo('byline', array($owner_link));
-$entity_icon = elgg_view_entity_icon($entity, 'small');
-
+$entity_icon = elgg_view_entity_icon($entity, 'medium');
$owner_icon = elgg_view_entity_icon($owner, 'small');
$tags = elgg_view('output/tags', array('tags' => $entity->tags));