X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FBaseModule.php;h=cb8f8c790de7317e064db3ee88b97c704e02b3bb;hb=8a3db0226b40420863b4d36b1d5afcac6ce08101;hp=0e0fedb80c35925b4809595287c88254ae2a4c12;hpb=cb0341893785b678b5225404c22d0929c62484f8;p=friendica.git diff --git a/src/BaseModule.php b/src/BaseModule.php index 0e0fedb80c..cb8f8c790d 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -1,6 +1,6 @@ user['guid'] . $a->user['prvkey'] . session_id() . $x[0] . $typename); + $sec_hash = hash('whirlpool', ($a->user['guid'] ?? '') . ($a->user['prvkey'] ?? '') . session_id() . $x[0] . $typename); return ($sec_hash == $x[1]); } @@ -171,4 +201,40 @@ abstract class BaseModule throw new \Friendica\Network\HTTPException\ForbiddenException(); } } + + protected static function getContactFilterTabs(string $baseUrl, string $current, bool $displayCommonTab) + { + $tabs = [ + [ + 'label' => DI::l10n()->t('All contacts'), + 'url' => $baseUrl . '/contacts', + 'sel' => !$current || $current == 'all' ? 'active' : '', + ], + [ + 'label' => DI::l10n()->t('Followers'), + 'url' => $baseUrl . '/contacts/followers', + 'sel' => $current == 'followers' ? 'active' : '', + ], + [ + 'label' => DI::l10n()->t('Following'), + 'url' => $baseUrl . '/contacts/following', + 'sel' => $current == 'following' ? 'active' : '', + ], + [ + 'label' => DI::l10n()->t('Mutual friends'), + 'url' => $baseUrl . '/contacts/mutuals', + 'sel' => $current == 'mutuals' ? 'active' : '', + ], + ]; + + if ($displayCommonTab) { + $tabs[] = [ + 'label' => DI::l10n()->t('Common'), + 'url' => $baseUrl . '/contacts/common', + 'sel' => $current == 'common' ? 'active' : '', + ]; + } + + return $tabs; + } }