aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/embed/README.txt2
-rw-r--r--mod/embed/views/default/embed/item.php2
-rw-r--r--mod/embed/views/default/js/embed/embed.php2
-rw-r--r--mod/file/views/default/icon/object/file.php15
-rw-r--r--views/default/icon/default.php5
5 files changed, 17 insertions, 9 deletions
diff --git a/mod/embed/README.txt b/mod/embed/README.txt
index cecee08c0..51b120d96 100644
--- a/mod/embed/README.txt
+++ b/mod/embed/README.txt
@@ -53,7 +53,7 @@ CONTENTS:
rendered.
If creating a custom list, the <li> elements must have a class of .embed-item.
- The HTML content that is inserted must use the class .elgg-image.
+ The HTML content that is inserted must use the class .embed-insert.
4. Populating an Upload Tab
diff --git a/mod/embed/views/default/embed/item.php b/mod/embed/views/default/embed/item.php
index 4087b7408..3060de879 100644
--- a/mod/embed/views/default/embed/item.php
+++ b/mod/embed/views/default/embed/item.php
@@ -34,6 +34,6 @@ $params = array(
);
$body = elgg_view('object/elements/summary', $params);
-$image = elgg_view_entity_icon($entity, 'small');
+$image = elgg_view_entity_icon($entity, 'small', array('link_class' => 'embed-insert'));
echo elgg_view_image_block($image, $body);
diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php
index bb80919a9..3126e12f7 100644
--- a/mod/embed/views/default/js/embed/embed.php
+++ b/mod/embed/views/default/js/embed/embed.php
@@ -34,7 +34,7 @@ elgg.embed.insert = function(event) {
var textArea = $('#' + textAreaId);
// generalize this based on a css class attached to what should be inserted
- var content = ' ' + $(this).find(".elgg-image").html() + ' ';
+ var content = ' ' + $(this).find(".embed-insert").parent().html() + ' ';
textArea.val(textArea.val() + content);
textArea.focus();
diff --git a/mod/file/views/default/icon/object/file.php b/mod/file/views/default/icon/object/file.php
index 6357d418f..7feba7af3 100644
--- a/mod/file/views/default/icon/object/file.php
+++ b/mod/file/views/default/icon/object/file.php
@@ -2,9 +2,10 @@
/**
* File icon view
*
- * @uses $vars['entity'] The entity the icon represents - uses getIconURL() method
- * @uses $vars['size'] topbar, tiny, small, medium (default), large, master
- * @uses $vars['href'] Optional override for link
+ * @uses $vars['entity'] The entity the icon represents - uses getIconURL() method
+ * @uses $vars['size'] topbar, tiny, small, medium (default), large, master
+ * @uses $vars['href'] Optional override for link
+ * @uses $vars['link_class'] Optional CSS class added to img
*/
$entity = $vars['entity'];
@@ -32,10 +33,14 @@ $img_src = elgg_format_url($img_src);
$img = "<img $class src=\"$img_src\" alt=\"$title\" />";
if ($url) {
- echo elgg_view('output/url', array(
+ $params = array(
'href' => $url,
'text' => $img,
- ));
+ );
+ if (isset($vars['link_class'])) {
+ $params['class'] = $vars['link_class'];
+ }
+ echo elgg_view('output/url', $params);
} else {
echo $img;
}
diff --git a/views/default/icon/default.php b/views/default/icon/default.php
index c5749ba04..3abd96b96 100644
--- a/views/default/icon/default.php
+++ b/views/default/icon/default.php
@@ -8,6 +8,7 @@
* @uses $vars['entity'] The entity the icon represents - uses getIconURL() method
* @uses $vars['size'] topbar, tiny, small, medium (default), large, master
* @uses $vars['href'] Optional override for link
+ * @uses $vars['img_class'] Optional CSS class added to img
*/
$entity = $vars['entity'];
@@ -18,6 +19,8 @@ if (!in_array($vars['size'], $sizes)) {
$vars['size'] = "medium";
}
+$class = elgg_extract('img_class', $vars, '');
+
if (isset($entity->name)) {
$title = $entity->name;
} else {
@@ -30,7 +33,7 @@ if (isset($vars['href'])) {
}
$img_src = $entity->getIconURL($vars['size']);
-$img = "<img src=\"$img_src\" alt=\"$title\" />";
+$img = "<img $class src=\"$img_src\" alt=\"$title\" />";
if ($url) {
echo elgg_view('output/url', array(