Skip to content

Commit

Permalink
style: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed May 12, 2023
1 parent 53a4285 commit 06b1e07
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
2 changes: 1 addition & 1 deletion hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ function plugin_formcreator_MassiveActions($itemtype) {
PluginFormcreatorForm::class . MassiveAction::CLASS_ACTION_SEPARATOR . 'Export' => _sx('button', 'Export'),
PluginFormcreatorForm::class . MassiveAction::CLASS_ACTION_SEPARATOR . 'AccessRights' => _sx('button', 'Access rights'),
];
}
}
return [];
}

Expand Down
43 changes: 20 additions & 23 deletions inc/formaccesstype.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,31 +96,28 @@ public static function showForForm(CommonDBTM $item, $withtemplate = '') {

// Captcha
$is_visible = $item->fields["access_rights"] == PluginFormcreatorForm::ACCESS_PUBLIC;
// if ($item->fields["access_rights"] == PluginFormcreatorForm::ACCESS_PUBLIC) {
echo '<tr id="plugin_formcreator_captcha" style="display: ' . ($is_visible ? 'block' : 'none') . '">';
echo '<td>' . __('Enable captcha', 'formcreator') . '</td>';
echo '<td>';
Dropdown::showYesNo('is_captcha_enabled', $item->fields['is_captcha_enabled']);
echo '</td>';
echo '</tr>';
// }
echo '<tr id="plugin_formcreator_captcha" style="display: ' . ($is_visible ? 'block' : 'none') . '">';
echo '<td>' . __('Enable captcha', 'formcreator') . '</td>';
echo '<td>';
Dropdown::showYesNo('is_captcha_enabled', $item->fields['is_captcha_enabled']);
echo '</td>';
echo '</tr>';

// Access restrictions
$is_visible = $item->fields["access_rights"] == PluginFormcreatorForm::ACCESS_RESTRICTED;
// if ($item->fields["access_rights"] == PluginFormcreatorForm::ACCESS_RESTRICTED) {
echo '<tr id="plugin_formcreator_restrictions_head" style="display: ' . ($is_visible ? 'block' : 'none') . '">';
echo '<th colspan="2">' . self::getTypeName(2) . '</th>';
echo '</tr>';
echo '<tr id="plugin_formcreator_restrictions" style="display: ' . ($is_visible ? 'block' : 'none') . '">';
echo '<td><label>' . __('Restricted to') . '</label></td>';
echo '<td class="restricted-form">';
echo PluginFormcreatorRestrictedFormDropdown::show('restrictions', [
'users_id' => $item->fields['users'] ?? [],
'groups_id' => $item->fields['groups'] ?? [],
'profiles_id' => $item->fields['profiles'] ?? [],
]); // Does not supports display parameter to return the output instead of printing it
echo '</td>';
echo '</tr>';
// }
echo '<tr id="plugin_formcreator_restrictions_head" style="display: ' . ($is_visible ? 'block' : 'none') . '">';
echo '<th colspan="2">' . self::getTypeName(2) . '</th>';
echo '</tr>';
echo '<tr id="plugin_formcreator_restrictions" style="display: ' . ($is_visible ? 'block' : 'none') . '">';
echo '<td><label>' . __('Restricted to') . '</label></td>';
echo '<td class="restricted-form">';
echo PluginFormcreatorRestrictedFormDropdown::show('restrictions', [
'users_id' => $item->fields['users'] ?? [],
'groups_id' => $item->fields['groups'] ?? [],
'profiles_id' => $item->fields['profiles'] ?? [],
]);
echo '</td>';
echo '</tr>';

$formFk = PluginFormcreatorForm::getForeignKeyField();
echo '<tr>';
Expand Down

0 comments on commit 06b1e07

Please sign in to comment.