aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Rbmark.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-05-27 09:45:39 +0000
committerMario <mario@mariovavti.com>2021-05-27 09:45:39 +0000
commit7776283a479e24955f45eb9993d93d4dde87956a (patch)
tree6e7638301d13f74038a5c769f5a06867f37832c3 /Zotlabs/Module/Rbmark.php
parentc9d4802bf14cd135a75f89e4aa06976dfd628af5 (diff)
downloadvolse-hubzilla-7776283a479e24955f45eb9993d93d4dde87956a.tar.gz
volse-hubzilla-7776283a479e24955f45eb9993d93d4dde87956a.tar.bz2
volse-hubzilla-7776283a479e24955f45eb9993d93d4dde87956a.zip
remove zot includes
Diffstat (limited to 'Zotlabs/Module/Rbmark.php')
-rw-r--r--Zotlabs/Module/Rbmark.php67
1 files changed, 33 insertions, 34 deletions
diff --git a/Zotlabs/Module/Rbmark.php b/Zotlabs/Module/Rbmark.php
index 226cef69e..87b774495 100644
--- a/Zotlabs/Module/Rbmark.php
+++ b/Zotlabs/Module/Rbmark.php
@@ -6,12 +6,11 @@ require_once('include/crypto.php');
require_once('include/items.php');
require_once('include/taxonomy.php');
require_once('include/conversation.php');
-require_once('include/zot.php');
require_once('include/bookmarks.php');
/**
* remote bookmark
- *
+ *
* https://yoursite/rbmark?f=&title=&url=&private=&remote_return=
*
* This can be called via either GET or POST, use POST for long body content as suhosin often limits GET parameter length
@@ -31,45 +30,45 @@ class Rbmark extends \Zotlabs\Web\Controller {
function post() {
if($_POST['submit'] !== t('Save'))
return;
-
+
logger('rbmark_post: ' . print_r($_REQUEST,true));
-
+
$channel = \App::get_channel();
-
+
$t = array('url' => escape_tags($_REQUEST['url']),'term' => escape_tags($_REQUEST['title']));
bookmark_add($channel,$channel,$t,((x($_REQUEST,'private')) ? intval($_REQUEST['private']) : 0),
array('menu_id' => ((x($_REQUEST,'menu_id')) ? intval($_REQUEST['menu_id']) : 0),
'menu_name' => ((x($_REQUEST,'menu_name')) ? escape_tags($_REQUEST['menu_name']) : ''),
'ischat' => ((x($_REQUEST['ischat'])) ? intval($_REQUEST['ischat']) : 0)
));
-
+
goaway(z_root() . '/bookmarks');
-
+
}
-
-
+
+
function get() {
-
+
$o = '';
-
+
if(! local_channel()) {
-
+
// The login procedure is going to bugger our $_REQUEST variables
// so save them in the session.
-
+
if(array_key_exists('url',$_REQUEST)) {
$_SESSION['bookmark'] = $_REQUEST;
}
return login();
}
-
+
// If we have saved rbmark session variables, but nothing in the current $_REQUEST, recover the saved variables
-
+
if((! array_key_exists('url',$_REQUEST)) && (array_key_exists('bookmark',$_SESSION))) {
$_REQUEST = $_SESSION['bookmark'];
unset($_SESSION['bookmark']);
}
-
+
if($_REQUEST['remote_return']) {
$_SESSION['remote_return'] = $_REQUEST['remote_return'];
}
@@ -78,12 +77,12 @@ class Rbmark extends \Zotlabs\Web\Controller {
goaway($_SESSION['remote_return']);
goaway(z_root() . '/bookmarks');
}
-
+
$channel = \App::get_channel();
-
-
+
+
$m = menu_list($channel['channel_id'],'',MENU_BOOKMARK);
-
+
$menus = array();
if($m) {
$menus = array(0 => '');
@@ -92,10 +91,10 @@ class Rbmark extends \Zotlabs\Web\Controller {
}
}
$menu_select = array('menu_id',t('Select a bookmark folder'),false,'',$menus);
-
-
+
+
$o .= replace_macros(get_markup_template('rbmark.tpl'), array(
-
+
'$header' => t('Save Bookmark'),
'$url' => array('url',t('URL of bookmark'),escape_tags($_REQUEST['url'])),
'$title' => array('title',t('Description'),escape_tags($_REQUEST['title'])),
@@ -104,18 +103,18 @@ class Rbmark extends \Zotlabs\Web\Controller {
'$submit' => t('Save'),
'$menu_name' => array('menu_name',t('Or enter new bookmark folder name'),'',''),
'$menus' => $menu_select
-
+
));
-
-
-
-
-
-
+
+
+
+
+
+
return $o;
-
+
}
-
-
-
+
+
+
}