1
0
Fork 0

code standards + fixing navigation links to /contact/...

This commit is contained in:
Jonny Tischbein 2018-10-14 20:03:22 +02:00
commit 5fd4402074
7 changed files with 35 additions and 35 deletions

View file

@ -8,7 +8,7 @@ use Friendica\Content\ContactSelector;
use Friendica\Core\L10n;
use Friendica\Database\DBA;
use Friendica\Model;
use Friendica\Module\Contact;
use Friendica\Module;
use Friendica\Util\Proxy as ProxyUtils;
@ -41,7 +41,7 @@ function common_content(App $a)
if (DBA::isResult($contact)) {
$a->page['aside'] = "";
Model\Profile::load($a, "", 0,Model\Contact::getDetailsByURL($contact["url"]));
Model\Profile::load($a, "", 0, Model\Contact::getDetailsByURL($contact["url"]));
}
} else {
$contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['self' => true, 'uid' => $uid]);
@ -64,7 +64,7 @@ function common_content(App $a)
return;
}
if (!$cid &&Model\Profile::getMyURL()) {
if (!$cid && Model\Profile::getMyURL()) {
$contact = DBA::selectFirst('contact', ['id'], ['nurl' => normalise_link(Model\Profile::getMyURL()), 'uid' => $uid]);
if (DBA::isResult($contact)) {
$cid = $contact['id'];
@ -81,9 +81,9 @@ function common_content(App $a)
}
if ($cid) {
$t =Model\GContact::countCommonFriends($uid, $cid);
$t = Model\GContact::countCommonFriends($uid, $cid);
} else {
$t =Model\GContact::countCommonFriendsZcid($uid, $zcid);
$t = Model\GContact::countCommonFriendsZcid($uid, $zcid);
}
if ($t > 0) {
@ -94,9 +94,9 @@ function common_content(App $a)
}
if ($cid) {
$r =Model\GContact::commonFriends($uid, $cid, $a->pager['start'], $a->pager['itemspage']);
$r = Model\GContact::commonFriends($uid, $cid, $a->pager['start'], $a->pager['itemspage']);
} else {
$r =Model\GContact::commonFriendsZcid($uid, $zcid, $a->pager['start'], $a->pager['itemspage']);
$r = Model\GContact::commonFriendsZcid($uid, $zcid, $a->pager['start'], $a->pager['itemspage']);
}
if (!DBA::isResult($r)) {
@ -108,13 +108,13 @@ function common_content(App $a)
$entries = [];
foreach ($r as $rr) {
//get further details of the contact
$contact_details =Model\Contact::getDetailsByURL($rr['url'], $uid);
$contact_details = Model\Contact::getDetailsByURL($rr['url'], $uid);
// $rr['id'] is needed to use contact_photo_menu()
/// @TODO Adding '/" here avoids E_NOTICE on missing constants
$rr['id'] = $rr['cid'];
$photo_menu =Model\Contact::photoMenu($rr);
$photo_menu = Model\Contact::photoMenu($rr);
$entry = [
'url' => $rr['url'],
@ -125,7 +125,7 @@ function common_content(App $a)
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],
'about' => $contact_details['about'],
'account_type' =>Model\Contact::getAccountType($contact_details),
'account_type' => Model\Contact::getAccountType($contact_details),
'network' => ContactSelector::networkToName($contact_details['network'], $contact_details['url']),
'photo_menu' => $photo_menu,
'id' => ++$id,
@ -136,7 +136,7 @@ function common_content(App $a)
$title = '';
$tab_str = '';
if ($cmd === 'loc' && $cid && local_user() == $uid) {
$tab_str = Contact::getTabsHTML($a, $contact, 4);
$tab_str = Module\Contact::getTabsHTML($a, $contact, 4);
} else {
$title = L10n::t('Common Friends');
}