diff options
Diffstat (limited to 'mod/embed/views/default/embed/layouts/list.php')
-rw-r--r-- | mod/embed/views/default/embed/layouts/list.php | 55 |
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 |