Switch static::$parameters to $this->parameters

This commit is contained in:
Philipp 2021-11-14 23:19:25 +01:00
parent 489cd0884a
commit 5879535822
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
116 changed files with 321 additions and 314 deletions

View file

@ -45,7 +45,7 @@ class Common extends BaseProfile
Nav::setSelected('home');
$nickname = static::$parameters['nickname'];
$nickname = $this->parameters['nickname'];
$profile = Profile::load($a, $nickname);
if (empty($profile)) {

View file

@ -42,8 +42,8 @@ class Contacts extends Module\BaseProfile
$a = DI::app();
$nickname = static::$parameters['nickname'];
$type = static::$parameters['type'] ?? 'all';
$nickname = $this->parameters['nickname'];
$type = $this->parameters['type'] ?? 'all';
$profile = Model\Profile::load($a, $nickname);
if (empty($profile)) {

View file

@ -36,11 +36,11 @@ class Index extends BaseModule
{
public function rawContent()
{
(new Profile(static::$parameters))->rawContent();
(new Profile($this->parameters))->rawContent();
}
public function content(): string
{
return (new Status(static::$parameters))->content();
return (new Status($this->parameters))->content();
}
}

View file

@ -33,7 +33,7 @@ class Media extends BaseProfile
{
$a = DI::app();
$profile = ProfileModel::load($a, static::$parameters['nickname']);
$profile = ProfileModel::load($a, $this->parameters['nickname']);
if (empty($profile)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}

View file

@ -49,7 +49,7 @@ class Profile extends BaseProfile
public function rawContent()
{
if (ActivityPub::isRequest()) {
$user = DBA::selectFirst('user', ['uid'], ['nickname' => static::$parameters['nickname']]);
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname']]);
if (DBA::isResult($user)) {
try {
$data = ActivityPub\Transmitter::getProfile($user['uid']);
@ -61,9 +61,9 @@ class Profile extends BaseProfile
}
}
if (DBA::exists('userd', ['username' => static::$parameters['nickname']])) {
if (DBA::exists('userd', ['username' => $this->parameters['nickname']])) {
// Known deleted user
$data = ActivityPub\Transmitter::getDeletedUser(static::$parameters['nickname']);
$data = ActivityPub\Transmitter::getDeletedUser($this->parameters['nickname']);
System::jsonError(410, $data);
} else {
@ -77,7 +77,7 @@ class Profile extends BaseProfile
{
$a = DI::app();
$profile = ProfileModel::load($a, static::$parameters['nickname']);
$profile = ProfileModel::load($a, $this->parameters['nickname']);
if (!$profile) {
throw new HTTPException\NotFoundException(DI::l10n()->t('Profile not found.'));
}
@ -98,7 +98,7 @@ class Profile extends BaseProfile
DI::page()['htmlhead'] .= '<meta name="friendica.community" content="true" />' . "\n";
}
DI::page()['htmlhead'] .= self::buildHtmlHead($profile, static::$parameters['nickname'], $remote_contact_id);
DI::page()['htmlhead'] .= self::buildHtmlHead($profile, $this->parameters['nickname'], $remote_contact_id);
Nav::setSelected('home');
@ -134,7 +134,7 @@ class Profile extends BaseProfile
$view_as_contact_alert = DI::l10n()->t(
'You\'re currently viewing your profile as <b>%s</b> <a href="%s" class="btn btn-sm pull-right">Cancel</a>',
htmlentities($view_as_contacts[$key]['name'], ENT_COMPAT, 'UTF-8'),
'profile/' . static::$parameters['nickname'] . '/profile'
'profile/' . $this->parameters['nickname'] . '/profile'
);
}
}

View file

@ -80,7 +80,7 @@ class Schedule extends BaseProfile
'$form_security_token' => BaseModule::getFormSecurityToken("profile_schedule"),
'$baseurl' => DI::baseUrl()->get(true),
'$title' => DI::l10n()->t('Scheduled Posts'),
'$nickname' => static::$parameters['nickname'] ?? '',
'$nickname' => $this->parameters['nickname'] ?? '',
'$scheduled_at' => DI::l10n()->t('Scheduled'),
'$content' => DI::l10n()->t('Content'),
'$delete' => DI::l10n()->t('Remove post'),

View file

@ -52,7 +52,7 @@ class Status extends BaseProfile
$a = DI::app();
$profile = ProfileModel::load($a, static::$parameters['nickname']);
$profile = ProfileModel::load($a, $this->parameters['nickname']);
if (empty($profile)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
@ -62,10 +62,10 @@ class Status extends BaseProfile
DI::page()['htmlhead'] .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
}
DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/dfrn_poll/' . static::$parameters['nickname'] . '" title="DFRN: ' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . static::$parameters['nickname'] . '/" title="' . DI::l10n()->t('%s\'s posts', $profile['name']) . '"/>' . "\n";
DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . static::$parameters['nickname'] . '/comments" title="' . DI::l10n()->t('%s\'s comments', $profile['name']) . '"/>' . "\n";
DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . static::$parameters['nickname'] . '/activity" title="' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/dfrn_poll/' . $this->parameters['nickname'] . '" title="DFRN: ' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . $this->parameters['nickname'] . '/" title="' . DI::l10n()->t('%s\'s posts', $profile['name']) . '"/>' . "\n";
DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . $this->parameters['nickname'] . '/comments" title="' . DI::l10n()->t('%s\'s comments', $profile['name']) . '"/>' . "\n";
DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . $this->parameters['nickname'] . '/activity" title="' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
$category = $datequery = $datequery2 = '';