]> git.mxchange.org Git - friendica.git/commitdiff
Coding convention:
authorRoland Häder <roland@mxchange.org>
Tue, 20 Dec 2016 09:35:28 +0000 (10:35 +0100)
committerRoland Häder <roland@mxchange.org>
Tue, 20 Dec 2016 09:40:09 +0000 (10:40 +0100)
- added curly braces
- added space between "if" and brace

Signed-off-by: Roland Häder <roland@mxchange.org>
include/identity.php
include/plugin.php
mod/admin.php
mod/cal.php
mod/content.php
mod/delegate.php
mod/dfrn_confirm.php
mod/events.php
mod/removeme.php
mod/settings.php
object/Item.php

index 1307b42b1bf6905ef09af6069308284f7b47797f..5439b2cc1055ccacfab59f4530178710c3ce1449 100644 (file)
@@ -229,13 +229,16 @@ function profile_sidebar($profile, $block = 0) {
 
        // Is the local user already connected to that user?
        if ($connect AND local_user()) {
-               if (isset($profile["url"]))
+               if (isset($profile["url"])) {
                        $profile_url = normalise_link($profile["url"]);
-               else
+               }
+               else {
                        $profile_url = normalise_link(App::get_baseurl()."/profile/".$profile["nickname"]);
+               }
 
                $r = q("SELECT * FROM `contact` WHERE NOT `pending` AND `uid` = %d AND `nurl` = '%s'",
                        local_user(), $profile_url);
+
                if (dbm::is_result($r))
                        $connect = false;
        }
@@ -684,8 +687,9 @@ function advanced_profile(&$a) {
                        $profile['forumlist'] = array( t('Forums:'), ForumManager::profile_advanced($uid));
                }
 
-               if ($a->profile['uid'] == local_user())
+               if ($a->profile['uid'] == local_user()) {
                        $profile['edit'] = array(App::get_baseurl(). '/profiles/'.$a->profile['id'], t('Edit profile'),"", t('Edit profile'));
+               }
 
                return replace_macros($tpl, array(
                        '$title' => t('Profile'),
index 4242b730b036223add0f81fbc504c3509599aedd..c7c44e433ddfc134112d29d797e9e0396182dab8 100644 (file)
@@ -412,8 +412,9 @@ function get_theme_info($theme){
 function get_theme_screenshot($theme) {
        $exts = array('.png','.jpg');
        foreach($exts as $ext) {
-               if(file_exists('view/theme/' . $theme . '/screenshot' . $ext))
+               if(file_exists('view/theme/' . $theme . '/screenshot' . $ext)) {
                        return(App::get_baseurl() . '/view/theme/' . $theme . '/screenshot' . $ext);
+               }
        }
        return(App::get_baseurl() . '/images/blank.png');
 }
index 832ca470fe3e506d9010c949e42430a2eef34f39..b4495a1946d3c744907ed79a9e62a5a9e6b4ccd4 100644 (file)
@@ -32,13 +32,12 @@ function admin_post(&$a){
 
        // do not allow a page manager to access the admin panel at all.
 
-       if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
+       if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
                return;
-
-
+       }
 
        // urls
-       if($a->argc > 1) {
+       if ($a->argc > 1) {
                switch ($a->argv[1]){
                        case 'site':
                                admin_page_site_post($a);
@@ -134,8 +133,9 @@ function admin_content(&$a) {
                return login(false);
        }
 
-       if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
+       if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
                return "";
+       }
 
        // APC deactivated, since there are problems with PHP 5.5
        //if (function_exists("apc_delete")) {
index 1899a9899a48dccc94de34af3a72ad90108ef8a0..8b8dbed958ad3284bf3aee4ad85126e7b229c9ed 100644 (file)
@@ -231,8 +231,9 @@ function cal_content(&$a) {
                        $r = sort_by_date($r);
                        foreach($r as $rr) {
                                $j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j'));
-                               if(! x($links,$j))
+                               if(! x($links,$j)) {
                                        $links[$j] = App::get_baseurl() . '/' . $a->cmd . '#link-' . $j;
+                               }
                        }
                }
 
index 332a35f006c472fd5ab4b26f40ce8cad2354e725..1a3fb109528da0d10f082a17c52b4178b7b5a6e3 100644 (file)
@@ -742,10 +742,11 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
                                        }
                                }
 
-                               if(local_user() && link_compare($a->contact['url'],$item['author-link']))
+                               if (local_user() && link_compare($a->contact['url'],$item['author-link'])) {
                                        $edpost = array(App::get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit"));
-                               else
+                               } else {
                                        $edpost = false;
+                               }
 
                                $drop = '';
                                $dropping = false;
@@ -764,7 +765,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
 
                                $isstarred = "unstarred";
                                if ($profile_owner == local_user()) {
-                                       if($toplevelpost) {
+                                       if ($toplevelpost) {
                                                $isstarred = (($item['starred']) ? "starred" : "unstarred");
 
                                                $star = array(
@@ -782,6 +783,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
                                                        intval($item['uid']),
                                                        intval($item['id'])
                                                );
+
                                                if (dbm::is_result($r)) {
                                                        $ignore = array(
                                                                'do' => t("ignore thread"),
@@ -793,7 +795,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
                                                        );
                                                }
                                                $tagger = '';
-                                               if(feature_enabled($profile_owner,'commtag')) {
+                                               if (feature_enabled($profile_owner,'commtag')) {
                                                        $tagger = array(
                                                                'add' => t("add tag"),
                                                                'class' => "",
@@ -818,19 +820,22 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
 
                                $sp = false;
                                $profile_link = best_link_url($item,$sp);
-                               if($profile_link === 'mailbox')
+                               if ($profile_link === 'mailbox') {
                                        $profile_link = '';
-                               if($sp)
+                               }
+                               if ($sp) {
                                        $sparkle = ' sparkle';
-                               else
+                               } else {
                                        $profile_link = zrl($profile_link);
+                               }
 
                                // Don't rely on the author-avatar. It is better to use the data from the contact table
                                $author_contact = get_contact_details_by_url($item['author-link'], $profile_owner);
-                               if ($author_contact["thumb"])
+                               if ($author_contact["thumb"]) {
                                        $profile_avatar = $author_contact["thumb"];
-                               else
+                               } else {
                                        $profile_avatar = $item['author-avatar'];
+                               }
 
                                $like    = ((x($conv_responses['like'],$item['uri'])) ? format_like($conv_responses['like'][$item['uri']],$conv_responses['like'][$item['uri'] . '-l'],'like',$item['uri']) : '');
                                $dislike = ((x($conv_responses['dislike'],$item['uri'])) ? format_like($conv_responses['dislike'][$item['uri']],$conv_responses['dislike'][$item['uri'] . '-l'],'dislike',$item['uri']) : '');
index 0ba5dd39c1e53d36eda5f35caf4079aa0bfcdff0..94e641068d67bec37c7e6785a52cb92ab66f0a20 100644 (file)
@@ -17,8 +17,9 @@ function delegate_content(&$a) {
 
                // delegated admins can view but not change delegation permissions
 
-               if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
+               if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
                        goaway(App::get_baseurl() . '/delegate');
+               }
 
 
                $id = $a->argv[2];
@@ -45,8 +46,9 @@ function delegate_content(&$a) {
 
                // delegated admins can view but not change delegation permissions
 
-               if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
+               if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
                        goaway(App::get_baseurl() . '/delegate');
+               }
 
                q("delete from manage where uid = %d and mid = %d limit 1",
                        intval($a->argv[2]),
index 69d708f7fc3e9b99f540f300c7f3b38a0440a555..6d97899afff3d627544c7517857299082cd7fcd8 100644 (file)
@@ -661,10 +661,11 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                $r = q("SELECT `photo` FROM `contact` WHERE `id` = %d LIMIT 1",
                        intval($dfrn_record));
 
-               if (dbm::is_result($r))
+               if (dbm::is_result($r)) {
                        $photo = $r[0]['photo'];
-               else
+               } else {
                        $photo = App::get_baseurl() . '/images/person-175.jpg';
+               }
 
                require_once("include/Photo.php");
 
@@ -673,11 +674,13 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                logger('dfrn_confirm: request - photos imported');
 
                $new_relation = CONTACT_IS_SHARING;
-               if(($relation == CONTACT_IS_FOLLOWER) || ($duplex))
+               if (($relation == CONTACT_IS_FOLLOWER) || ($duplex)) {
                        $new_relation = CONTACT_IS_FRIEND;
+               }
 
-               if(($relation == CONTACT_IS_FOLLOWER) && ($duplex))
+               if (($relation == CONTACT_IS_FOLLOWER) && ($duplex)) {
                        $duplex = 0;
+               }
 
                $r = q("UPDATE `contact` SET
                        `rel` = %d,
@@ -699,7 +702,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                        dbesc(NETWORK_DFRN),
                        intval($dfrn_record)
                );
-               if($r === false) {    // indicates schema is messed up or total db failure
+               if ($r === false) {    // indicates schema is messed up or total db failure
                        $message = t('Unable to update your contact profile details on our system');
                        xml_status(3,$message);
                }
index 9dbf7efb53fc74c574faace8fc1ebba5d97342f3..bb9cc3c52e28d3a661bc42ed9bcb7d6212789144 100644 (file)
@@ -336,8 +336,9 @@ function events_content(&$a) {
                        $r = sort_by_date($r);
                        foreach($r as $rr) {
                                $j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j'));
-                               if(! x($links,$j))
+                               if(! x($links,$j)) {
                                        $links[$j] = App::get_baseurl() . '/' . $a->cmd . '#link-' . $j;
+                               }
                        }
                }
 
index 904606fd57cb77b69a1a0b7ef48a9025ff012f25..b7043f37bb001f298f4716f1c79e6cda1e250c19 100644 (file)
@@ -2,24 +2,29 @@
 
 function removeme_post(&$a) {
 
-       if(! local_user())
+       if (! local_user()) {
                return;
+       }
 
-       if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
+       if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
                return;
+       }
 
-       if((! x($_POST,'qxz_password')) || (! strlen(trim($_POST['qxz_password']))))
+       if ((! x($_POST,'qxz_password')) || (! strlen(trim($_POST['qxz_password'])))) {
                return;
+       }
 
-       if((! x($_POST,'verify')) || (! strlen(trim($_POST['verify']))))
+       if ((! x($_POST,'verify')) || (! strlen(trim($_POST['verify'])))) {
                return;
+       }
 
-       if($_POST['verify'] !== $_SESSION['remove_account_verify'])
+       if ($_POST['verify'] !== $_SESSION['remove_account_verify']) {
                return;
+       }
 
        $encrypted = hash('whirlpool',trim($_POST['qxz_password']));
 
-       if((strlen($a->user['password'])) && ($encrypted === $a->user['password'])) {
+       if ((strlen($a->user['password'])) && ($encrypted === $a->user['password'])) {
                require_once('include/Contact.php');
                user_remove($a->user['uid']);
                // NOTREACHED
@@ -29,13 +34,14 @@ function removeme_post(&$a) {
 
 function removeme_content(&$a) {
 
-       if(! local_user())
+       if (! local_user()) {
                goaway(z_root());
+       }
 
        $hash = random_string();
 
-        require_once("mod/settings.php");
-        settings_init($a);
+       require_once("mod/settings.php");
+       settings_init($a);
 
        $_SESSION['remove_account_verify'] = $hash;
 
index e7fd55e944657e0fd5c296abced49520bfa4fea1..3ea4d7acf8fc297db18a96805f6fc85b175a7a51 100644 (file)
@@ -121,17 +121,18 @@ function settings_post(&$a) {
        if(! local_user())
                return;
 
-       if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
+       if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
                return;
+       }
 
-       if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) {
+       if (count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
        }
 
        $old_page_flags = $a->user['page-flags'];
 
-       if(($a->argc > 1) && ($a->argv[1] === 'oauth') && x($_POST,'remove')){
+       if (($a->argc > 1) && ($a->argv[1] === 'oauth') && x($_POST,'remove')) {
                check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth');
 
                $key = $_POST['remove'];
@@ -142,7 +143,7 @@ function settings_post(&$a) {
                return;
        }
 
-       if(($a->argc > 2) && ($a->argv[1] === 'oauth')  && ($a->argv[2] === 'edit'||($a->argv[2] === 'add')) && x($_POST,'submit')) {
+       if (($a->argc > 2) && ($a->argv[1] === 'oauth')  && ($a->argv[2] === 'edit'||($a->argv[2] === 'add')) && x($_POST,'submit')) {
 
                check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth');
 
@@ -661,7 +662,7 @@ function settings_content(&$a) {
                return;
        }
 
-       if(x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
+       if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
                notice( t('Permission denied.') . EOL );
                return;
        }
index 45d2dba3edb78c81c68823eecb1d08e312b4b8c0..d14b5418cc54469fb6df79e71998384f0e0d514a 100644 (file)
@@ -117,15 +117,19 @@ class Item extends BaseObject {
                        ? t('Private Message')
                        : false);
                $shareable = ((($conv->get_profile_owner() == local_user()) && ($item['private'] != 1)) ? true : false);
-               if(local_user() && link_compare($a->contact['url'],$item['author-link'])) {
-                       if ($item["event-id"] != 0)
+               if (local_user() && link_compare($a->contact['url'],$item['author-link'])) {
+                       if ($item["event-id"] != 0) {
                                $edpost = array("events/event/".$item['event-id'], t("Edit"));
-                       else
+                       } else {
                                $edpost = array("editpost/".$item['id'], t("Edit"));
-               } else
+                       }
+               } else {
                        $edpost = false;
-               if(($this->get_data_value('uid') == local_user()) || $this->is_visiting())
+               }
+
+               if (($this->get_data_value('uid') == local_user()) || $this->is_visiting()) {
                        $dropping = true;
+               }
 
                $drop = array(
                        'dropping' => $dropping,
@@ -143,27 +147,31 @@ class Item extends BaseObject {
 
                $sp = false;
                $profile_link = best_link_url($item,$sp);
-               if($profile_link === 'mailbox')
+               if ($profile_link === 'mailbox') {
                        $profile_link = '';
-               if($sp)
+               }
+               if ($sp) {
                        $sparkle = ' sparkle';
-               else
+               } else {
                        $profile_link = zrl($profile_link);
+               }
 
                if (!isset($item['author-thumb']) OR ($item['author-thumb'] == "")) {
                        $author_contact = get_contact_details_by_url($item['author-link'], $conv->get_profile_owner());
-                       if ($author_contact["thumb"])
+                       if ($author_contact["thumb"]) {
                                $item['author-thumb'] = $author_contact["thumb"];
-                       else
+                       } else {
                                $item['author-thumb'] = $item['author-avatar'];
+                       }
                }
 
                if (!isset($item['owner-thumb']) OR ($item['owner-thumb'] == "")) {
                        $owner_contact = get_contact_details_by_url($item['owner-link'], $conv->get_profile_owner());
-                       if ($owner_contact["thumb"])
+                       if ($owner_contact["thumb"]) {
                                $item['owner-thumb'] = $owner_contact["thumb"];
-                       else
+                       } else {
                                $item['owner-thumb'] = $item['owner-avatar'];
+                       }
                }
 
                $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');