]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/theme.php
Merge pull request #4243 from MrPetovan/task/switch-to-array-new-style
[friendica.git] / view / theme / frio / theme.php
index b135fa0d6604edc3ae56ec23f04ca4923fd9245e..16d1b03f2e5c37391b5be290c3688d2c519c2232 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /*
  * Name: frio
  * Description: Bootstrap V3 theme. The theme is currently under construction, so it is far from finished. For further information have a look at the <a href="https://github.com/friendica/friendica/tree/develop/view/theme/frio/README.md">ReadMe</a>.
@@ -7,8 +6,8 @@
  * Author: Rabuzarus <https://friendica.kommune4.de/profile/rabuzarus>
  *
  */
-
 use Friendica\App;
+use Friendica\Content\Widget;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\System;
@@ -95,7 +94,7 @@ function frio_item_photo_links(App $a, &$body_info)
 
        while ($p !== false && ($occurence++ < 500)) {
                $link = substr($body_info['html'], $p['start'], $p['end'] - $p['start']);
-               $matches = array();
+               $matches = [];
 
                preg_match("/\/photos\/[\w]+\/image\/([\w]+)/", $link, $matches);
                if ($matches) {
@@ -245,28 +244,28 @@ function frio_remote_nav($a, &$nav)
        }
 
        if (DBM::is_result($r)) {
-               $nav['userinfo'] = array(
+               $nav['userinfo'] = [
                        'icon' => (DBM::is_result($r) ? $r[0]['photo'] : "images/person-48.jpg"),
                        'name' => $r[0]['name'],
-               );
+               ];
        }
 
        if (!local_user() && !empty($server_url)) {
-               $nav['logout'] = Array($server_url . '/logout', t('Logout'), "", t('End this session'));
+               $nav['logout'] = [$server_url . '/logout', t('Logout'), "", t('End this session')];
 
                // user menu
-               $nav['usermenu'][] = Array($server_url . '/profile/' . $a->user['nickname'], t('Status'), "", t('Your posts and conversations'));
-               $nav['usermenu'][] = Array($server_url . '/profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), "", t('Your profile page'));
-               $nav['usermenu'][] = Array($server_url . '/photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos'));
-               $nav['usermenu'][] = Array($server_url . '/videos/' . $a->user['nickname'], t('Videos'), "", t('Your videos'));
-               $nav['usermenu'][] = Array($server_url . '/events/', t('Events'), "", t('Your events'));
+               $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'], t('Status'), "", t('Your posts and conversations')];
+               $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), "", t('Your profile page')];
+               $nav['usermenu'][] = [$server_url . '/photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos')];
+               $nav['usermenu'][] = [$server_url . '/videos/' . $a->user['nickname'], t('Videos'), "", t('Your videos')];
+               $nav['usermenu'][] = [$server_url . '/events/', t('Events'), "", t('Your events')];
 
                // navbar links
-               $nav['network'] = array($server_url . '/network', t('Network'), "", t('Conversations from your friends'));
-               $nav['events'] = Array($server_url . '/events', t('Events'), "", t('Events and Calendar'));
-               $nav['messages'] = array($server_url . '/message', t('Messages'), "", t('Private mail'));
-               $nav['settings'] = array($server_url . '/settings', t('Settings'), "", t('Account settings'));
-               $nav['contacts'] = array($server_url . '/contacts', t('Contacts'), "", t('Manage/edit friends and contacts'));
+               $nav['network'] = [$server_url . '/network', t('Network'), "", t('Conversations from your friends')];
+               $nav['events'] = [$server_url . '/events', t('Events'), "", t('Events and Calendar')];
+               $nav['messages'] = [$server_url . '/message', t('Messages'), "", t('Private mail')];
+               $nav['settings'] = [$server_url . '/settings', t('Settings'), "", t('Account settings')];
+               $nav['contacts'] = [$server_url . '/contacts', t('Contacts'), "", t('Manage/edit friends and contacts')];
                $nav['sitename'] = $a->config['sitename'];
        }
 }
@@ -315,13 +314,13 @@ function frio_acl_lookup(App $a, &$results)
                        $total = $r[0]["total"];
                }
 
-               $sql_extra3 = unavailable_networks();
+               $sql_extra3 = Widget::unavailableNetworks();
 
                $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND NOT `self` AND NOT `pending` $sql_extra $sql_extra3 ORDER BY `name` ASC LIMIT 100 ",
                        intval($_SESSION['uid'])
                );
 
-               $contacts = array();
+               $contacts = [];
 
                if (DBM::is_result($r)) {
                        foreach ($r as $rr) {
@@ -347,14 +346,14 @@ function frio_acl_lookup(App $a, &$results)
 function frio_display_item(App $a, &$arr)
 {
        // Add subthread to the item menu
-       $subthread = array();
+       $subthread = [];
        if (local_user() == $arr['item']['uid'] && $arr['item']['parent'] == $arr['item']['id'] && !$arr['item']['self']) {
-               $subthread = array(
+               $subthread = [
                        'menu'   => 'follow_thread',
                        'title'  => t('Follow Thread'),
                        'action' => 'dosubthread(' . $arr['item']['id'] . '); return false;',
                        'href'   => '#'
-               );
+               ];
        }
        $arr['output']['subthread'] = $subthread;
 }