X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Feditpost.php;h=cc72dbd3c2eddbd864b28250254b6467d96ce32d;hb=cfac13790bc1948697b76b9a6134b61c7bb3173b;hp=6f80bac0c1ad21b148b5d6bc0b7d351bf3e46e82;hpb=38a5358bfa646ae13a4a1a385741890fa88d9b7f;p=friendica.git diff --git a/mod/editpost.php b/mod/editpost.php index 6f80bac0c1..cc72dbd3c2 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -27,6 +27,7 @@ use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Post; +use Friendica\Model\User; use Friendica\Util\Crypto; function editpost_content(App $a) @@ -38,7 +39,7 @@ function editpost_content(App $a) return; } - $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0); + $post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0); if (!$post_id) { notice(DI::l10n()->t('Item not found')); @@ -55,6 +56,8 @@ function editpost_content(App $a) return; } + $user = User::getById(local_user()); + $geotag = ''; $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate("section_title.tpl"), [ @@ -65,7 +68,7 @@ function editpost_content(App $a) DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [ '$ispublic' => ' ', // DI::l10n()->t('Visible to everybody'), '$geotag' => $geotag, - '$nickname' => $a->user['nickname'], + '$nickname' => $a->getLoggedInUserNickname(), '$is_mobile' => DI::mode()->isMobile(), ]); @@ -107,7 +110,7 @@ function editpost_content(App $a) '$posttype' => $item['post-type'], '$content' => undo_post_tagging($item['body']), '$post_id' => $post_id, - '$defloc' => $a->user['default-location'], + '$defloc' => $user['default-location'], '$visitor' => 'none', '$pvisit' => 'none', '$emailcc' => DI::l10n()->t('CC: email addresses'), @@ -124,7 +127,6 @@ function editpost_content(App $a) '$profile_uid' => $_SESSION['uid'], '$preview' => DI::l10n()->t('Preview'), '$jotplugins' => $jotplugins, - '$sourceapp' => DI::l10n()->t($a->sourcename), '$cancel' => DI::l10n()->t('Cancel'), '$rand_num' => Crypto::randomDigits(12),