added spaces + some curly braces + some usage of dbm::is_result()

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Haeder 2017-04-04 19:47:45 +02:00 committed by Roland Häder
parent cdff732044
commit 299c0122f6
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
8 changed files with 112 additions and 102 deletions

View file

@ -36,9 +36,9 @@ function feature_enabled($uid, $feature) {
*/
function get_feature_default($feature) {
$f = get_features();
foreach($f as $cat) {
foreach($cat as $feat) {
if(is_array($feat) && $feat[0] === $feature)
foreach ($f as $cat) {
foreach ($cat as $feat) {
if (is_array($feat) && $feat[0] === $feature)
return $feat[3];
}
}
@ -116,13 +116,13 @@ function get_features($filtered = true) {
// removed any locked features and remove the entire category if this makes it empty
if($filtered) {
foreach($arr as $k => $x) {
if ($filtered) {
foreach ($arr as $k => $x) {
$has_items = false;
$kquantity = count($arr[$k]);
for($y = 0; $y < $kquantity; $y ++) {
if(is_array($arr[$k][$y])) {
if($arr[$k][$y][4] === false) {
for ($y = 0; $y < $kquantity; $y ++) {
if (is_array($arr[$k][$y])) {
if ($arr[$k][$y][4] === false) {
$has_items = true;
}
else {
@ -130,7 +130,7 @@ function get_features($filtered = true) {
}
}
}
if(! $has_items) {
if (! $has_items) {
unset($arr[$k]);
}
}