aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/views
diff options
context:
space:
mode:
Diffstat (limited to 'mod/bookmarks/views')
-rw-r--r--mod/bookmarks/views/default/bookmarks/bookmarklet.php9
-rw-r--r--mod/bookmarks/views/default/bookmarks/group_module.php2
-rw-r--r--mod/bookmarks/views/default/bookmarks/js.php2
-rw-r--r--mod/bookmarks/views/default/object/bookmarks.php28
-rw-r--r--mod/bookmarks/views/default/river/object/bookmarks/create.php2
-rw-r--r--mod/bookmarks/views/default/widgets/bookmarks/content.php1
-rw-r--r--mod/bookmarks/views/default/widgets/bookmarks/edit.php8
-rw-r--r--mod/bookmarks/views/rss/object/bookmarks.php36
8 files changed, 56 insertions, 32 deletions
diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php
index 1d0b25498..b3e9737fe 100644
--- a/mod/bookmarks/views/default/bookmarks/bookmarklet.php
+++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php
@@ -20,13 +20,16 @@ if (!$name && ($user = elgg_get_logged_in_user_entity())) {
}
$url = elgg_get_site_url();
-
+$img = elgg_view('output/img', array(
+ 'src' => 'mod/bookmarks/graphics/bookmarklet.gif',
+ 'alt' => $title,
+));
$bookmarklet = "<a href=\"javascript:location.href='{$url}bookmarks/add/$guid?address='"
. "+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">"
- . "<img src=\"{$url}mod/bookmarks/graphics/bookmarklet.gif\" alt=\"$title\" /> </a>";
+ . $img . "</a>";
?>
<p><?php echo elgg_echo("bookmarks:bookmarklet:description"); ?></p>
<p><?php echo $bookmarklet; ?></p>
<p><?php echo elgg_echo("bookmarks:bookmarklet:descriptionie"); ?></p>
-<p><?php echo elgg_echo("bookmarks:bookmarklet:description:conclusion"); ?></p> \ No newline at end of file
+<p><?php echo elgg_echo("bookmarks:bookmarklet:description:conclusion"); ?></p>
diff --git a/mod/bookmarks/views/default/bookmarks/group_module.php b/mod/bookmarks/views/default/bookmarks/group_module.php
index 3797de010..60a727819 100644
--- a/mod/bookmarks/views/default/bookmarks/group_module.php
+++ b/mod/bookmarks/views/default/bookmarks/group_module.php
@@ -14,6 +14,7 @@ if ($group->bookmarks_enable == "no") {
$all_link = elgg_view('output/url', array(
'href' => "bookmarks/group/$group->guid/all",
'text' => elgg_echo('link:view:all'),
+ 'is_trusted' => true,
));
elgg_push_context('widgets');
@@ -35,6 +36,7 @@ if (!$content) {
$new_link = elgg_view('output/url', array(
'href' => "bookmarks/add/$group->guid",
'text' => elgg_echo('bookmarks:add'),
+ 'is_trusted' => true,
));
echo elgg_view('groups/profile/module', array(
diff --git a/mod/bookmarks/views/default/bookmarks/js.php b/mod/bookmarks/views/default/bookmarks/js.php
index 0e55c510a..c36823c09 100644
--- a/mod/bookmarks/views/default/bookmarks/js.php
+++ b/mod/bookmarks/views/default/bookmarks/js.php
@@ -7,6 +7,6 @@ elgg.bookmarks.init = function() {
var e = $('a.elgg-bookmark-page');
var link = e.attr('href') + '&title=' + encodeURIComponent(title);
e.attr('href', link);
-}
+};
elgg.register_hook_handler('init', 'system', elgg.bookmarks.init);
diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php
index ca1f5d312..89a0d03e0 100644
--- a/mod/bookmarks/views/default/object/bookmarks.php
+++ b/mod/bookmarks/views/default/object/bookmarks.php
@@ -17,12 +17,13 @@ $owner_icon = elgg_view_entity_icon($owner, 'tiny');
$container = $bookmark->getContainerEntity();
$categories = elgg_view('output/categories', $vars);
-$link = filter_tags(elgg_view('output/url', array('href' => $bookmark->address, 'rel' => 'nofollow')));
+$link = elgg_view('output/url', array('href' => $bookmark->address));
$description = elgg_view('output/longtext', array('value' => $bookmark->description, 'class' => 'pbl'));
$owner_link = elgg_view('output/url', array(
'href' => "bookmarks/owner/$owner->username",
'text' => $owner->name,
+ 'is_trusted' => true,
));
$author_text = elgg_echo('byline', array($owner_link));
@@ -36,6 +37,7 @@ if ($comments_count != 0) {
$comments_link = elgg_view('output/url', array(
'href' => $bookmark->getURL() . '#comments',
'text' => $text,
+ 'is_trusted' => true,
));
} else {
$comments_link = '';
@@ -48,7 +50,7 @@ $metadata = elgg_view_menu('entity', array(
'class' => 'elgg-menu-hz',
));
-$subtitle = "$author_text $date $categories $comments_link";
+$subtitle = "$author_text $date $comments_link $categories";
// do not show the metadata and controls in widget view
if (elgg_in_context('widgets')) {
@@ -56,7 +58,6 @@ if (elgg_in_context('widgets')) {
}
if ($full && !elgg_in_context('gallery')) {
- $header = elgg_view_title($bookmark->title);
$params = array(
'entity' => $bookmark,
@@ -66,19 +67,23 @@ if ($full && !elgg_in_context('gallery')) {
'tags' => $tags,
);
$params = $params + $vars;
- $list_body = elgg_view('object/elements/summary', $params);
- $bookmark_info = elgg_view_image_block($owner_icon, $list_body);
+ $summary = elgg_view('object/elements/summary', $params);
$bookmark_icon = elgg_view_icon('push-pin-alt');
- echo <<<HTML
-$header
-$bookmark_info
+ $body = <<<HTML
<div class="bookmark elgg-content mts">
$bookmark_icon<span class="elgg-heading-basic mbs">$link</span>
$description
</div>
HTML;
+ echo elgg_view('object/elements/full', array(
+ 'entity' => $bookmark,
+ 'icon' => $owner_icon,
+ 'summary' => $summary,
+ 'body' => $body,
+ ));
+
} elseif (elgg_in_context('gallery')) {
echo <<<HTML
<div class="bookmarks-gallery-item">
@@ -104,11 +109,10 @@ HTML;
}
}
- $link = filter_tags(elgg_view('output/url', array(
+ $link = elgg_view('output/url', array(
'href' => $bookmark->address,
'text' => $display_text,
- 'rel' => 'nofollow',
- )));
+ ));
$content = elgg_view_icon('push-pin-alt') . "$link{$excerpt}";
@@ -123,4 +127,4 @@ HTML;
$body = elgg_view('object/elements/summary', $params);
echo elgg_view_image_block($owner_icon, $body);
-} \ No newline at end of file
+}
diff --git a/mod/bookmarks/views/default/river/object/bookmarks/create.php b/mod/bookmarks/views/default/river/object/bookmarks/create.php
index 984d109be..388f54ac9 100644
--- a/mod/bookmarks/views/default/river/object/bookmarks/create.php
+++ b/mod/bookmarks/views/default/river/object/bookmarks/create.php
@@ -8,7 +8,7 @@
$object = $vars['item']->getObjectEntity();
$excerpt = elgg_get_excerpt($object->description);
-echo elgg_view('river/item', array(
+echo elgg_view('river/elements/layout', array(
'item' => $vars['item'],
'message' => $excerpt,
'attachments' => elgg_view('output/url', array('href' => $object->address)),
diff --git a/mod/bookmarks/views/default/widgets/bookmarks/content.php b/mod/bookmarks/views/default/widgets/bookmarks/content.php
index ea7816345..0b85017fc 100644
--- a/mod/bookmarks/views/default/widgets/bookmarks/content.php
+++ b/mod/bookmarks/views/default/widgets/bookmarks/content.php
@@ -24,6 +24,7 @@ if ($content) {
$more_link = elgg_view('output/url', array(
'href' => $url,
'text' => elgg_echo('bookmarks:more'),
+ 'is_trusted' => true,
));
echo "<span class=\"elgg-widget-more\">$more_link</span>";
} else {
diff --git a/mod/bookmarks/views/default/widgets/bookmarks/edit.php b/mod/bookmarks/views/default/widgets/bookmarks/edit.php
index 99d65ac8f..ed9c7fd88 100644
--- a/mod/bookmarks/views/default/widgets/bookmarks/edit.php
+++ b/mod/bookmarks/views/default/widgets/bookmarks/edit.php
@@ -6,13 +6,13 @@
*/
// set default value
-if (!isset($vars['entity']->max_display)) {
- $vars['entity']->max_display = 4;
+if (!isset($vars['entity']->num_display)) {
+ $vars['entity']->num_display = 4;
}
$params = array(
- 'name' => 'params[max_display]',
- 'value' => $vars['entity']->max_display,
+ 'name' => 'params[num_display]',
+ 'value' => $vars['entity']->num_display,
'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
);
$dropdown = elgg_view('input/dropdown', $params);
diff --git a/mod/bookmarks/views/rss/object/bookmarks.php b/mod/bookmarks/views/rss/object/bookmarks.php
index 8e88485f1..1abda4710 100644
--- a/mod/bookmarks/views/rss/object/bookmarks.php
+++ b/mod/bookmarks/views/rss/object/bookmarks.php
@@ -1,23 +1,37 @@
<?php
/**
- * Elgg bookmark rss view
- *
+ * Bookmark RSS object view
+ *
* @package ElggBookmarks
*/
$title = $vars['entity']->title;
if (empty($title)) {
- $title = substr($vars['entity']->description,0,32);
- if (strlen($vars['entity']->description) > 32)
- $title .= " ...";
+ $title = strip_tags($vars['entity']->description);
+ $title = elgg_get_excerpt($title, 32);
}
-?>
+$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $vars['entity']->getTimeCreated());
+$url_text = elgg_echo('bookmarks:address');
+$link = elgg_view('output/url', array('href' => $vars['entity']->address));
+$description = $vars['entity']->description . "<p>$url_text: $link</p>";
+
+$creator = elgg_view('page/components/creator', $vars);
+$georss = elgg_view('page/components/georss', $vars);
+$extension = elgg_view('extensions/item');
+
+$item = <<<__HTML
<item>
- <guid isPermaLink='true'><?php echo $vars['entity']->getURL(); ?></guid>
- <pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate>
- <link><?php echo $vars['entity']->address; ?></link>
- <title><![CDATA[<?php echo $title; ?>]]></title>
- <description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
+ <guid isPermaLink="true">$permalink</guid>
+ <pubDate>$pubdate</pubDate>
+ <link>$permalink</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[$description]]></description>
+ $creator$georss$extension
</item>
+
+__HTML;
+
+echo $item;