added much more curly braces + space between "if" and brace

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2016-12-20 11:56:34 +01:00
parent e70b3b45df
commit 61c1317f80
50 changed files with 224 additions and 164 deletions

View File

@ -124,8 +124,9 @@ The selected 1st part will be saved in the database by the theme_post function.
function theme_post(App &$a){ function theme_post(App &$a){
// non local users shall not pass // non local users shall not pass
if(! local_user()) if (! local_user()) {
return; return;
}
// if the one specific submit button was pressed then proceed // if the one specific submit button was pressed then proceed
if (isset($_POST['duepuntozero-settings-submit'])){ if (isset($_POST['duepuntozero-settings-submit'])){
// and save the selection key into the personal config of the user // and save the selection key into the personal config of the user

View File

@ -392,8 +392,9 @@ function construct_acl_data(&$a, $user) {
function acl_lookup(&$a, $out_type = 'json') { function acl_lookup(&$a, $out_type = 'json') {
if(!local_user()) if (!local_user()) {
return ""; return '';
}
$start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0); $start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0);
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100); $count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100);

View File

@ -80,11 +80,13 @@ function networks_widget($baseurl,$selected = '') {
$a = get_app(); $a = get_app();
if(!local_user()) if (!local_user()) {
return ''; return '';
}
if(!feature_enabled(local_user(),'networks')) if (!feature_enabled(local_user(),'networks')) {
return ''; return '';
}
$extra_sql = unavailable_networks(); $extra_sql = unavailable_networks();
@ -116,15 +118,18 @@ function networks_widget($baseurl,$selected = '') {
} }
function fileas_widget($baseurl,$selected = '') { function fileas_widget($baseurl,$selected = '') {
if(! local_user()) if (! local_user()) {
return ''; return '';
}
if(! feature_enabled(local_user(),'filing')) if (! feature_enabled(local_user(),'filing')) {
return ''; return '';
}
$saved = get_pconfig(local_user(),'system','filetags'); $saved = get_pconfig(local_user(),'system','filetags');
if(! strlen($saved)) if (! strlen($saved)) {
return; return;
}
$matches = false; $matches = false;
$terms = array(); $terms = array();

View File

@ -13,11 +13,13 @@ function allfriends_content(App &$a) {
return; return;
} }
if($a->argc > 1) if ($a->argc > 1) {
$cid = intval($a->argv[1]); $cid = intval($a->argv[1]);
}
if(! $cid) if (! $cid) {
return; return;
}
$uid = $a->user['uid']; $uid = $a->user['uid'];
@ -26,7 +28,8 @@ function allfriends_content(App &$a) {
intval(local_user()) intval(local_user())
); );
if(! count($c)) if (! count($c)) {
}
return; return;
$a->page['aside'] = ""; $a->page['aside'] = "";

View File

@ -8,8 +8,9 @@ require_once('mod/proxy.php');
require_once('include/Photo.php'); require_once('include/Photo.php');
function contacts_init(App &$a) { function contacts_init(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$contact_id = 0; $contact_id = 0;
@ -138,8 +139,9 @@ function contacts_batch_actions(App &$a){
function contacts_post(App &$a) { function contacts_post(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
if ($a->argv[1]==="batch") { if ($a->argv[1]==="batch") {
contacts_batch_actions($a); contacts_batch_actions($a);
@ -147,8 +149,9 @@ function contacts_post(App &$a) {
} }
$contact_id = intval($a->argv[1]); $contact_id = intval($a->argv[1]);
if(! $contact_id) if (! $contact_id) {
return; return;
}
$orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", $orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($contact_id), intval($contact_id),

View File

@ -3,8 +3,9 @@ require_once("include/contact_selectors.php");
require_once("mod/contacts.php"); require_once("mod/contacts.php");
function crepair_init(App &$a) { function crepair_init(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$contact_id = 0; $contact_id = 0;
@ -31,8 +32,9 @@ function crepair_init(App &$a) {
function crepair_post(App &$a) { function crepair_post(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$cid = (($a->argc > 1) ? intval($a->argv[1]) : 0); $cid = (($a->argc > 1) ? intval($a->argv[1]) : 0);

View File

@ -9,8 +9,9 @@ require_once('include/event.php');
require_once('include/items.php'); require_once('include/items.php');
function events_init(App &$a) { function events_init(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
if ($a->argc == 1) { if ($a->argc == 1) {
// if it's a json request abort here becaus we don't // if it's a json request abort here becaus we don't
@ -34,8 +35,9 @@ function events_post(App &$a) {
logger('post: ' . print_r($_REQUEST,true)); logger('post: ' . print_r($_REQUEST,true));
if(! local_user()) if (! local_user()) {
return; return;
}
$event_id = ((x($_POST,'event_id')) ? intval($_POST['event_id']) : 0); $event_id = ((x($_POST,'event_id')) ? intval($_POST['event_id']) : 0);
$cid = ((x($_POST,'cid')) ? intval($_POST['cid']) : 0); $cid = ((x($_POST,'cid')) ? intval($_POST['cid']) : 0);

View File

@ -7,8 +7,9 @@ function fsuggest_post(App &$a) {
return; return;
} }
if($a->argc != 2) if ($a->argc != 2) {
return; return;
}
$contact_id = intval($a->argv[1]); $contact_id = intval($a->argv[1]);

View File

@ -5,12 +5,15 @@ function ignored_init(App &$a) {
$ignored = 0; $ignored = 0;
if(! local_user()) if (! local_user()) {
killme(); killme();
if($a->argc > 1) }
if ($a->argc > 1) {
$message_id = intval($a->argv[1]); $message_id = intval($a->argv[1]);
if(! $message_id) }
if (! $message_id) {
killme(); killme();
}
$r = q("SELECT `ignored` FROM `thread` WHERE `uid` = %d AND `iid` = %d LIMIT 1", $r = q("SELECT `ignored` FROM `thread` WHERE `uid` = %d AND `iid` = %d LIMIT 1",
intval(local_user()), intval(local_user()),
@ -20,8 +23,9 @@ function ignored_init(App &$a) {
killme(); killme();
} }
if(! intval($r[0]['ignored'])) if (! intval($r[0]['ignored'])) {
$ignored = 1; $ignored = 1;
}
$r = q("UPDATE `thread` SET `ignored` = %d WHERE `uid` = %d and `iid` = %d", $r = q("UPDATE `thread` SET `ignored` = %d WHERE `uid` = %d and `iid` = %d",
intval($ignored), intval($ignored),

View File

@ -5,8 +5,9 @@ require_once("include/text.php");
function manage_post(App &$a) { function manage_post(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$uid = local_user(); $uid = local_user();
$orig_record = $a->user; $orig_record = $a->user;

View File

@ -16,8 +16,9 @@ require_once('mod/proxy.php');
function match_content(App &$a) { function match_content(App &$a) {
$o = ''; $o = '';
if(! local_user()) if (! local_user()) {
return; return;
}
$a->page['aside'] .= findpeople_widget(); $a->page['aside'] .= findpeople_widget();
$a->page['aside'] .= follow_widget(); $a->page['aside'] .= follow_widget();

View File

@ -7,8 +7,9 @@ require_once('include/items.php');
function mood_init(App &$a) { function mood_init(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$uid = local_user(); $uid = local_user();
$verb = notags(trim($_GET['verb'])); $verb = notags(trim($_GET['verb']));

View File

@ -6,14 +6,16 @@ require_once('include/contact_selectors.php');
function nogroup_init(App &$a) { function nogroup_init(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
require_once('include/group.php'); require_once('include/group.php');
require_once('include/contact_widgets.php'); require_once('include/contact_widgets.php');
if(! x($a->page,'aside')) if (! x($a->page,'aside')) {
$a->page['aside'] = ''; $a->page['aside'] = '';
}
$a->page['aside'] .= group_side('contacts','group','extended',0,$contact_id); $a->page['aside'] .= group_side('contacts','group','extended',0,$contact_id);
} }

View File

@ -2,8 +2,9 @@
function notes_init(App &$a) { function notes_init(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$profile = 0; $profile = 0;

View File

@ -21,25 +21,29 @@ require_once('include/items.php');
function poke_init(App &$a) { function poke_init(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$uid = local_user(); $uid = local_user();
$verb = notags(trim($_GET['verb'])); $verb = notags(trim($_GET['verb']));
if(! $verb) if (! $verb) {
return; return;
}
$verbs = get_poke_verbs(); $verbs = get_poke_verbs();
if(! array_key_exists($verb,$verbs)) if (! array_key_exists($verb,$verbs)) {
return; return;
}
$activity = ACTIVITY_POKE . '#' . urlencode($verbs[$verb][0]); $activity = ACTIVITY_POKE . '#' . urlencode($verbs[$verb][0]);
$contact_id = intval($_GET['cid']); $contact_id = intval($_GET['cid']);
if(! $contact_id) if (! $contact_id) {
return; return;
}
$parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : 0); $parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : 0);

View File

@ -595,9 +595,10 @@ function profile_activity($changed, $value) {
$arr['deny_gid'] = $a->user['deny_gid']; $arr['deny_gid'] = $a->user['deny_gid'];
$i = item_store($arr); $i = item_store($arr);
if($i) if ($i) {
proc_run(PRIORITY_HIGH, "include/notifier.php", "activity", $i); proc_run(PRIORITY_HIGH, "include/notifier.php", "activity", $i);
} }
}
function profiles_content(App &$a) { function profiles_content(App &$a) {

View File

@ -2,8 +2,9 @@
function profperm_init(App &$a) { function profperm_init(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$which = $a->user['nickname']; $which = $a->user['nickname'];
$profile = $a->argv[1]; $profile = $a->argv[1];

View File

@ -2,8 +2,9 @@
function qsearch_init(App &$a) { function qsearch_init(App &$a) {
if(! local_user()) if (! local_user()) {
killme(); killme();
}
$limit = (get_config('system','qsearch_limit') ? intval(get_config('system','qsearch_limit')) : 100); $limit = (get_config('system','qsearch_limit') ? intval(get_config('system','qsearch_limit')) : 100);

View File

@ -114,8 +114,9 @@ function regmod_content(App &$a) {
return ''; return '';
} }
if($a->argc != 3) if ($a->argc != 3) {
killme(); killme();
}
$cmd = $a->argv[1]; $cmd = $a->argv[1];
$hash = $a->argv[2]; $hash = $a->argv[2];

View File

@ -118,8 +118,9 @@ function settings_init(App &$a) {
function settings_post(App &$a) { function settings_post(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) { if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
return; return;

View File

@ -7,12 +7,15 @@ function starred_init(App &$a) {
$starred = 0; $starred = 0;
if(! local_user()) if (! local_user()) {
killme(); killme();
if($a->argc > 1) }
if ($a->argc > 1) {
$message_id = intval($a->argv[1]); $message_id = intval($a->argv[1]);
if(! $message_id) }
if (! $message_id) {
killme(); killme();
}
$r = q("SELECT starred FROM item WHERE uid = %d AND id = %d LIMIT 1", $r = q("SELECT starred FROM item WHERE uid = %d AND id = %d LIMIT 1",
intval(local_user()), intval(local_user()),

View File

@ -5,8 +5,9 @@ require_once('include/contact_widgets.php');
function suggest_init(App &$a) { function suggest_init(App &$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
if (x($_GET,'ignore') && intval($_GET['ignore'])) { if (x($_GET,'ignore') && intval($_GET['ignore'])) {
// Check if we should do HTML-based delete confirmation // Check if we should do HTML-based delete confirmation

View File

@ -63,7 +63,6 @@ function tagrm_content(App &$a) {
// NOTREACHED // NOTREACHED
} }
$r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1", $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($item), intval($item),
intval(local_user()) intval(local_user())
@ -75,8 +74,9 @@ function tagrm_content(App &$a) {
$arr = explode(',', $r[0]['tag']); $arr = explode(',', $r[0]['tag']);
if(! count($arr)) if (! count($arr)) {
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
}
$o .= '<h3>' . t('Remove Item Tag') . '</h3>'; $o .= '<h3>' . t('Remove Item Tag') . '</h3>';

View File

@ -1,8 +1,9 @@
<?php <?php
function uexport_init(App &$a){ function uexport_init(App &$a){
if(! local_user()) if (! local_user()) {
killme(); killme();
}
require_once("mod/settings.php"); require_once("mod/settings.php");
settings_init($a); settings_init($a);

View File

@ -6,8 +6,9 @@
function theme_content(App &$a){ function theme_content(App &$a){
if(!local_user()) if (!local_user()) {
return; return;
}
$colorset = get_pconfig( local_user(), 'duepuntozero', 'colorset'); $colorset = get_pconfig( local_user(), 'duepuntozero', 'colorset');
$user = true; $user = true;
@ -16,8 +17,9 @@ function theme_content(App &$a){
} }
function theme_post(App &$a){ function theme_post(App &$a){
if(! local_user()) if (! local_user()) {
return; return;
}
if (isset($_POST['duepuntozero-settings-submit'])){ if (isset($_POST['duepuntozero-settings-submit'])){
set_pconfig(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']); set_pconfig(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
@ -49,17 +51,21 @@ function clean_form(&$a, &$colorset, $user){
'comix'=>t('comix'), 'comix'=>t('comix'),
'slackr'=>t('slackr'), 'slackr'=>t('slackr'),
); );
if ($user) { if ($user) {
$color = get_pconfig(local_user(), 'duepuntozero', 'colorset'); $color = get_pconfig(local_user(), 'duepuntozero', 'colorset');
} else { } else {
$color = get_config( 'duepuntozero', 'colorset'); $color = get_config( 'duepuntozero', 'colorset');
} }
$t = get_markup_template("theme_settings.tpl" ); $t = get_markup_template("theme_settings.tpl" );
/// @TODO No need for adding string here, $o is not defined
$o .= replace_macros($t, array( $o .= replace_macros($t, array(
'$submit' => t('Submit'), '$submit' => t('Submit'),
'$baseurl' => App::get_baseurl(), '$baseurl' => App::get_baseurl(),
'$title'=> t("Theme settings"), '$title'=> t("Theme settings"),
'$colorset' => array('duepuntozero_colorset', t('Variations'), $color, '', $colorset), '$colorset' => array('duepuntozero_colorset', t('Variations'), $color, '', $colorset),
)); ));
return $o; return $o;
} }

View File

@ -2,7 +2,9 @@
require_once('view/theme/frio/php/Image.php'); require_once('view/theme/frio/php/Image.php');
function theme_content(App &$a) { function theme_content(App &$a) {
if(!local_user()) { return;} if (!local_user()) {
return;
}
$arr = array(); $arr = array();
$arr["schema"] = get_pconfig(local_user(),'frio', 'schema'); $arr["schema"] = get_pconfig(local_user(),'frio', 'schema');
@ -18,7 +20,10 @@ function theme_content(App &$a) {
} }
function theme_post(App &$a) { function theme_post(App &$a) {
if(!local_user()) { return;} if (!local_user()) {
return;
}
if (isset($_POST['frio-settings-submit'])) { if (isset($_POST['frio-settings-submit'])) {
set_pconfig(local_user(), 'frio', 'schema', $_POST["frio_schema"]); set_pconfig(local_user(), 'frio', 'schema', $_POST["frio_schema"]);
set_pconfig(local_user(), 'frio', 'nav_bg', $_POST["frio_nav_bg"]); set_pconfig(local_user(), 'frio', 'nav_bg', $_POST["frio_nav_bg"]);

View File

@ -6,8 +6,9 @@
function theme_content(App &$a){ function theme_content(App &$a){
if(!local_user()) if (!local_user()) {
return; return;
}
$align = get_pconfig(local_user(), 'quattro', 'align' ); $align = get_pconfig(local_user(), 'quattro', 'align' );
$color = get_pconfig(local_user(), 'quattro', 'color' ); $color = get_pconfig(local_user(), 'quattro', 'color' );
@ -18,8 +19,9 @@ function theme_content(App &$a){
} }
function theme_post(App &$a){ function theme_post(App &$a){
if(! local_user()) if (! local_user()) {
return; return;
}
if (isset($_POST['quattro-settings-submit'])){ if (isset($_POST['quattro-settings-submit'])){
set_pconfig(local_user(), 'quattro', 'align', $_POST['quattro_align']); set_pconfig(local_user(), 'quattro', 'align', $_POST['quattro_align']);

View File

@ -6,19 +6,23 @@
function theme_content(App &$a){ function theme_content(App &$a){
if(!local_user()) if (!local_user()) {
return; return;
}
if (!function_exists('get_vier_config')) if (!function_exists('get_vier_config')) {
return; return;
}
$style = get_pconfig(local_user(), 'vier', 'style'); $style = get_pconfig(local_user(), 'vier', 'style');
if ($style == "") if ($style == "") {
$style = get_config('vier', 'style'); $style = get_config('vier', 'style');
}
if ($style == "") if ($style == "") {
$style = "plus"; $style = "plus";
}
$show_pages = get_vier_config('show_pages', true); $show_pages = get_vier_config('show_pages', true);
$show_profiles = get_vier_config('show_profiles', true); $show_profiles = get_vier_config('show_profiles', true);
@ -32,8 +36,9 @@ function theme_content(App &$a){
} }
function theme_post(App &$a){ function theme_post(App &$a){
if(! local_user()) if (! local_user()) {
return; return;
}
if (isset($_POST['vier-settings-submit'])){ if (isset($_POST['vier-settings-submit'])){
set_pconfig(local_user(), 'vier', 'style', $_POST['vier_style']); set_pconfig(local_user(), 'vier', 'style', $_POST['vier_style']);