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){
// non local users shall not pass
if(! local_user())
if (! local_user()) {
return;
}
// if the one specific submit button was pressed then proceed
if (isset($_POST['duepuntozero-settings-submit'])){
// 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') {
if(!local_user())
return "";
if (!local_user()) {
return '';
}
$start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0);
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100);

View File

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

View File

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

View File

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

View File

@ -3,8 +3,9 @@ require_once("include/contact_selectors.php");
require_once("mod/contacts.php");
function crepair_init(App &$a) {
if(! local_user())
if (! local_user()) {
return;
}
$contact_id = 0;
@ -31,8 +32,9 @@ function crepair_init(App &$a) {
function crepair_post(App &$a) {
if(! local_user())
if (! local_user()) {
return;
}
$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');
function events_init(App &$a) {
if(! local_user())
if (! local_user()) {
return;
}
if ($a->argc == 1) {
// 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));
if(! local_user())
if (! local_user()) {
return;
}
$event_id = ((x($_POST,'event_id')) ? intval($_POST['event_id']) : 0);
$cid = ((x($_POST,'cid')) ? intval($_POST['cid']) : 0);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -21,25 +21,29 @@ require_once('include/items.php');
function poke_init(App &$a) {
if(! local_user())
if (! local_user()) {
return;
}
$uid = local_user();
$verb = notags(trim($_GET['verb']));
if(! $verb)
if (! $verb) {
return;
}
$verbs = get_poke_verbs();
if(! array_key_exists($verb,$verbs))
if (! array_key_exists($verb,$verbs)) {
return;
}
$activity = ACTIVITY_POKE . '#' . urlencode($verbs[$verb][0]);
$contact_id = intval($_GET['cid']);
if(! $contact_id)
if (! $contact_id) {
return;
}
$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'];
$i = item_store($arr);
if($i)
if ($i) {
proc_run(PRIORITY_HIGH, "include/notifier.php", "activity", $i);
}
}
function profiles_content(App &$a) {

View File

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

View File

@ -2,8 +2,9 @@
function qsearch_init(App &$a) {
if(! local_user())
if (! local_user()) {
killme();
}
$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 '';
}
if($a->argc != 3)
if ($a->argc != 3) {
killme();
}
$cmd = $a->argv[1];
$hash = $a->argv[2];

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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