Merge pull request #1152 from annando/app-user

Replaced direct calls to App->user
This commit is contained in:
Hypolite Petovan 2021-08-09 17:00:24 -04:00 committed by GitHub
commit b74288fa96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 26 additions and 12 deletions

View file

@ -146,7 +146,7 @@ function twitter_follow(App $a, array &$contact)
$nickname = preg_replace("=https?://twitter.com/(.*)=ism", "$1", $contact["url"]);
$nickname = str_replace("@twitter.com", "", $nickname);
$uid = $a->user["uid"];
$uid = $a->getLoggedInUserId();
$ckey = DI::config()->get('twitter', 'consumerkey');
$csecret = DI::config()->get('twitter', 'consumersecret');
@ -266,6 +266,9 @@ function twitter_settings(App $a, &$s)
if (!local_user()) {
return;
}
$user = User::getById(local_user());
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/twitter/twitter.css' . '" media="all" />' . "\r\n";
/* * *
* 1) Check that we have global consumer key & secret
@ -356,7 +359,7 @@ function twitter_settings(App $a, &$s)
$s .= Renderer::replaceMacros($field_checkbox, [
'$field' => ['twitter-enable', DI::l10n()->t('Allow posting to Twitter'), $enabled, DI::l10n()->t('If enabled all your <strong>public</strong> postings can be posted to the associated Twitter account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.')]
]);
if ($a->user['hidewall']) {
if ($user['hidewall']) {
$s .= '<p>' . DI::l10n()->t('<strong>Note</strong>: Due to your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to Twitter will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted.') . '</p>';
}
$s .= Renderer::replaceMacros($field_checkbox, [