]> git.mxchange.org Git - friendica.git/commitdiff
added curly braces + fixed indenting according to code review by Hypolite
authorRoland Haeder <roland@mxchange.org>
Fri, 30 Dec 2016 20:48:09 +0000 (21:48 +0100)
committerRoland Haeder <roland@mxchange.org>
Fri, 30 Dec 2016 20:48:09 +0000 (21:48 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
include/follow.php
include/items.php
mod/contacts.php
mod/profile.php
view/theme/quattro/config.php

index 8d80538e0c924856c51c0547511d4e4769f750aa..30451910772295fb824e8ac66b127b51100182e5 100644 (file)
@@ -110,12 +110,10 @@ function new_contact($uid,$url,$interactive = false) {
 
                        // NOTREACHED
                }
-       } else {
-               if (get_config('system','dfrn_only')) {
-                       $result['message'] = t('This site is not configured to allow communications with other networks.') . EOL;
-                       $result['message'] != t('No compatible communication protocols or feeds were discovered.') . EOL;
-                       return $result;
-               }
+       } elseif (get_config('system','dfrn_only')) {
+               $result['message'] = t('This site is not configured to allow communications with other networks.') . EOL;
+               $result['message'] != t('No compatible communication protocols or feeds were discovered.') . EOL;
+               return $result;
        }
 
        // This extra param just confuses things, remove it
index 8d95c3552973498e575b428819f72bebf67af1ae..fa4f3290b142090168fbd36222e13d9f4b75840f 100644 (file)
@@ -955,12 +955,14 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
 
                $r = q('SELECT * FROM `item` WHERE `id` = %d', intval($current_post));
                if ((dbm::is_result($r)) && (count($r) == 1)) {
-                       if ($notify)
+                       if ($notify) {
                                call_hooks('post_local_end', $r[0]);
-                       else
+                       } else {
                                call_hooks('post_remote_end', $r[0]);
-               } else
+                       }
+               } else {
                        logger('item_store: new item not found in DB, id ' . $current_post);
+               }
        }
 
        if ($arr['parent-uri'] === $arr['uri']) {
@@ -994,8 +996,9 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
 
        check_item_notification($current_post, $uid);
 
-       if ($notify)
+       if ($notify) {
                proc_run(PRIORITY_HIGH, "include/notifier.php", $notify_type, $current_post);
+       }
 
        return $current_post;
 }
index 26dfe0607837afc4b58f1305b8688e5d3972d11e..38e0992257d9f49f67508c6c9fd5b290e0c64416 100644 (file)
@@ -37,34 +37,36 @@ function contacts_init(App &$a) {
        }
 
        if ($contact_id) {
-                       $a->data['contact'] = $r[0];
+               $a->data['contact'] = $r[0];
 
-                       if (($a->data['contact']['network'] != "") AND ($a->data['contact']['network'] != NETWORK_DFRN)) {
-                               $networkname = format_network_name($a->data['contact']['network'],$a->data['contact']['url']);
-                       } else {
-                               $networkname = '';
-                       }
+               if (($a->data['contact']['network'] != "") AND ($a->data['contact']['network'] != NETWORK_DFRN)) {
+                       $networkname = format_network_name($a->data['contact']['network'],$a->data['contact']['url']);
+               } else {
+                       $networkname = '';
+               }
 
-                       $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array(
-                               '$name' => htmlentities($a->data['contact']['name']),
-                               '$photo' => $a->data['contact']['photo'],
-                               '$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? "redir/".$a->data['contact']['id'] : $a->data['contact']['url'],
-                               '$addr' => (($a->data['contact']['addr'] != "") ? ($a->data['contact']['addr']) : ""),
-                               '$network_name' => $networkname,
-                               '$network' => t('Network:'),
-                               '$account_type' => account_type($a->data['contact'])
-                       ));
-                       $finpeople_widget = '';
-                       $follow_widget = '';
-                       $networks_widget = '';
-       }
-       else {
+               /// @TODO Add nice spaces
+               $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array(
+                       '$name' => htmlentities($a->data['contact']['name']),
+                       '$photo' => $a->data['contact']['photo'],
+                       '$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? "redir/".$a->data['contact']['id'] : $a->data['contact']['url'],
+                       '$addr' => (($a->data['contact']['addr'] != "") ? ($a->data['contact']['addr']) : ""),
+                       '$network_name' => $networkname,
+                       '$network' => t('Network:'),
+                       '$account_type' => account_type($a->data['contact'])
+               ));
+
+               $finpeople_widget = '';
+               $follow_widget = '';
+               $networks_widget = '';
+       } else {
                $vcard_widget = '';
                $networks_widget .= networks_widget('contacts',$_GET['nets']);
-               if (isset($_GET['add']))
+               if (isset($_GET['add'])) {
                        $follow_widget = follow_widget($_GET['add']);
-               else
+               } else {
                        $follow_widget = follow_widget();
+               }
 
                $findpeople_widget .= findpeople_widget();
        }
index 32539758e25b5ca7df754dcdf7e0cedd4fa85964..32d3985b7f844f11bd4618290a965af737bd8ab0 100644 (file)
@@ -111,10 +111,8 @@ function profile_content(&$a, $update = 0) {
        if ($update) {
                // Ensure we've got a profile owner if updating.
                $a->profile['profile_uid'] = $update;
-       } else {
-               if ($a->profile['profile_uid'] == local_user()) {
-                       nav_set_selected('home');
-               }
+       } elseif ($a->profile['profile_uid'] == local_user()) {
+               nav_set_selected('home');
        }
 
        $contact = null;
@@ -158,12 +156,12 @@ function profile_content(&$a, $update = 0) {
        }
 
        if (! $update) {
-               if (x($_GET,'tab'))
+               if (x($_GET,'tab')) {
                        $tab = notags(trim($_GET['tab']));
+               }
 
                $o.=profile_tabs($a, $is_owner, $a->profile['nickname']);
 
-
                if ($tab === 'profile') {
                        $o .= advanced_profile($a);
                        call_hooks('profile_advanced',$o);
@@ -201,14 +199,12 @@ function profile_content(&$a, $update = 0) {
 
                $o .= status_editor($a,$x);
                }
-
        }
 
 
        /**
         * Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups
         */
-
        $sql_extra = item_permissions_sql($a->profile['profile_uid'],$remote_contact,$groups);
 
 
index 32f71db015e9fca2a9f3227ab42cde4468ff38d4..6c80afdc22d0a2be1c3468a84b13a4c31b298cbf 100644 (file)
@@ -33,7 +33,7 @@ function theme_admin(App &$a){
        $align = get_config('quattro', 'align' );
        $color = get_config('quattro', 'color' );
        $tfs = get_config("quattro","tfs");
-       $pfs = get_config("quattro","pfs");    
+       $pfs = get_config("quattro","pfs");
 
        return quattro_form($a,$align, $color, $tfs, $pfs);
 }
@@ -69,8 +69,8 @@ function quattro_form(App &$a, $align, $color, $tfs, $pfs){
                '$title'   => t("Theme settings"),
                '$align'   => array('quattro_align', t('Alignment'), $align, '', array('left'=>t('Left'), 'center'=>t('Center'))),
                '$color'   => array('quattro_color', t('Color scheme'), $color, '', $colors),
-        '$pfs'     => array('quattro_pfs', t('Posts font size'), $pfs),
-        '$tfs'     => array('quattro_tfs',t('Textareas font size'), $tfs),
+               '$pfs'     => array('quattro_pfs', t('Posts font size'), $pfs),
+               '$tfs'     => array('quattro_tfs',t('Textareas font size'), $tfs),
        ));
        return $o;
 }