Commit 89c37374 authored by sept_7's avatar sept_7

[ENH] coding style avoir function in for loop, PHPCS

parent 6978c884
......@@ -348,10 +348,10 @@ $masterPerms = array();
foreach ($candidates['data'] as $perm) {
$perm['label'] = tra($perm['permDesc']) . ' <em>(' . $perm['permName'] . ')</em>' . '<span style="display:none;">' . tra($perm['level'] . '</span>');
for( $i = 0; $i < count($groupNames); $i++) {
$p = $displayedPermissions->has( $groupNames[$i], $perm['permName'] ) ? 'y' : 'n';
$perm[$groupNames[$i] . '_hasPerm'] = $p;
$perm[$groupIndices[$i]] = $p;
foreach( $groupNames as $index => $groupName ) {
$p = $displayedPermissions->has( $groupName, $perm['permName'] ) ? 'y' : 'n';
$perm[$groupName . '_hasPerm'] = $p;
$perm[$groupIndices[$index]] = $p;
}
if (($feature_filter === false || in_array( $perm['type'], $feature_filter)) && ($restrictions === false || in_array( $perm['permName'], $restrictions ))) {
......@@ -386,14 +386,13 @@ $smarty->assign_by_ref('features', $features);
// Create JS to set up checkboxs (showing group inheritance)
$js = '';
for( $i = 0; $i < count($groupNames); $i++) {
$groupName = addslashes($groupNames[$i]);
foreach( $groupNames as $groupName ) {
$groupName = addslashes($groupName);
$beneficiaries = '';
for( $j = 0; $j < count($groupInheritance); $j++) {
if (is_array($groupInheritance[$j]) && in_array($groupName, $groupInheritance[$j])) {
foreach( $groupInheritance as $index => $gi ) {
if ( is_array($gi) && in_array($groupName, $gi) ) {
$beneficiaries .= !empty($beneficiaries) ? ',' : '';
$beneficiaries .='input[name="perm['. addslashes($groupNames[$j]).'][]"]';
$beneficiaries .='input[name="perm['. addslashes($groupNames[$index]).'][]"]';
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment