aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/views/default/bookmarks/bookmarklet.php
blob: 119b9d107c2e345e517c2f3517e8d6e74d12cad7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?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();

$bookmarklet = "<a href=\"javascript:location.href='{$url}pg/bookmarks/add/$guid?address='"
	. "+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">"
	. "<img src=\"{$url}_graphics/elgg_bookmarklet.gif\" border=\"0\" title=\"$title\" /> </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>