added curly braces + fixed indenting according to code review by Hypolite

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2016-12-30 21:48:09 +01:00
parent c30647e15e
commit bc9cb5e5f6
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
5 changed files with 42 additions and 43 deletions

View file

@ -110,13 +110,11 @@ function new_contact($uid,$url,$interactive = false) {
// NOTREACHED // NOTREACHED
} }
} else { } elseif (get_config('system','dfrn_only')) {
if (get_config('system','dfrn_only')) {
$result['message'] = t('This site is not configured to allow communications with other networks.') . EOL; $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; $result['message'] != t('No compatible communication protocols or feeds were discovered.') . EOL;
return $result; return $result;
} }
}
// This extra param just confuses things, remove it // This extra param just confuses things, remove it
if ($ret['network'] === NETWORK_DIASPORA) { if ($ret['network'] === NETWORK_DIASPORA) {

View file

@ -955,13 +955,15 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
$r = q('SELECT * FROM `item` WHERE `id` = %d', intval($current_post)); $r = q('SELECT * FROM `item` WHERE `id` = %d', intval($current_post));
if ((dbm::is_result($r)) && (count($r) == 1)) { if ((dbm::is_result($r)) && (count($r) == 1)) {
if ($notify) if ($notify) {
call_hooks('post_local_end', $r[0]); call_hooks('post_local_end', $r[0]);
else } else {
call_hooks('post_remote_end', $r[0]); call_hooks('post_remote_end', $r[0]);
} else }
} else {
logger('item_store: new item not found in DB, id ' . $current_post); logger('item_store: new item not found in DB, id ' . $current_post);
} }
}
if ($arr['parent-uri'] === $arr['uri']) { if ($arr['parent-uri'] === $arr['uri']) {
add_thread($current_post); add_thread($current_post);
@ -994,8 +996,9 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
check_item_notification($current_post, $uid); check_item_notification($current_post, $uid);
if ($notify) if ($notify) {
proc_run(PRIORITY_HIGH, "include/notifier.php", $notify_type, $current_post); proc_run(PRIORITY_HIGH, "include/notifier.php", $notify_type, $current_post);
}
return $current_post; return $current_post;
} }

View file

@ -45,6 +45,7 @@ function contacts_init(App &$a) {
$networkname = ''; $networkname = '';
} }
/// @TODO Add nice spaces
$vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array( $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array(
'$name' => htmlentities($a->data['contact']['name']), '$name' => htmlentities($a->data['contact']['name']),
'$photo' => $a->data['contact']['photo'], '$photo' => $a->data['contact']['photo'],
@ -54,17 +55,18 @@ function contacts_init(App &$a) {
'$network' => t('Network:'), '$network' => t('Network:'),
'$account_type' => account_type($a->data['contact']) '$account_type' => account_type($a->data['contact'])
)); ));
$finpeople_widget = ''; $finpeople_widget = '';
$follow_widget = ''; $follow_widget = '';
$networks_widget = ''; $networks_widget = '';
} } else {
else {
$vcard_widget = ''; $vcard_widget = '';
$networks_widget .= networks_widget('contacts',$_GET['nets']); $networks_widget .= networks_widget('contacts',$_GET['nets']);
if (isset($_GET['add'])) if (isset($_GET['add'])) {
$follow_widget = follow_widget($_GET['add']); $follow_widget = follow_widget($_GET['add']);
else } else {
$follow_widget = follow_widget(); $follow_widget = follow_widget();
}
$findpeople_widget .= findpeople_widget(); $findpeople_widget .= findpeople_widget();
} }

View file

@ -111,11 +111,9 @@ function profile_content(&$a, $update = 0) {
if ($update) { if ($update) {
// Ensure we've got a profile owner if updating. // Ensure we've got a profile owner if updating.
$a->profile['profile_uid'] = $update; $a->profile['profile_uid'] = $update;
} else { } elseif ($a->profile['profile_uid'] == local_user()) {
if ($a->profile['profile_uid'] == local_user()) {
nav_set_selected('home'); nav_set_selected('home');
} }
}
$contact = null; $contact = null;
$remote_contact = false; $remote_contact = false;
@ -158,12 +156,12 @@ function profile_content(&$a, $update = 0) {
} }
if (! $update) { if (! $update) {
if (x($_GET,'tab')) if (x($_GET,'tab')) {
$tab = notags(trim($_GET['tab'])); $tab = notags(trim($_GET['tab']));
}
$o.=profile_tabs($a, $is_owner, $a->profile['nickname']); $o.=profile_tabs($a, $is_owner, $a->profile['nickname']);
if ($tab === 'profile') { if ($tab === 'profile') {
$o .= advanced_profile($a); $o .= advanced_profile($a);
call_hooks('profile_advanced',$o); call_hooks('profile_advanced',$o);
@ -201,14 +199,12 @@ function profile_content(&$a, $update = 0) {
$o .= status_editor($a,$x); $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 * 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); $sql_extra = item_permissions_sql($a->profile['profile_uid'],$remote_contact,$groups);