]> git.mxchange.org Git - friendica.git/blobdiff - mod/common.php
Merge pull request #6005 from nupplaphil/friendica-5996
[friendica.git] / mod / common.php
index 13e5bf0927c5119fade32abbed7aec6a49093938..0b51f20d73334190c45d98d2af1a7be86084618f 100644 (file)
@@ -7,11 +7,10 @@ use Friendica\App;
 use Friendica\Content\ContactSelector;
 use Friendica\Core\L10n;
 use Friendica\Database\DBA;
-use Friendica\Model\Contact;
-use Friendica\Model\GContact;
-use Friendica\Model\Profile;
+use Friendica\Model;
+use Friendica\Module;
 use Friendica\Util\Proxy as ProxyUtils;
-use Friendica\Module\Contacts;
+
 
 require_once 'include/dba.php';
 
@@ -42,16 +41,16 @@ function common_content(App $a)
 
                if (DBA::isResult($contact)) {
                        $a->page['aside'] = "";
-                       Profile::load($a, "", 0, 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]);
 
                if (DBA::isResult($contact)) {
                        $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), [
-                               '$name' => htmlentities($contact['name']),
+                               '$name'  => htmlentities($contact['name']),
                                '$photo' => $contact['photo'],
-                               'url' => 'contacts/' . $cid
+                               'url'    => 'contact/' . $cid
                        ]);
 
                        if (!x($a->page, 'aside')) {
@@ -65,12 +64,12 @@ function common_content(App $a)
                return;
        }
 
-       if (!$cid && Profile::getMyURL()) {
-               $contact = DBA::selectFirst('contact', ['id'], ['nurl' => normalise_link(Profile::getMyURL()), 'uid' => $uid]);
+       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'];
                } else {
-                       $gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(Profile::getMyURL())]);
+                       $gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(Model\Profile::getMyURL())]);
                        if (DBA::isResult($gcontact)) {
                                $zcid = $gcontact['id'];
                        }
@@ -82,9 +81,9 @@ function common_content(App $a)
        }
 
        if ($cid) {
-               $t = GContact::countCommonFriends($uid, $cid);
+               $t = Model\GContact::countCommonFriends($uid, $cid);
        } else {
-               $t = GContact::countCommonFriendsZcid($uid, $zcid);
+               $t = Model\GContact::countCommonFriendsZcid($uid, $zcid);
        }
 
        if ($t > 0) {
@@ -95,9 +94,9 @@ function common_content(App $a)
        }
 
        if ($cid) {
-               $r = GContact::commonFriends($uid, $cid, $a->pager['start'], $a->pager['itemspage']);
+               $r = Model\GContact::commonFriends($uid, $cid, $a->pager['start'], $a->pager['itemspage']);
        } else {
-               $r = 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)) {
@@ -109,13 +108,13 @@ function common_content(App $a)
        $entries = [];
        foreach ($r as $rr) {
                //get further details of the contact
-               $contact_details = 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 = Contact::photoMenu($rr);
+               $photo_menu = Model\Contact::photoMenu($rr);
 
                $entry = [
                        'url'          => $rr['url'],
@@ -126,7 +125,7 @@ function common_content(App $a)
                        'details'      => $contact_details['location'],
                        'tags'         => $contact_details['keywords'],
                        'about'        => $contact_details['about'],
-                       'account_type' => 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,
@@ -137,7 +136,7 @@ function common_content(App $a)
        $title = '';
        $tab_str = '';
        if ($cmd === 'loc' && $cid && local_user() == $uid) {
-               $tab_str = Contacts::contacts_tab($a, $contact, 4);
+               $tab_str = Module\Contact::getTabsHTML($a, $contact, 4);
        } else {
                $title = L10n::t('Common Friends');
        }