mirror of
https://github.com/friendica/friendica
synced 2025-04-20 18:30:10 +00:00
Merge pull request #11230 from annando/account-type
Use "account-type" instead of "page-flags"
This commit is contained in:
commit
1b73e4d267
19 changed files with 105 additions and 63 deletions
|
@ -558,7 +558,7 @@ class Contact extends BaseModule
|
|||
'details' => $contact['location'],
|
||||
'tags' => $contact['keywords'],
|
||||
'about' => $contact['about'],
|
||||
'account_type' => Model\Contact::getAccountType($contact),
|
||||
'account_type' => Model\Contact::getAccountType($contact['contact-type']),
|
||||
'sparkle' => $sparkle,
|
||||
'itemurl' => ($contact['addr'] ?? '') ?: $contact['url'],
|
||||
'network' => ContactSelector::networkToName($contact['network'], $contact['url'], $contact['protocol'], $contact['gsid']),
|
||||
|
|
|
@ -101,7 +101,7 @@ class Hovercard extends BaseModule
|
|||
'network_link' => Strings::formatNetworkName($contact['network'], $contact['url']),
|
||||
'tags' => $contact['keywords'],
|
||||
'bd' => $contact['bd'] <= DBA::NULL_DATE ? '' : $contact['bd'],
|
||||
'account_type' => Contact::getAccountType($contact),
|
||||
'account_type' => Contact::getAccountType($contact['contact-type']),
|
||||
'actions' => $actions,
|
||||
],
|
||||
]);
|
||||
|
|
|
@ -364,7 +364,7 @@ class Profile extends BaseModule
|
|||
'$url' => $url,
|
||||
'$profileurllabel' => $this->t('Profile URL'),
|
||||
'$profileurl' => $contact['url'],
|
||||
'$account_type' => Contact::getAccountType($contact),
|
||||
'$account_type' => Contact::getAccountType($contact['contact-type']),
|
||||
'$location' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['location']),
|
||||
'$location_label' => $this->t('Location:'),
|
||||
'$xmpp' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['xmpp']),
|
||||
|
|
|
@ -119,7 +119,7 @@ class Network extends BaseModule
|
|||
|
||||
if (self::$forumContactId) {
|
||||
// If self::$forumContactId belongs to a communitity forum or a privat goup,.add a mention to the status editor
|
||||
$condition = ["`id` = ? AND (`forum` OR `prv`)", self::$forumContactId];
|
||||
$condition = ["`id` = ? AND `contact-type` = ?", self::$forumContactId, Contact::TYPE_COMMUNITY];
|
||||
$contact = DBA::selectFirst('contact', ['addr'], $condition);
|
||||
if (!empty($contact['addr'])) {
|
||||
$content = '!' . $contact['addr'];
|
||||
|
|
|
@ -165,7 +165,7 @@ class Directory extends BaseModule
|
|||
'img_hover' => $contact['name'],
|
||||
'name' => $contact['name'],
|
||||
'details' => $details,
|
||||
'account_type' => Model\Contact::getAccountType($contact),
|
||||
'account_type' => Model\Contact::getAccountType($contact['contact-type']),
|
||||
'profile' => $profile,
|
||||
'location' => $location_e,
|
||||
'tags' => $contact['pub_keywords'],
|
||||
|
|
|
@ -159,7 +159,7 @@ class Status extends BaseProfile
|
|||
|
||||
// Does the profile page belong to a forum?
|
||||
// If not then we can improve the performance with an additional condition
|
||||
$condition2 = ['uid' => $profile['uid'], 'page-flags' => [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP]];
|
||||
$condition2 = ['uid' => $profile['uid'], 'account-type' => User::ACCOUNT_TYPE_COMMUNITY];
|
||||
if (!DBA::exists('user', $condition2)) {
|
||||
$condition = DBA::mergeConditions($condition, ['contact-id' => $profile['id']]);
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ class Index extends BaseSettings
|
|||
'$baseurl' => DI::baseUrl()->get(true),
|
||||
]);
|
||||
|
||||
$personal_account = !in_array($profile['page-flags'], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP]);
|
||||
$personal_account = ($profile['account-type'] != User::ACCOUNT_TYPE_COMMUNITY);
|
||||
|
||||
$tpl = Renderer::getMarkupTemplate('settings/profile/index.tpl');
|
||||
$o .= Renderer::replaceMacros($tpl, [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue