@@ -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