aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/views/default/bookmarks/bookmarklet.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/bookmarks/views/default/bookmarks/bookmarklet.php')
-rw-r--r--mod/bookmarks/views/default/bookmarks/bookmarklet.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php
new file mode 100644
index 000000000..b3e9737fe
--- /dev/null
+++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Bookmarklet
+ *
+ * @package Bookmarks
+ */
+
+$page_owner = elgg_get_page_owner_entity();
+
+if ($page_owner instanceof ElggGroup) {
+ $title = elgg_echo("bookmarks:this:group", array($page_owner->name));
+} else {
+ $title = elgg_echo("bookmarks:this");
+}
+
+$guid = $page_owner->getGUID();
+
+if (!$name && ($user = elgg_get_logged_in_user_entity())) {
+ $name = $user->username;
+}
+
+$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 . "</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>