diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-10-06 14:48:12 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-10-06 14:48:12 +0200 |
commit | c2c891723fc0e56f0c373ca1043cdb548f2ed8ab (patch) | |
tree | 999c6c76d4635152334f5848895e6f2a44752f73 | |
parent | a5e63aa90ac5a5160e55eea98beb0e867533314b (diff) | |
download | volse-hubzilla-c2c891723fc0e56f0c373ca1043cdb548f2ed8ab.tar.gz volse-hubzilla-c2c891723fc0e56f0c373ca1043cdb548f2ed8ab.tar.bz2 volse-hubzilla-c2c891723fc0e56f0c373ca1043cdb548f2ed8ab.zip |
bookmark app
-rw-r--r-- | Zotlabs/Lib/Apps.php | 2 | ||||
-rw-r--r-- | Zotlabs/Lib/ThreadItem.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Bookmarks.php | 18 | ||||
-rw-r--r-- | app/bookmarks.apd | 4 |
4 files changed, 22 insertions, 6 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 826b2db29..d7cea6b7c 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -306,7 +306,7 @@ class Apps { 'Cards' => t('Cards'), 'Admin' => t('Site Admin'), 'Report Bug' => t('Report Bug'), - 'View Bookmarks' => t('View Bookmarks'), + 'Bookmarks' => t('Bookmarks'), 'Chatrooms' => t('Chatrooms'), 'Connections' => t('Connections'), 'Remote Diagnostics' => t('Remote Diagnostics'), diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 48018f66c..78714c2c4 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -2,6 +2,8 @@ namespace Zotlabs\Lib; +use Zotlabs\Lib\Apps; + require_once('include/text.php'); /** @@ -272,7 +274,7 @@ class ThreadItem { } $has_bookmarks = false; - if(is_array($item['term'])) { + if(Apps::system_app_installed(local_channel(), 'Bookmarks') && is_array($item['term'])) { foreach($item['term'] as $t) { if(($t['ttype'] == TERM_BOOKMARK)) $has_bookmarks = true; diff --git a/Zotlabs/Module/Bookmarks.php b/Zotlabs/Module/Bookmarks.php index cee86a47d..1c4c6a513 100644 --- a/Zotlabs/Module/Bookmarks.php +++ b/Zotlabs/Module/Bookmarks.php @@ -1,6 +1,9 @@ <?php namespace Zotlabs\Module; +use App; +use Zotlabs\Lib\Apps; + class Bookmarks extends \Zotlabs\Web\Controller { @@ -8,7 +11,10 @@ class Bookmarks extends \Zotlabs\Web\Controller { if(! local_channel()) return; - nav_set_selected('View Bookmarks'); + if(! Apps::system_app_installed(local_channel(), 'Bookmarks')) + return; + + nav_set_selected('Bookmarks'); $item_id = intval($_REQUEST['item']); $burl = trim($_REQUEST['burl']); @@ -64,7 +70,15 @@ class Bookmarks extends \Zotlabs\Web\Controller { notice( t('Permission denied.') . EOL); return; } - + + 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 the item dropdown and manage them'); + return $o; + } require_once('include/menu.php'); require_once('include/conversation.php'); diff --git a/app/bookmarks.apd b/app/bookmarks.apd index 33d663217..a5e0d7bc6 100644 --- a/app/bookmarks.apd +++ b/app/bookmarks.apd @@ -1,6 +1,6 @@ -version: 1 +version: 1.1 url: $baseurl/bookmarks requires: local_channel -name: View Bookmarks +name: Bookmarks photo: icon:bookmark categories: Productivity |