X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=1f337859b50c0bad9543a00280694bba4465d753;hb=fd73b0e1d2866701ed48d432ebcc0b32ee10a09f;hp=db2d33b47db84a30aac5e79350e449b251e7a89d;hpb=0e54d35f6562fb63bcf280a07f07ef90a1d9efca;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index db2d33b47d..1f337859b5 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -22,6 +22,7 @@ use Friendica\App; use Friendica\Content\ContactSelector; use Friendica\Content\Feature; +use Friendica\Core\ACL; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\Protocol; @@ -34,6 +35,7 @@ use Friendica\Model\Contact; use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\Tag; +use Friendica\Model\User; use Friendica\Model\Verb; use Friendica\Object\Post as PostObject; use Friendica\Object\Thread; @@ -479,7 +481,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o $body_html = Item::prepareBody($item, true, $preview); - list($categories, $folders) = DI::contentItem()->determineCategoriesTerms($item); + list($categories, $folders) = DI::contentItem()->determineCategoriesTerms($item, local_user()); if (!empty($item['content-warning']) && DI::pConfig()->get(local_user(), 'system', 'disable_cw', false)) { $title = ucfirst($item['content-warning']); @@ -1064,11 +1066,24 @@ function format_activity(array $links, $verb, $id) { return $o; } -function status_editor(App $a, $x, $notes_cid = 0, $popup = false) +function status_editor(App $a, array $x = [], $notes_cid = 0, $popup = false) { DI::profiler()->startRecording('rendering'); $o = ''; + $user = User::getById($a->getLoggedInUserId(), ['uid', 'nickname', 'allow_location', 'default-location']); + + $x['allow_location'] = $x['allow_location'] ?? $user['allow_location']; + $x['default_location'] = $x['default_location'] ?? $user['default-location']; + $x['nickname'] = $x['nickname'] ?? $user['nickname']; + $x['lockstate'] = $x['lockstate'] ?? ACL::getLockstateForUserId($user['uid']) ? 'lock' : 'unlock'; + $x['acl'] = $x['acl'] ?? ACL::getFullSelectorHTML(DI::page(), $user['uid'], true); + $x['bang'] = $x['bang'] ?? ''; + $x['visitor'] = $x['visitor'] ?? 'block'; + $x['is_owner'] = $x['is_owner'] ?? true; + $x['profile_uid'] = $x['profile_uid'] ?? local_user(); + + $geotag = !empty($x['allow_location']) ? Renderer::replaceMacros(Renderer::getMarkupTemplate('jot_geotag.tpl'), []) : ''; $tpl = Renderer::getMarkupTemplate('jot-header.tpl');