3 * @file mod/bookmarklet.php
7 use Friendica\Core\ACL;
8 use Friendica\Core\L10n;
9 use Friendica\Core\System;
10 use Friendica\Module\Login;
12 require_once 'include/conversation.php';
13 require_once 'include/items.php';
15 function bookmarklet_init()
17 $_GET["mode"] = "minimal";
20 function bookmarklet_content(App $a)
23 $o = '<h2>' . L10n::t('Login') . '</h2>';
24 $o .= Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? false : true);
28 $referer = normalise_link($_SERVER["HTTP_REFERER"]);
29 $page = normalise_link(System::baseUrl() . "/bookmarklet");
31 if (!strstr($referer, $page)) {
32 $content = add_page_info($_REQUEST["url"]);
36 'allow_location' => $a->user['allow_location'],
37 'default_location' => $a->user['default-location'],
38 'nickname' => $a->user['nickname'],
39 'lockstate' => ((is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid'])))) ? 'lock' : 'unlock'),
40 'default_perms' => ACL::getDefaultUserPermissions($a->user),
41 'acl' => ACL::getFullSelectorHTML($a->user, true),
44 'profile_uid' => local_user(),
45 'title' => trim($_REQUEST["title"], "*"),
48 $o = status_editor($a, $x, 0, false);
49 $o .= "<script>window.resizeTo(800,550);</script>";
51 $o = '<h2>' . L10n::t('The post was created') . '</h2>';
52 $o .= "<script>window.close()</script>";