Skip to content

Commit 06b1e07

Browse files
committed
style: code style
1 parent 53a4285 commit 06b1e07

2 files changed

Lines changed: 21 additions & 24 deletions

File tree

hook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ function plugin_formcreator_MassiveActions($itemtype) {
380380
PluginFormcreatorForm::class . MassiveAction::CLASS_ACTION_SEPARATOR . 'Export' => _sx('button', 'Export'),
381381
PluginFormcreatorForm::class . MassiveAction::CLASS_ACTION_SEPARATOR . 'AccessRights' => _sx('button', 'Access rights'),
382382
];
383-
}
383+
}
384384
return [];
385385
}
386386

inc/formaccesstype.class.php

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -96,31 +96,28 @@ public static function showForForm(CommonDBTM $item, $withtemplate = '') {
9696

9797
// Captcha
9898
$is_visible = $item->fields["access_rights"] == PluginFormcreatorForm::ACCESS_PUBLIC;
99-
// if ($item->fields["access_rights"] == PluginFormcreatorForm::ACCESS_PUBLIC) {
100-
echo '<tr id="plugin_formcreator_captcha" style="display: ' . ($is_visible ? 'block' : 'none') . '">';
101-
echo '<td>' . __('Enable captcha', 'formcreator') . '</td>';
102-
echo '<td>';
103-
Dropdown::showYesNo('is_captcha_enabled', $item->fields['is_captcha_enabled']);
104-
echo '</td>';
105-
echo '</tr>';
106-
// }
99+
echo '<tr id="plugin_formcreator_captcha" style="display: ' . ($is_visible ? 'block' : 'none') . '">';
100+
echo '<td>' . __('Enable captcha', 'formcreator') . '</td>';
101+
echo '<td>';
102+
Dropdown::showYesNo('is_captcha_enabled', $item->fields['is_captcha_enabled']);
103+
echo '</td>';
104+
echo '</tr>';
107105

106+
// Access restrictions
108107
$is_visible = $item->fields["access_rights"] == PluginFormcreatorForm::ACCESS_RESTRICTED;
109-
// if ($item->fields["access_rights"] == PluginFormcreatorForm::ACCESS_RESTRICTED) {
110-
echo '<tr id="plugin_formcreator_restrictions_head" style="display: ' . ($is_visible ? 'block' : 'none') . '">';
111-
echo '<th colspan="2">' . self::getTypeName(2) . '</th>';
112-
echo '</tr>';
113-
echo '<tr id="plugin_formcreator_restrictions" style="display: ' . ($is_visible ? 'block' : 'none') . '">';
114-
echo '<td><label>' . __('Restricted to') . '</label></td>';
115-
echo '<td class="restricted-form">';
116-
echo PluginFormcreatorRestrictedFormDropdown::show('restrictions', [
117-
'users_id' => $item->fields['users'] ?? [],
118-
'groups_id' => $item->fields['groups'] ?? [],
119-
'profiles_id' => $item->fields['profiles'] ?? [],
120-
]); // Does not supports display parameter to return the output instead of printing it
121-
echo '</td>';
122-
echo '</tr>';
123-
// }
108+
echo '<tr id="plugin_formcreator_restrictions_head" style="display: ' . ($is_visible ? 'block' : 'none') . '">';
109+
echo '<th colspan="2">' . self::getTypeName(2) . '</th>';
110+
echo '</tr>';
111+
echo '<tr id="plugin_formcreator_restrictions" style="display: ' . ($is_visible ? 'block' : 'none') . '">';
112+
echo '<td><label>' . __('Restricted to') . '</label></td>';
113+
echo '<td class="restricted-form">';
114+
echo PluginFormcreatorRestrictedFormDropdown::show('restrictions', [
115+
'users_id' => $item->fields['users'] ?? [],
116+
'groups_id' => $item->fields['groups'] ?? [],
117+
'profiles_id' => $item->fields['profiles'] ?? [],
118+
]);
119+
echo '</td>';
120+
echo '</tr>';
124121

125122
$formFk = PluginFormcreatorForm::getForeignKeyField();
126123
echo '<tr>';

0 commit comments

Comments
 (0)