+ require_once 'include/security.php';
+ require_once 'include/conversation.php';
+
+ if (!$update) {
+ $tabs = [];
+
+ if ((local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(Config::get('system', 'singleuser'))) {
+ $tabs[] = [
+ 'label' => L10n::t('Local Community'),
+ 'url' => 'community/local',
+ 'sel' => $content == 'local' ? 'active' : '',
+ 'title' => L10n::t('Posts from local users on this server'),
+ 'id' => 'community-local-tab',
+ 'accesskey' => 'l'
+ ];
+ }
+
+ if (local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_GLOBAL_COMMUNITY])) {
+ $tabs[] = [
+ 'label' => L10n::t('Global Community'),
+ 'url' => 'community/global',
+ 'sel' => $content == 'global' ? 'active' : '',
+ 'title' => L10n::t('Posts from users of the whole federated network'),
+ 'id' => 'community-global-tab',
+ 'accesskey' => 'g'
+ ];
+ }
+
+ $tab_tpl = get_markup_template('common_tabs.tpl');
+ $o .= replace_macros($tab_tpl, ['$tabs' => $tabs]);
+
+ Nav::setSelected('community');
+
+ // We need the editor here to be able to reshare an item.
+ if (local_user()) {
+ $x = [
+ 'is_owner' => true,
+ 'allow_location' => $a->user['allow_location'],
+ 'default_location' => $a->user['default-location'],
+ 'nickname' => $a->user['nickname'],
+ 'lockstate' => (is_array($a->user) && (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) || strlen($a->user['deny_cid']) || strlen($a->user['deny_gid'])) ? 'lock' : 'unlock'),
+ 'acl' => ACL::getFullSelectorHTML($a->user, true),
+ 'bang' => '',
+ 'visitor' => 'block',
+ 'profile_uid' => local_user(),
+ ];
+ $o .= status_editor($a, $x, 0, true);
+ }
+ }