aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/views/default/embed/item.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-10-01 12:42:00 -0400
committercash <cash.costello@gmail.com>2011-10-01 12:42:00 -0400
commitc7b0817dabd1ea596086b03569d4480355e5f721 (patch)
tree41da241f906243771130b3df92ff4180f30ffeb8 /mod/embed/views/default/embed/item.php
parent7c52743cc264e258d55c42dccde021b1032f2358 (diff)
downloadelgg-c7b0817dabd1ea596086b03569d4480355e5f721.tar.gz
elgg-c7b0817dabd1ea596086b03569d4480355e5f721.tar.bz2
using the menu system for the embed tabs and adding a reusable select list view
Diffstat (limited to 'mod/embed/views/default/embed/item.php')
-rw-r--r--mod/embed/views/default/embed/item.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/mod/embed/views/default/embed/item.php b/mod/embed/views/default/embed/item.php
new file mode 100644
index 000000000..a64a67d8b
--- /dev/null
+++ b/mod/embed/views/default/embed/item.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Embeddable content list item view
+ *
+ * @uses $vars['entity']
+ */
+
+$entity = $vars['entity'];
+
+$image = elgg_view_entity_icon($entity, 'small');
+
+$body = "<h4>" . $entity->title . "</h4>";
+
+$icon = "<img src=\"{$entity->getIconURL('small')}\" />";
+
+$embed_code = elgg_view('output/url', array(
+ 'href' => $entity->getURL(),
+ 'title' => $title,
+ 'text' => $icon,
+ 'encode_text' => FALSE
+));
+
+
+echo "<div class=\"embed_data\" id=\"embed_{$entity->getGUID()}\">";
+echo elgg_view_image_block($image, $body);
+echo '</div>';
+
+// @todo JS 1.8: is this approach better than inline js?
+echo "<script type=\"text/javascript\">
+ $('#embed_{$entity->getGUID()}').data('embed_code', " . json_encode($embed_code) . ");
+</script>";