]> git.mxchange.org Git - friendica.git/blobdiff - mod/common.php
Merge pull request #4243 from MrPetovan/task/switch-to-array-new-style
[friendica.git] / mod / common.php
index 472269f406f287700547d10abc727ca87dadde22..c4f236fad673843373475d6014e5101dcce9621f 100644 (file)
@@ -36,22 +36,22 @@ function common_content(App $a)
        }
 
        if ($cmd === 'loc' && $cid) {
-               $c = dba::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => $uid]);
+               $contact = dba::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => $uid]);
 
-               if (DBM::is_result($c)) {
+               if (DBM::is_result($contact)) {
                        $a->page['aside'] = "";
-                       Profile::load($a, "", 0, Contact::getDetailsByURL($c["url"]));
+                       Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
                }
        } else {
-               $c = dba::selectFirst('contact', ['name', 'url', 'photo'], ['self' => true, 'uid' => $uid]);
+               $contact = dba::selectFirst('contact', ['name', 'url', 'photo'], ['self' => true, 'uid' => $uid]);
 
-               if (DBM::is_result($c)) {
-                       $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), array(
-                               '$name' => htmlentities($c['name']),
-                               '$photo' => $c['photo'],
+               if (DBM::is_result($contact)) {
+                       $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), [
+                               '$name' => htmlentities($contact['name']),
+                               '$photo' => $contact['photo'],
                                'url' => 'contacts/' . $cid
-                       ));
-       
+                       ]);
+
                        if (!x($a->page, 'aside')) {
                                $a->page['aside'] = '';
                        }
@@ -59,7 +59,7 @@ function common_content(App $a)
                }
        }
 
-       if (!DBM::is_result($c)) {
+       if (!DBM::is_result($contact)) {
                return;
        }
 
@@ -115,7 +115,7 @@ function common_content(App $a)
 
                $photo_menu = Contact::photoMenu($rr);
 
-               $entry = array(
+               $entry = [
                        'url'          => $rr['url'],
                        'itemurl'      => defaults($contact_details, 'addr', $rr['url']),
                        'name'         => $contact_details['name'],
@@ -128,7 +128,7 @@ function common_content(App $a)
                        'network'      => ContactSelector::networkToName($contact_details['network'], $contact_details['url']),
                        'photo_menu'   => $photo_menu,
                        'id'           => ++$id,
-               );
+               ];
                $entries[] = $entry;
        }
 
@@ -142,12 +142,12 @@ function common_content(App $a)
 
        $tpl = get_markup_template('viewcontact_template.tpl');
 
-       $o .= replace_macros($tpl, array(
+       $o .= replace_macros($tpl, [
                '$title'    => $title,
                '$tab_str'  => $tab_str,
                '$contacts' => $entries,
                '$paginate' => paginate($a),
-       ));
+       ]);
 
        return $o;
 }