]> git.mxchange.org Git - friendica.git/commitdiff
code standards + fixing navigation links to /contact/...
authorJonny Tischbein <jonny_tischbein@systemli.org>
Sun, 14 Oct 2018 18:03:22 +0000 (20:03 +0200)
committerJonny Tischbein <jonny_tischbein@systemli.org>
Sun, 14 Oct 2018 18:03:22 +0000 (20:03 +0200)
mod/allfriends.php
mod/common.php
mod/crepair.php
mod/dirfind.php
mod/group.php
src/Module/Contact.php
view/theme/frio/theme.php

index aa5fb0a679430dadddae06deb58e5bc67826e8de..cee067e97acf1ab9791a667a89f4bea89c175209 100644 (file)
@@ -8,8 +8,8 @@ use Friendica\Content\ContactSelector;
 use Friendica\Core\L10n;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
-use Friendica\Model;\
-use Friendica\Module\Contact;
+use Friendica\Model;
+use Friendica\Module;
 use Friendica\Util\Proxy as ProxyUtils;
 
 
@@ -95,7 +95,7 @@ function allfriends_content(App $a)
                $entries[] = $entry;
        }
 
-       $tab_str = Contact::getTabsHTML($a, $contact, 4);
+       $tab_str = Module\Contact::getTabsHTML($a, $contact, 4);
 
        $tpl = get_markup_template('viewcontact_template.tpl');
 
index c011c6d38ae73eb5dd04eee63e790267b439433f..25a6aef17a5cc602833514148f2be7e20639af88 100644 (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');
        }
index 14ed89afbccd19fc8130a5c72c0411b145cb5514..c9050b3cce08945a065ad7602633d0b88fb81438 100644 (file)
@@ -9,7 +9,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
 use Friendica\Database\DBA;
 use Friendica\Model;
-use Friendica\Module\Contact;
+use Friendica\Module;
 
 function crepair_init(App $a)
 {
@@ -28,7 +28,7 @@ function crepair_init(App $a)
 
        if (DBA::isResult($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]);
 
-       $tab_str = Contact::getTabsHTML($a, $contact, 5);
+       $tab_str = Module\Contact::getTabsHTML($a, $contact, 5);
 
        $tpl = get_markup_template('crepair.tpl');
        $o = replace_macros($tpl, [
index 8fcf98d4020bc9f6b307103f2ce3df301e4840f1..ea5aae669ac233c74968fbb0413440f4546e8134 100644 (file)
@@ -13,7 +13,7 @@ use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\Model;
-use Friendica\Module\Contact;
+use Friendica\Module;
 use Friendica\Network\Probe;
 use Friendica\Protocol\PortableContact;
 use Friendica\Util\Network;
@@ -209,8 +209,8 @@ function dirfind_content(App $a, $prefix = "") {
                                        $conntxt = "";
                                        $contact = DBA::selectFirst('contact', [], ['id' => $jj->cid]);
                                        if (DBA::isResult($contact)) {
-                                               $photo_menu =Model\Contact::photoMenu($contact);
-                                               $details = Contact::getContactTemplateVars($contact);
+                                               $photo_menu = Model\Contact::photoMenu($contact);
+                                               $details = Module\Contact::getContactTemplateVars($contact);
                                                $alt_text = $details['alt_text'];
                                        } else {
                                                $photo_menu = [];
@@ -226,7 +226,7 @@ function dirfind_content(App $a, $prefix = "") {
                                                $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];
                                }
 
index 962697c24f20ab1f432056bae1cc7854bdc73e29..5bc188e50d0891ad2f6b69f9c47a61b869d06f60 100644 (file)
@@ -12,7 +12,7 @@ use Friendica\Core\PConfig;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model;
-use Friendica\Module\Contact;
+use Friendica\Module;
 
 function group_init(App $a) {
        if (local_user()) {
@@ -249,7 +249,7 @@ function group_content(App $a) {
        // Format the data of the group members
        foreach ($members as $member) {
                if ($member['url']) {
-                       $entry = Contact::getContactTemplateVars($member);
+                       $entry = Module\Contact::getContactTemplateVars($member);
                        $entry['label'] = 'members';
                        $entry['photo_menu'] = '';
                        $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
                foreach ($r as $member) {
                        if (!in_array($member['id'], $preselected)) {
-                               $entry = Contact::getContactTemplateVars($member);
+                               $entry = Module\Contact::getContactTemplateVars($member);
                                $entry['label'] = 'contacts';
                                if (!$nogroup)
                                        $entry['photo_menu'] = [];
index 07b7c907dae2ab5da924bdb7aa13c6787db1e5a7..ba06b7e0b32bc666eee1dd2cc0178530a9d5aa90 100644 (file)
@@ -190,7 +190,7 @@ class Contact extends BaseModule
 
                if (!DBA::exists('contact', ['id' => $contact_id, 'uid' => local_user()])) {
                        notice(L10n::t('Could not access contact record.') . EOL);
-                       goaway('contacts');
+                       goaway('contact');
                        return; // NOTREACHED
                }
 
@@ -370,7 +370,7 @@ class Contact extends BaseModule
                $a = self::getApp();
                $sort_type = 0;
                $o = '';
-               Nav::setSelected('contacts');
+               Nav::setSelected('contact');
 
                if (!local_user()) {
                        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]);
                        if (!DBA::isResult($orig_record)) {
                                notice(L10n::t('Could not access contact record.') . EOL);
-                               goaway('contacts');
+                               goaway('contact');
                                return; // NOTREACHED
                        }
 
                        if ($cmd === 'update' && ($orig_record['uid'] != 0)) {
                                self::updateContactFromPoll($contact_id);
-                               goaway('contacts/' . $contact_id);
+                               goaway('contact/' . $contact_id);
                                // NOTREACHED
                        }
 
@@ -410,7 +410,7 @@ class Contact extends BaseModule
                                $blocked = Model\Contact::isBlockedByUser($contact_id, local_user());
                                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
                        }
 
@@ -420,7 +420,7 @@ class Contact extends BaseModule
                                $ignored = Model\Contact::isIgnoredByUser($contact_id, local_user());
                                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
                        }
 
@@ -431,7 +431,7 @@ class Contact extends BaseModule
                                        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
                        }
 
@@ -465,13 +465,13 @@ class Contact extends BaseModule
                                }
                                // Now check how the user responded to the confirmation query
                                if (defaults($_REQUEST, 'canceled')) {
-                                       goaway('contacts');
+                                       goaway('contact');
                                }
 
                                self::dropContact($orig_record);
                                info(L10n::t('Contact has been removed.') . EOL);
 
-                               goaway('contacts');
+                               goaway('contact');
                                return; // NOTREACHED
                        }
                        if ($cmd === 'posts') {
index 58904911c15872cac59cd22d47fae8ea84fb2b32..f46b42788fe9253da7355c6e9285f695cff474f2 100644 (file)
@@ -17,7 +17,7 @@ use Friendica\Core\PConfig;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model;
-use Friendica\Module\Contact;
+use Friendica\Module;
 
 $frio = 'view/theme/frio';
 
@@ -333,7 +333,7 @@ function frio_acl_lookup(App $a, &$results)
 
        if (DBA::isResult($r)) {
                foreach ($r as $rr) {
-                       $contacts[] = Model\Contact::getContactTemplateVars($rr);
+                       $contacts[] = Module\Contact::getContactTemplateVars($rr);
                }
        }