streams/Zotlabs/Widget/Newmember.php

75 lines
1.4 KiB
PHP
Raw Normal View History

<?php
namespace Zotlabs\Widget;
2019-09-11 02:31:08 +00:00
use App;
class Newmember {
function widget($arr) {
2019-09-11 02:31:08 +00:00
if (! local_channel()) {
return EMPTY_STR;
2019-09-11 02:31:08 +00:00
}
2019-09-11 02:31:08 +00:00
$c = App::get_channel();
if (! $c) {
return EMPTY_STR;
2019-09-11 02:31:08 +00:00
}
$a = App::get_account();
if (! $a) {
return EMPTY_STR;
2019-09-11 02:31:08 +00:00
}
2019-09-11 02:31:08 +00:00
// @fixme
if (! feature_enabled(local_channel(),'start_menu')) {
return EMPTY_STR;
2019-09-11 02:31:08 +00:00
}
$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 directory'),
'directory?f=&suggest=1' => t('View friend suggestions'),
'connections' => t('Manage your connections'),
],
t('Communicate'),
[
2018-03-14 09:47:36 +00:00
'channel/' . $c['channel_address'] => t('View your channel homepage'),
2020-02-13 05:36:21 +00:00
'stream' => t('View your stream'),
],
t('Miscellaneous'),
[
'settings' => t('Settings'),
]
];
$public_stream_mode = intval(get_config('system','public_stream_mode', PUBLIC_STREAM_NONE));
// hack to put this in the correct spot of the array
if ($public_stream_mode) {
2018-03-02 00:11:30 +00:00
$options[5]['pubstream'] = t('View public stream');
}
$o = replace_macros(get_markup_template('new_member.tpl'), [
'$title' => t('New Member Links'),
'$options' => $options
]);
return $o;
}
}