aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/views/default/embed/layouts/list.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-03 14:38:18 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-03 14:38:18 +0000
commitd56c072a940ef3084e6d47b45f62767c939cf5b8 (patch)
treed0761c60a5ce8a1101f0cc7d5c610b78939bc992 /mod/embed/views/default/embed/layouts/list.php
parent7d01d0bab8b077ed2367a823a1a8d25d676a43da (diff)
downloadelgg-d56c072a940ef3084e6d47b45f62767c939cf5b8.tar.gz
elgg-d56c072a940ef3084e6d47b45f62767c939cf5b8.tar.bz2
Moved most of the logic for embed viewing into a single place.
Added gallery support (still no CSS). git-svn-id: http://code.elgg.org/elgg/trunk@6339 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/embed/views/default/embed/layouts/list.php')
-rw-r--r--mod/embed/views/default/embed/layouts/list.php55
1 files changed, 3 insertions, 52 deletions
diff --git a/mod/embed/views/default/embed/layouts/list.php b/mod/embed/views/default/embed/layouts/list.php
index d62d35417..0a1a299f0 100644
--- a/mod/embed/views/default/embed/layouts/list.php
+++ b/mod/embed/views/default/embed/layouts/list.php
@@ -2,59 +2,10 @@
/**
* Embed - List items
*
- * @todo Yes this is a lot of logic for a view. The Javascript is faily complicated
- * and pulling entity views out was making it worse.
- * Once plugin deps are working, we'll remove the logic for that.
- *
- * @uses array $vars['items'] Array of ElggEntities
- * @uses string $vars['section'] The section_id.
+ * @uses string $vars['content'] Pre-formatted content.
*
*/
-$items = isset($vars['items']) ? $vars['items'] : array();
-$section = $vars['section'];
-
-// pull out some common tests
-// embed requires ECML, but until we have plugin deps working
-// we need to explicitly check and use a fallback.
-if ($ecml_enabled = is_plugin_enabled('ecml')){
- $ecml_valid_keyword = ecml_is_valid_keyword($section);
-} else {
- $ecml_valid_keyword = FALSE;
-}
-
-// check if we have an override for this section type.
-$view = "embed/$section/item/list";
-if (!elgg_view_exists($view)) {
- $view = "embed/item/list";
-}
-
-$content = '';
-foreach ($items as $item) {
- // sanity checking
- if (!elgg_instanceof($item)) {
- continue;
- }
-
- $params = array(
- 'section' => $section,
- 'item' => $item,
- 'ecml_enabled' => $ecml_enabled,
- 'ecml_keyword' => ($ecml_valid_keyword) ? $section : 'entity'
- );
-
- $content .= elgg_view($view, $params);
-}
-
-echo $content;
-
-?>
+$content = elgg_get_array_value('content', $vars, '');
-<script type="text/javascript">
-$(document).ready(function() {
- $('.embed_data').click(function() {
- var embed_code = $(this).data('embed_code');
- elggEmbedInsertContent(embed_code);
- });
-});
-</script> \ No newline at end of file
+echo $content; \ No newline at end of file