aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Bookmarks.php
diff options
context:
space:
mode:
authormjfriaza <mjfriaza@disroot.org>2022-05-17 13:44:06 +0200
committermjfriaza <mjfriaza@disroot.org>2022-05-17 13:44:06 +0200
commita75c61d71efebf43713026200aa0f513bd7eef09 (patch)
tree909048adeaa329813e2530d43626ed3bd711bc25 /Zotlabs/Module/Bookmarks.php
parent481ecee9e87342ca7a1217395085e95d1a3b61ea (diff)
parent0d0f73fb67bbfcc53058cefded85ac36f951c7a7 (diff)
downloadvolse-hubzilla-a75c61d71efebf43713026200aa0f513bd7eef09.tar.gz
volse-hubzilla-a75c61d71efebf43713026200aa0f513bd7eef09.tar.bz2
volse-hubzilla-a75c61d71efebf43713026200aa0f513bd7eef09.zip
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'Zotlabs/Module/Bookmarks.php')
-rw-r--r--Zotlabs/Module/Bookmarks.php64
1 files changed, 31 insertions, 33 deletions
diff --git a/Zotlabs/Module/Bookmarks.php b/Zotlabs/Module/Bookmarks.php
index 822b18308..659884fed 100644
--- a/Zotlabs/Module/Bookmarks.php
+++ b/Zotlabs/Module/Bookmarks.php
@@ -18,31 +18,31 @@ class Bookmarks extends \Zotlabs\Web\Controller {
$item_id = (isset($_REQUEST['item']) ? $_REQUEST['item'] : false);
$burl = (isset($_REQUEST['burl']) ? trim($_REQUEST['burl']) : '');
-
+
if(! $item_id)
return;
-
+
$u = \App::get_channel();
-
+
$item_normal = item_normal();
-
+
$i = q("select * from item where id = %d and uid = %d $item_normal limit 1",
intval($item_id),
intval(local_channel())
);
-
+
if(! $i)
return;
-
+
$i = fetch_post_tags($i);
-
+
$item = $i[0];
-
+
$terms = (x($item, 'term') ? get_terms_oftype($item['term'],TERM_BOOKMARK) : false);
-
+
if($terms) {
require_once('include/bookmarks.php');
-
+
$s = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($item['author_xchan'])
);
@@ -58,13 +58,13 @@ class Bookmarks extends \Zotlabs\Web\Controller {
}
else
bookmark_add($u,$s[0],$t,$item['item_private']);
-
+
info( t('Bookmark added') . EOL);
}
}
killme();
}
-
+
function get() {
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
@@ -74,49 +74,47 @@ class Bookmarks extends \Zotlabs\Web\Controller {
if(! Apps::system_app_installed(local_channel(), 'Bookmarks')) {
//Do not display any associated widgets at this point
App::$pdl = '';
-
- $o = '<b>' . t('Bookmarks App') . ' (' . t('Not Installed') . '):</b><br>';
- $o .= t('Bookmark links from posts and manage them');
- return $o;
+ $papp = Apps::get_papp('Bookmarks');
+ return Apps::app_render($papp, 'module');
}
-
+
require_once('include/menu.php');
require_once('include/conversation.php');
-
+
$channel = \App::get_channel();
-
+
$o = '';
-
+
$o .= '<div class="generic-content-wrapper-styled">';
-
- $o .= '<h3>' . t('My Bookmarks') . '</h3>';
-
+
+ $o .= '<h3>' . t('Bookmarks') . '</h3>';
+
$x = menu_list(local_channel(),'',MENU_BOOKMARK);
-
+
if($x) {
foreach($x as $xx) {
$y = menu_fetch($xx['menu_name'],local_channel(),get_observer_hash());
$o .= menu_render($y,'',true);
}
}
-
+
$o .= '<h3>' . t('My Connections Bookmarks') . '</h3>';
-
-
+
+
$x = menu_list(local_channel(),'',MENU_SYSTEM|MENU_BOOKMARK);
-
+
if($x) {
foreach($x as $xx) {
$y = menu_fetch($xx['menu_name'],local_channel(),get_observer_hash());
$o .= menu_render($y,'',true);
}
}
-
+
$o .= '</div>';
-
+
return $o;
-
+
}
-
-
+
+
}