diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-03-01 08:38:17 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-03-01 08:38:17 +0100 |
commit | 844bef5070b071aa5ddf823036d2fe2285b40a7b (patch) | |
tree | 129a67cbed69c4ed6f286e9a0bf3770b9c82ffc6 /Zotlabs/Widget | |
parent | 97e329906e3cde0bacafcceb94780bedd44f1f32 (diff) | |
parent | 6210b7727f6c8542daaa62d1ed7f9ec1f74323f2 (diff) | |
download | volse-hubzilla-844bef5070b071aa5ddf823036d2fe2285b40a7b.tar.gz volse-hubzilla-844bef5070b071aa5ddf823036d2fe2285b40a7b.tar.bz2 volse-hubzilla-844bef5070b071aa5ddf823036d2fe2285b40a7b.zip |
Merge branch 'dev' into 3.2RC
Diffstat (limited to 'Zotlabs/Widget')
-rw-r--r-- | Zotlabs/Widget/Newmember.php | 83 | ||||
-rw-r--r-- | Zotlabs/Widget/Settings_menu.php | 6 |
2 files changed, 86 insertions, 3 deletions
diff --git a/Zotlabs/Widget/Newmember.php b/Zotlabs/Widget/Newmember.php new file mode 100644 index 000000000..898942ccc --- /dev/null +++ b/Zotlabs/Widget/Newmember.php @@ -0,0 +1,83 @@ +<?php + +namespace Zotlabs\Widget; + +class Newmember { + + function widget($arr) { + + if(! local_channel()) + return EMPTY_STR; + + $c = \App::get_channel(); + if(! $c) + return EMPTY_STR; + + + $a = \App::get_account(); + if(! $a) + return EMPTY_STR; + + + if(datetime_convert('UTC','UTC',$a['account_created']) < datetime_convert('UTC','UTC', 'now - 60 days')) + return EMPTY_STR; + + // This could be a new account that was used to clone a very old channel + + $ob = \App::get_observer(); + if($ob && array_key_exists('xchan_name_date',$ob) && $ob['xchan_name_date'] < datetime_convert('UTC','UTC','now - 60 days')) + return EMPTY_STR; + + + $options = [ + t('Profile Creation'), + [ + 'profile_photo' => t('Upload profile photo'), + 'cover_photo' => t('Upload cover photo'), + 'profiles' => t('Edit your profile'), + ], + + t('Find and Connect with others'), + [ + 'directory' => t('View the channel directory'), + 'suggest' => t('View friend suggestions'), + 'connections' => t('Manage your connections'), + ], + + t('Communicate'), + [ + 'channel/' . $channel['channel_address'] => t('View your channel homepage'), + 'network' => t('View your network stream'), + ], + + t('Miscellaneous'), + [ + 'settings' => t('Settings'), + 'help' => t('Documentation'), + ] + ]; + + $site_firehose = ((intval(get_config('system','site_firehose',0))) ? true : false); + $net_firehose = ((get_config('system','disable_discover_tab',1)) ? false : true); + + + // hack to put this in the correct spot of the array + + if($site_firehose || $net_firehose) { + $options[5]['pubstream'] = t('View public stream. Warning: not moderated'); + } + + $o = replace_macros(get_markup_template('new_member.tpl'), [ + '$title' => t('New Member Links'), + '$options' => $options + + ]); + + return $o; + + } + +} + + + diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index e15ed96a5..455fdcb9b 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -54,7 +54,7 @@ class Settings_menu { } $tabs[] = array( - 'label' => t('Feature/Addon settings'), + 'label' => t('Addon settings'), 'url' => z_root().'/settings/featured', 'selected' => ((argv(1) === 'featured') ? 'active' : ''), ); @@ -79,7 +79,7 @@ class Settings_menu { 'selected' => '' ); - if(get_account_techlevel() > 0) { + if(feature_enabled(local_channel(),'oauth_clients')) { $tabs[] = array( 'label' => t('Connected apps'), 'url' => z_root() . '/settings/oauth', @@ -87,7 +87,7 @@ class Settings_menu { ); } - if(get_account_techlevel() > 2) { + if(feature_enabled(local_channel(),'access_tokens')) { $tabs[] = array( 'label' => t('Guest Access Tokens'), 'url' => z_root() . '/settings/tokens', |