]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Embed hooks now accept icon_size for displaying items in gallery / list view.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 9 Jun 2010 17:34:01 +0000 (17:34 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 9 Jun 2010 17:34:01 +0000 (17:34 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6426 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/embed/views/default/embed/embed.php
mod/embed/views/default/embed/item/gallery.php
mod/embed/views/default/embed/item/list.php

index 68c7cd5f58adbeae7eda1df581fc139333b272bf..e90d28005cde09d2a07cac8d7da3030186feb0f3 100644 (file)
@@ -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);
index a302412f65c507540b2122bb7aaf81949c198a18..09cab3cefc694929efd8bf99a1e53cb947e7ff92 100644 (file)
@@ -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));
index 259419df40d1f047c2314b3de324fd53dc5cf7c8..027d389bd6226dffc7f909742b369b70dc9c5030 100644 (file)
@@ -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?