code standards + fixing navigation links to /contact/...
This commit is contained in:
parent
bfa05156ca
commit
5fd4402074
|
@ -8,8 +8,8 @@ use Friendica\Content\ContactSelector;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model;\
|
use Friendica\Model;
|
||||||
use Friendica\Module\Contact;
|
use Friendica\Module;
|
||||||
use Friendica\Util\Proxy as ProxyUtils;
|
use Friendica\Util\Proxy as ProxyUtils;
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ function allfriends_content(App $a)
|
||||||
$entries[] = $entry;
|
$entries[] = $entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
$tab_str = Contact::getTabsHTML($a, $contact, 4);
|
$tab_str = Module\Contact::getTabsHTML($a, $contact, 4);
|
||||||
|
|
||||||
$tpl = get_markup_template('viewcontact_template.tpl');
|
$tpl = get_markup_template('viewcontact_template.tpl');
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ use Friendica\Content\ContactSelector;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model;
|
use Friendica\Model;
|
||||||
use Friendica\Module\Contact;
|
use Friendica\Module;
|
||||||
use Friendica\Util\Proxy as ProxyUtils;
|
use Friendica\Util\Proxy as ProxyUtils;
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ function common_content(App $a)
|
||||||
|
|
||||||
if (DBA::isResult($contact)) {
|
if (DBA::isResult($contact)) {
|
||||||
$a->page['aside'] = "";
|
$a->page['aside'] = "";
|
||||||
Model\Profile::load($a, "", 0,Model\Contact::getDetailsByURL($contact["url"]));
|
Model\Profile::load($a, "", 0, Model\Contact::getDetailsByURL($contact["url"]));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['self' => true, 'uid' => $uid]);
|
$contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['self' => true, 'uid' => $uid]);
|
||||||
|
@ -64,7 +64,7 @@ function common_content(App $a)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$cid &&Model\Profile::getMyURL()) {
|
if (!$cid && Model\Profile::getMyURL()) {
|
||||||
$contact = DBA::selectFirst('contact', ['id'], ['nurl' => normalise_link(Model\Profile::getMyURL()), 'uid' => $uid]);
|
$contact = DBA::selectFirst('contact', ['id'], ['nurl' => normalise_link(Model\Profile::getMyURL()), 'uid' => $uid]);
|
||||||
if (DBA::isResult($contact)) {
|
if (DBA::isResult($contact)) {
|
||||||
$cid = $contact['id'];
|
$cid = $contact['id'];
|
||||||
|
@ -81,9 +81,9 @@ function common_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cid) {
|
if ($cid) {
|
||||||
$t =Model\GContact::countCommonFriends($uid, $cid);
|
$t = Model\GContact::countCommonFriends($uid, $cid);
|
||||||
} else {
|
} else {
|
||||||
$t =Model\GContact::countCommonFriendsZcid($uid, $zcid);
|
$t = Model\GContact::countCommonFriendsZcid($uid, $zcid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($t > 0) {
|
if ($t > 0) {
|
||||||
|
@ -94,9 +94,9 @@ function common_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cid) {
|
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 {
|
} 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)) {
|
if (!DBA::isResult($r)) {
|
||||||
|
@ -108,13 +108,13 @@ function common_content(App $a)
|
||||||
$entries = [];
|
$entries = [];
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
//get further details of the contact
|
//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()
|
// $rr['id'] is needed to use contact_photo_menu()
|
||||||
/// @TODO Adding '/" here avoids E_NOTICE on missing constants
|
/// @TODO Adding '/" here avoids E_NOTICE on missing constants
|
||||||
$rr['id'] = $rr['cid'];
|
$rr['id'] = $rr['cid'];
|
||||||
|
|
||||||
$photo_menu =Model\Contact::photoMenu($rr);
|
$photo_menu = Model\Contact::photoMenu($rr);
|
||||||
|
|
||||||
$entry = [
|
$entry = [
|
||||||
'url' => $rr['url'],
|
'url' => $rr['url'],
|
||||||
|
@ -125,7 +125,7 @@ function common_content(App $a)
|
||||||
'details' => $contact_details['location'],
|
'details' => $contact_details['location'],
|
||||||
'tags' => $contact_details['keywords'],
|
'tags' => $contact_details['keywords'],
|
||||||
'about' => $contact_details['about'],
|
'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']),
|
'network' => ContactSelector::networkToName($contact_details['network'], $contact_details['url']),
|
||||||
'photo_menu' => $photo_menu,
|
'photo_menu' => $photo_menu,
|
||||||
'id' => ++$id,
|
'id' => ++$id,
|
||||||
|
@ -136,7 +136,7 @@ function common_content(App $a)
|
||||||
$title = '';
|
$title = '';
|
||||||
$tab_str = '';
|
$tab_str = '';
|
||||||
if ($cmd === 'loc' && $cid && local_user() == $uid) {
|
if ($cmd === 'loc' && $cid && local_user() == $uid) {
|
||||||
$tab_str = Contact::getTabsHTML($a, $contact, 4);
|
$tab_str = Module\Contact::getTabsHTML($a, $contact, 4);
|
||||||
} else {
|
} else {
|
||||||
$title = L10n::t('Common Friends');
|
$title = L10n::t('Common Friends');
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model;
|
use Friendica\Model;
|
||||||
use Friendica\Module\Contact;
|
use Friendica\Module;
|
||||||
|
|
||||||
function crepair_init(App $a)
|
function crepair_init(App $a)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@ function crepair_init(App $a)
|
||||||
|
|
||||||
if (DBA::isResult($contact)) {
|
if (DBA::isResult($contact)) {
|
||||||
$a->data['contact'] = $contact;
|
$a->data['contact'] = $contact;
|
||||||
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
|
Profile::load($a, "", 0, Module\Contact::getDetailsByURL($contact["url"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ function crepair_content(App $a)
|
||||||
|
|
||||||
$update_profile = in_array($contact['network'], [Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS]);
|
$update_profile = in_array($contact['network'], [Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS]);
|
||||||
|
|
||||||
$tab_str = Contact::getTabsHTML($a, $contact, 5);
|
$tab_str = Module\Contact::getTabsHTML($a, $contact, 5);
|
||||||
|
|
||||||
$tpl = get_markup_template('crepair.tpl');
|
$tpl = get_markup_template('crepair.tpl');
|
||||||
$o = replace_macros($tpl, [
|
$o = replace_macros($tpl, [
|
||||||
|
|
|
@ -13,7 +13,7 @@ use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model;
|
use Friendica\Model;
|
||||||
use Friendica\Module\Contact;
|
use Friendica\Module;
|
||||||
use Friendica\Network\Probe;
|
use Friendica\Network\Probe;
|
||||||
use Friendica\Protocol\PortableContact;
|
use Friendica\Protocol\PortableContact;
|
||||||
use Friendica\Util\Network;
|
use Friendica\Util\Network;
|
||||||
|
@ -209,8 +209,8 @@ function dirfind_content(App $a, $prefix = "") {
|
||||||
$conntxt = "";
|
$conntxt = "";
|
||||||
$contact = DBA::selectFirst('contact', [], ['id' => $jj->cid]);
|
$contact = DBA::selectFirst('contact', [], ['id' => $jj->cid]);
|
||||||
if (DBA::isResult($contact)) {
|
if (DBA::isResult($contact)) {
|
||||||
$photo_menu =Model\Contact::photoMenu($contact);
|
$photo_menu = Model\Contact::photoMenu($contact);
|
||||||
$details = Contact::getContactTemplateVars($contact);
|
$details = Module\Contact::getContactTemplateVars($contact);
|
||||||
$alt_text = $details['alt_text'];
|
$alt_text = $details['alt_text'];
|
||||||
} else {
|
} else {
|
||||||
$photo_menu = [];
|
$photo_menu = [];
|
||||||
|
@ -226,7 +226,7 @@ function dirfind_content(App $a, $prefix = "") {
|
||||||
$photo_menu = [];
|
$photo_menu = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$photo_menu['profile'] = [L10n::t("View Profile"), Contact::magicLink($jj->url)];
|
$photo_menu['profile'] = [L10n::t("View Profile"), Module\Contact::magicLink($jj->url)];
|
||||||
$photo_menu['follow'] = [L10n::t("Connect/Follow"), $connlnk];
|
$photo_menu['follow'] = [L10n::t("Connect/Follow"), $connlnk];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model;
|
use Friendica\Model;
|
||||||
use Friendica\Module\Contact;
|
use Friendica\Module;
|
||||||
|
|
||||||
function group_init(App $a) {
|
function group_init(App $a) {
|
||||||
if (local_user()) {
|
if (local_user()) {
|
||||||
|
@ -249,7 +249,7 @@ function group_content(App $a) {
|
||||||
// Format the data of the group members
|
// Format the data of the group members
|
||||||
foreach ($members as $member) {
|
foreach ($members as $member) {
|
||||||
if ($member['url']) {
|
if ($member['url']) {
|
||||||
$entry = Contact::getContactTemplateVars($member);
|
$entry = Module\Contact::getContactTemplateVars($member);
|
||||||
$entry['label'] = 'members';
|
$entry['label'] = 'members';
|
||||||
$entry['photo_menu'] = '';
|
$entry['photo_menu'] = '';
|
||||||
$entry['change_member'] = [
|
$entry['change_member'] = [
|
||||||
|
@ -278,7 +278,7 @@ function group_content(App $a) {
|
||||||
// Format the data of the contacts who aren't in the contact group
|
// Format the data of the contacts who aren't in the contact group
|
||||||
foreach ($r as $member) {
|
foreach ($r as $member) {
|
||||||
if (!in_array($member['id'], $preselected)) {
|
if (!in_array($member['id'], $preselected)) {
|
||||||
$entry = Contact::getContactTemplateVars($member);
|
$entry = Module\Contact::getContactTemplateVars($member);
|
||||||
$entry['label'] = 'contacts';
|
$entry['label'] = 'contacts';
|
||||||
if (!$nogroup)
|
if (!$nogroup)
|
||||||
$entry['photo_menu'] = [];
|
$entry['photo_menu'] = [];
|
||||||
|
|
|
@ -190,7 +190,7 @@ class Contact extends BaseModule
|
||||||
|
|
||||||
if (!DBA::exists('contact', ['id' => $contact_id, 'uid' => local_user()])) {
|
if (!DBA::exists('contact', ['id' => $contact_id, 'uid' => local_user()])) {
|
||||||
notice(L10n::t('Could not access contact record.') . EOL);
|
notice(L10n::t('Could not access contact record.') . EOL);
|
||||||
goaway('contacts');
|
goaway('contact');
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +370,7 @@ class Contact extends BaseModule
|
||||||
$a = self::getApp();
|
$a = self::getApp();
|
||||||
$sort_type = 0;
|
$sort_type = 0;
|
||||||
$o = '';
|
$o = '';
|
||||||
Nav::setSelected('contacts');
|
Nav::setSelected('contact');
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
notice(L10n::t('Permission denied.') . EOL);
|
notice(L10n::t('Permission denied.') . EOL);
|
||||||
|
@ -388,13 +388,13 @@ class Contact extends BaseModule
|
||||||
$orig_record = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => [0, local_user()], 'self' => false]);
|
$orig_record = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => [0, local_user()], 'self' => false]);
|
||||||
if (!DBA::isResult($orig_record)) {
|
if (!DBA::isResult($orig_record)) {
|
||||||
notice(L10n::t('Could not access contact record.') . EOL);
|
notice(L10n::t('Could not access contact record.') . EOL);
|
||||||
goaway('contacts');
|
goaway('contact');
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cmd === 'update' && ($orig_record['uid'] != 0)) {
|
if ($cmd === 'update' && ($orig_record['uid'] != 0)) {
|
||||||
self::updateContactFromPoll($contact_id);
|
self::updateContactFromPoll($contact_id);
|
||||||
goaway('contacts/' . $contact_id);
|
goaway('contact/' . $contact_id);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ class Contact extends BaseModule
|
||||||
$blocked = Model\Contact::isBlockedByUser($contact_id, local_user());
|
$blocked = Model\Contact::isBlockedByUser($contact_id, local_user());
|
||||||
info(($blocked ? L10n::t('Contact has been blocked') : L10n::t('Contact has been unblocked')) . EOL);
|
info(($blocked ? L10n::t('Contact has been blocked') : L10n::t('Contact has been unblocked')) . EOL);
|
||||||
|
|
||||||
goaway('contacts/' . $contact_id);
|
goaway('contact/' . $contact_id);
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,7 +420,7 @@ class Contact extends BaseModule
|
||||||
$ignored = Model\Contact::isIgnoredByUser($contact_id, local_user());
|
$ignored = Model\Contact::isIgnoredByUser($contact_id, local_user());
|
||||||
info(($ignored ? L10n::t('Contact has been ignored') : L10n::t('Contact has been unignored')) . EOL);
|
info(($ignored ? L10n::t('Contact has been ignored') : L10n::t('Contact has been unignored')) . EOL);
|
||||||
|
|
||||||
goaway('contacts/' . $contact_id);
|
goaway('contact/' . $contact_id);
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,7 +431,7 @@ class Contact extends BaseModule
|
||||||
info((($archived) ? L10n::t('Contact has been archived') : L10n::t('Contact has been unarchived')) . EOL);
|
info((($archived) ? L10n::t('Contact has been archived') : L10n::t('Contact has been unarchived')) . EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
goaway('contacts/' . $contact_id);
|
goaway('contact/' . $contact_id);
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,13 +465,13 @@ class Contact extends BaseModule
|
||||||
}
|
}
|
||||||
// Now check how the user responded to the confirmation query
|
// Now check how the user responded to the confirmation query
|
||||||
if (defaults($_REQUEST, 'canceled')) {
|
if (defaults($_REQUEST, 'canceled')) {
|
||||||
goaway('contacts');
|
goaway('contact');
|
||||||
}
|
}
|
||||||
|
|
||||||
self::dropContact($orig_record);
|
self::dropContact($orig_record);
|
||||||
info(L10n::t('Contact has been removed.') . EOL);
|
info(L10n::t('Contact has been removed.') . EOL);
|
||||||
|
|
||||||
goaway('contacts');
|
goaway('contact');
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
if ($cmd === 'posts') {
|
if ($cmd === 'posts') {
|
||||||
|
|
|
@ -17,7 +17,7 @@ use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model;
|
use Friendica\Model;
|
||||||
use Friendica\Module\Contact;
|
use Friendica\Module;
|
||||||
|
|
||||||
$frio = 'view/theme/frio';
|
$frio = 'view/theme/frio';
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ function frio_acl_lookup(App $a, &$results)
|
||||||
|
|
||||||
if (DBA::isResult($r)) {
|
if (DBA::isResult($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$contacts[] = Model\Contact::getContactTemplateVars($rr);
|
$contacts[] = Module\Contact::getContactTemplateVars($rr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user