diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-10-06 16:08:15 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-10-06 16:08:15 +0200 |
commit | b8991750c5d36714100d20595da6a33149bd7d5d (patch) | |
tree | f84bc4848bc47f2d099dfb0dbe196d21f05ef6bc /Zotlabs/Module | |
parent | 18726737d0116f13ec83cb2c1094a36d08980b7d (diff) | |
download | volse-hubzilla-b8991750c5d36714100d20595da6a33149bd7d5d.tar.gz volse-hubzilla-b8991750c5d36714100d20595da6a33149bd7d5d.tar.bz2 volse-hubzilla-b8991750c5d36714100d20595da6a33149bd7d5d.zip |
pubstream app
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Ping.php | 11 | ||||
-rw-r--r-- | Zotlabs/Module/Pubstream.php | 14 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Channel.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Suggest.php | 21 |
4 files changed, 41 insertions, 7 deletions
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php index baefe62ec..14627f56e 100644 --- a/Zotlabs/Module/Ping.php +++ b/Zotlabs/Module/Ping.php @@ -2,6 +2,8 @@ namespace Zotlabs\Module; +use Zotlabs\Lib\Apps; + require_once('include/bbcode.php'); /** @@ -147,9 +149,12 @@ class Ping extends \Zotlabs\Web\Controller { if(! ($vnotify & VNOTIFY_LIKE)) $sql_extra = " AND verb NOT IN ('" . dbesc(ACTIVITY_LIKE) . "', '" . dbesc(ACTIVITY_DISLIKE) . "') "; - $discover_tab_on = can_view_public_stream(); - - $notify_pubs = ((local_channel()) ? ($vnotify & VNOTIFY_PUBS) && $discover_tab_on : $discover_tab_on); + if(local_channel()) { + $notify_pubs = ($vnotify & VNOTIFY_PUBS) && can_view_public_stream() && Apps::system_app_installed(local_channel(), 'Public Stream'); + } + else { + $notify_pubs = can_view_public_stream(); + } if($notify_pubs) { $sys = get_sys_channel(); diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index 19cb72b5b..94df29984 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -1,6 +1,9 @@ <?php namespace Zotlabs\Module; +use App; +use Zotlabs\Lib\Apps; + require_once('include/conversation.php'); require_once('include/acl_selectors.php'); @@ -9,6 +12,17 @@ class Pubstream extends \Zotlabs\Web\Controller { function get($update = 0, $load = false) { + if(local_channel()) { + if(! Apps::system_app_installed(local_channel(), 'Public Stream')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>' . t('Public Stream App') . ' (' . t('Not Installed') . '):</b><br>'; + $o .= t('The unmoderated public stream of this hub'); + return $o; + } + } + if($load) $_SESSION['loadtime'] = datetime_convert(); diff --git a/Zotlabs/Module/Settings/Channel.php b/Zotlabs/Module/Settings/Channel.php index 6b49f165d..ebc444178 100644 --- a/Zotlabs/Module/Settings/Channel.php +++ b/Zotlabs/Module/Settings/Channel.php @@ -594,7 +594,7 @@ class Channel { '$vnotify10' => array('vnotify10', t('New connections'), ($vnotify & VNOTIFY_INTRO), VNOTIFY_INTRO, t('Recommended'), $yes_no), '$vnotify11' => ((is_site_admin()) ? array('vnotify11', t('System Registrations'), ($vnotify & VNOTIFY_REGISTER), VNOTIFY_REGISTER, '', $yes_no) : array()), '$vnotify12' => array('vnotify12', t('Unseen shared files'), ($vnotify & VNOTIFY_FILES), VNOTIFY_FILES, '', $yes_no), - '$vnotify13' => (($disable_discover_tab && !$site_firehose) ? array() : array('vnotify13', t('Unseen public activity'), ($vnotify & VNOTIFY_PUBS), VNOTIFY_PUBS, '', $yes_no)), + '$vnotify13' => ((($disable_discover_tab && !$site_firehose) || !Apps::system_app_installed(local_channel(), 'Public Stream')) ? array() : array('vnotify13', t('Unseen public stream activity'), ($vnotify & VNOTIFY_PUBS), VNOTIFY_PUBS, '', $yes_no)), '$vnotify14' => array('vnotify14', t('Unseen likes and dislikes'), ($vnotify & VNOTIFY_LIKE), VNOTIFY_LIKE, '', $yes_no), '$vnotify15' => array('vnotify15', t('Unseen forum posts'), ($vnotify & VNOTIFY_FORUMS), VNOTIFY_FORUMS, '', $yes_no), '$mailhost' => [ 'mailhost', t('Email notification hub (hostname)'), get_pconfig(local_channel(),'system','email_notify_host',\App::get_hostname()), sprintf( t('If your channel is mirrored to multiple hubs, set this to your preferred location. This will prevent duplicate email notifications. Example: %s'),\App::get_hostname()) ], diff --git a/Zotlabs/Module/Suggest.php b/Zotlabs/Module/Suggest.php index f79e4e245..18961214e 100644 --- a/Zotlabs/Module/Suggest.php +++ b/Zotlabs/Module/Suggest.php @@ -1,15 +1,20 @@ <?php namespace Zotlabs\Module; +use App; +use Zotlabs\Lib\Apps; + require_once('include/socgraph.php'); require_once('include/contact_widgets.php'); - class Suggest extends \Zotlabs\Web\Controller { function init() { if(! local_channel()) return; + + if(! Apps::system_app_installed(local_channel(), 'Suggest Channels')) + return; if(x($_GET,'ignore')) { q("insert into xign ( uid, xchan ) values ( %d, '%s' ) ", @@ -22,13 +27,23 @@ class Suggest extends \Zotlabs\Web\Controller { function get() { - - $o = ''; + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } + if(! Apps::system_app_installed(local_channel(), 'Suggest Channels')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>' . t('Suggest Channels App') . ' (' . t('Not Installed') . '):</b><br>'; + $o .= t('Suggestions for channels in the $Projectname network you might be interested in'); + return $o; + } + + $o = ''; + nav_set_selected('Suggest Channels'); $_SESSION['return_url'] = z_root() . '/' . \App::$cmd; |