appify mood

This commit is contained in:
Mario Vavti 2018-09-15 11:00:41 +02:00
parent 0f9a8a43e4
commit 299eb469f8
2 changed files with 24 additions and 3 deletions

View File

@ -21,6 +21,10 @@ class Invite extends Controller {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }
if(! Apps::system_app_installed(local_channel(), 'Invite')) {
return;
}
check_form_security_token_redirectOnErr('/', 'send_invite'); check_form_security_token_redirectOnErr('/', 'send_invite');

View File

@ -1,21 +1,29 @@
<?php <?php
namespace Zotlabs\Module; namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
require_once('include/security.php'); require_once('include/security.php');
require_once('include/bbcode.php'); require_once('include/bbcode.php');
require_once('include/items.php'); require_once('include/items.php');
class Mood extends \Zotlabs\Web\Controller { class Mood extends Controller {
function init() { function init() {
if(! local_channel()) if(! local_channel())
return; return;
if(! Apps::system_app_installed(local_channel(), 'Mood')) {
return;
}
$uid = local_channel(); $uid = local_channel();
$channel = \App::get_channel(); $channel = App::get_channel();
$verb = notags(trim($_GET['verb'])); $verb = notags(trim($_GET['verb']));
if(! $verb) if(! $verb)
@ -60,7 +68,7 @@ class Mood extends \Zotlabs\Web\Controller {
$deny_gid = $channel['channel_deny_gid']; $deny_gid = $channel['channel_deny_gid'];
} }
$poster = \App::get_observer(); $poster = App::get_observer();
$mid = item_message_id(); $mid = item_message_id();
@ -117,6 +125,15 @@ class Mood extends \Zotlabs\Web\Controller {
return; return;
} }
if(! Apps::system_app_installed(local_channel(), 'Mood')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>Mood App (Not Installed):</b><br>';
$o .= t('Set your current mood and tell your friends');
return $o;
}
nav_set_selected('Mood'); nav_set_selected('Mood');
$parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : '0'); $parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : '0');