From 5d627485b32dc1dd7ea94c7a4c4f4ee585360452 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 9 Jun 2010 17:34:01 +0000 Subject: Embed hooks now accept icon_size for displaying items in gallery / list view. git-svn-id: http://code.elgg.org/elgg/trunk@6426 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/embed/views/default/embed/embed.php | 3 ++- mod/embed/views/default/embed/item/gallery.php | 5 +++-- mod/embed/views/default/embed/item/list.php | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'mod/embed/views/default') diff --git a/mod/embed/views/default/embed/embed.php b/mod/embed/views/default/embed/embed.php index 68c7cd5f5..e90d28005 100644 --- a/mod/embed/views/default/embed/embed.php +++ b/mod/embed/views/default/embed/embed.php @@ -95,7 +95,8 @@ if (!$sections) { 'section' => $active_section, 'item' => $item, 'ecml_enabled' => $ecml_enabled, - 'ecml_keyword' => ($ecml_valid_keyword) ? $active_section : 'entity' + 'ecml_keyword' => ($ecml_valid_keyword) ? $active_section : 'entity', + 'icon_size' => elgg_get_array_value('icon_size', $section_info, 'tiny'), ); $items_content .= elgg_view($view, $item_params); diff --git a/mod/embed/views/default/embed/item/gallery.php b/mod/embed/views/default/embed/item/gallery.php index a302412f6..09cab3cef 100644 --- a/mod/embed/views/default/embed/item/gallery.php +++ b/mod/embed/views/default/embed/item/gallery.php @@ -16,6 +16,7 @@ $item = $vars['item']; $section = $vars['section']; $target = $vars['target']; $ecml_keyword = (isset($vars['ecml_enabled']) && isset($vars['ecml_keyword'])) ? $vars['ecml_keyword'] : NULL; +$icon_size = $vars['icon_size']; // @todo add entity checking. @@ -31,7 +32,7 @@ if ($ecml_keyword) { $embed_code = "[$ecml_keyword guid={$item->getGUID()}]"; } else { // fallback to inserting a hard link to the object with its icon - $icon = "getIcon('medium')}\" />" . htmlentities($title, ENT_QUOTES, 'UTF-8'); + $icon = "getIcon($icon_size)}\" />" . htmlentities($title, ENT_QUOTES, 'UTF-8'); $embed_code = elgg_view('output/url', array( 'href' => $item->getURL(), @@ -41,7 +42,7 @@ if ($ecml_keyword) { )); } -$icon = "getIcon('medium')}\" />"; +$icon = "getIcon($icon_size)}\" />"; $info = htmlentities($title, ENT_QUOTES, 'UTF-8'); $listing = elgg_view('entities/gallery_listing', array('icon' => $icon, 'info' => $info)); diff --git a/mod/embed/views/default/embed/item/list.php b/mod/embed/views/default/embed/item/list.php index 259419df4..027d389bd 100644 --- a/mod/embed/views/default/embed/item/list.php +++ b/mod/embed/views/default/embed/item/list.php @@ -14,6 +14,7 @@ $item = $vars['item']; $section = $vars['section']; $target = $vars['target']; $ecml_keyword = (isset($vars['ecml_enabled']) && isset($vars['ecml_keyword'])) ? $vars['ecml_keyword'] : NULL; +$icon_size = $vars['icon_size']; // @todo add entity checking. @@ -29,7 +30,7 @@ if ($ecml_keyword) { $embed_code = "[$ecml_keyword guid={$item->getGUID()}]"; } else { // fallback to inserting a hard link to the object with its icon - $icon = "getIcon()}\" />" . htmlentities($title, ENT_QUOTES, 'UTF-8'); + $icon = "getIcon($icon_size)}\" />" . htmlentities($title, ENT_QUOTES, 'UTF-8'); $embed_code = elgg_view('output/url', array( 'href' => $item->getURL(), @@ -39,7 +40,7 @@ if ($ecml_keyword) { )); } -$icon = "getIcon('tiny')}\" />"; +$icon = "getIcon($icon_size)}\" />"; $info = htmlentities($title, ENT_QUOTES, 'UTF-8'); // @todo is this approach better than inline js? -- cgit v1.2.3