aboutsummaryrefslogtreecommitdiff
path: root/mod/embed
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-09 17:34:01 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-09 17:34:01 +0000
commit5d627485b32dc1dd7ea94c7a4c4f4ee585360452 (patch)
tree8a27fa80e9979904ee9254db6f53174276c8568c /mod/embed
parenta42f17407fe453539d4432c2f9e50518e0dd26e1 (diff)
downloadelgg-5d627485b32dc1dd7ea94c7a4c4f4ee585360452.tar.gz
elgg-5d627485b32dc1dd7ea94c7a4c4f4ee585360452.tar.bz2
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
Diffstat (limited to 'mod/embed')
-rw-r--r--mod/embed/views/default/embed/embed.php3
-rw-r--r--mod/embed/views/default/embed/item/gallery.php5
-rw-r--r--mod/embed/views/default/embed/item/list.php5
3 files changed, 8 insertions, 5 deletions
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 = "<img src=\"{$item->getIcon('medium')}\" />" . htmlentities($title, ENT_QUOTES, 'UTF-8');
+ $icon = "<img src=\"{$item->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 = "<img src=\"{$item->getIcon('medium')}\" />";
+$icon = "<img src=\"{$item->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 = "<img src=\"{$item->getIcon()}\" />" . htmlentities($title, ENT_QUOTES, 'UTF-8');
+ $icon = "<img src=\"{$item->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 = "<img src=\"{$item->getIcon('tiny')}\" />";
+$icon = "<img src=\"{$item->getIcon($icon_size)}\" />";
$info = htmlentities($title, ENT_QUOTES, 'UTF-8');
// @todo is this approach better than inline js?