@@ -98,6 +98,7 @@ protected static function buildCreateOrEditRoleTable(
9898 ?Role $ role = null ,
9999 ): \DOMElement {
100100 $ table = $ dom ->createElement ('table ' );
101+ $ table ->setAttribute ('class ' , 'form-table ' );
101102 $ tBody = $ dom ->createElement ('tbody ' );
102103
103104 $ rolename = !is_null ($ role )
@@ -115,10 +116,9 @@ protected static function buildCreateOrEditRoleTable(
115116 'content ' => $ rolename ,
116117 'max-length ' => 63 ,
117118 'readonly ' => !is_null ($ role ),
118- 'type ' => 'text ' ,
119119 ],
120120 ];
121- $ trName = WebsiteComponents::buildTableRowForFormular ($ dom , $ nameSpecs );
121+ $ trName = WebsiteComponents::buildTableRowForInputFormular ($ dom , $ nameSpecs );
122122
123123 $ passwordSpecs = [
124124 'id ' => Role::FORM_ID_PASSWORD ,
@@ -128,7 +128,7 @@ protected static function buildCreateOrEditRoleTable(
128128 'type ' => 'password ' ,
129129 ],
130130 ];
131- $ trPassword = WebsiteComponents::buildTableRowForFormular ($ dom , $ passwordSpecs );
131+ $ trPassword = WebsiteComponents::buildTableRowForInputFormular ($ dom , $ passwordSpecs );
132132
133133 $ confirmPasswordSpecs = [
134134 'id ' => Role::FORM_ID_PASSWORD_CONFIRMATION ,
@@ -138,7 +138,7 @@ protected static function buildCreateOrEditRoleTable(
138138 'type ' => 'password ' ,
139139 ],
140140 ];
141- $ trConfirm = WebsiteComponents::buildTableRowForFormular ($ dom , $ confirmPasswordSpecs );
141+ $ trConfirm = WebsiteComponents::buildTableRowForInputFormular ($ dom , $ confirmPasswordSpecs );
142142
143143 $ isSuperuserSpecs = [
144144 'id ' => 'formSuper ' ,
@@ -148,7 +148,7 @@ protected static function buildCreateOrEditRoleTable(
148148 'type ' => 'bool ' ,
149149 ],
150150 ];
151- $ trSuperuser = WebsiteComponents::buildTableRowForFormular ($ dom , $ isSuperuserSpecs );
151+ $ trSuperuser = WebsiteComponents::buildTableRowForCheckboxFormular ($ dom , $ isSuperuserSpecs );
152152
153153 $ canCreateDbSpecs = [
154154 'id ' => 'formCreateDB ' ,
@@ -158,7 +158,7 @@ protected static function buildCreateOrEditRoleTable(
158158 'type ' => 'bool ' ,
159159 ],
160160 ];
161- $ trCreateDb = WebsiteComponents::buildTableRowForFormular ($ dom , $ canCreateDbSpecs );
161+ $ trCreateDb = WebsiteComponents::buildTableRowForCheckboxFormular ($ dom , $ canCreateDbSpecs );
162162
163163 $ canCeateRoleSpecs = [
164164 'id ' => 'formCreateRole ' ,
@@ -168,7 +168,7 @@ protected static function buildCreateOrEditRoleTable(
168168 'type ' => 'bool ' ,
169169 ],
170170 ];
171- $ trCreateRole = WebsiteComponents::buildTableRowForFormular ($ dom , $ canCeateRoleSpecs );
171+ $ trCreateRole = WebsiteComponents::buildTableRowForCheckboxFormular ($ dom , $ canCeateRoleSpecs );
172172
173173 $ inheritsSpecs = [
174174 'id ' => 'formInherits ' ,
@@ -178,7 +178,7 @@ protected static function buildCreateOrEditRoleTable(
178178 'type ' => 'bool ' ,
179179 ],
180180 ];
181- $ trInherits = WebsiteComponents::buildTableRowForFormular ($ dom , $ inheritsSpecs );
181+ $ trInherits = WebsiteComponents::buildTableRowForCheckboxFormular ($ dom , $ inheritsSpecs );
182182
183183 $ canLoginSpecs = [
184184 'id ' => 'formCanLogin ' ,
@@ -188,7 +188,7 @@ protected static function buildCreateOrEditRoleTable(
188188 'type ' => 'bool ' ,
189189 ],
190190 ];
191- $ trCanLogin = WebsiteComponents::buildTableRowForFormular ($ dom , $ canLoginSpecs );
191+ $ trCanLogin = WebsiteComponents::buildTableRowForCheckboxFormular ($ dom , $ canLoginSpecs );
192192
193193 $ maxConnectionsSpecs = [
194194 'id ' => 'formConnLimit ' ,
@@ -198,7 +198,7 @@ protected static function buildCreateOrEditRoleTable(
198198 'type ' => 'number ' ,
199199 ],
200200 ];
201- $ trMaxConnections = WebsiteComponents::buildTableRowForFormular ($ dom , $ maxConnectionsSpecs );
201+ $ trMaxConnections = WebsiteComponents::buildTableRowForInputFormular ($ dom , $ maxConnectionsSpecs );
202202
203203 $ expiresSpecs = [
204204 'id ' => 'formExpires ' ,
@@ -208,7 +208,7 @@ protected static function buildCreateOrEditRoleTable(
208208 'type ' => 'datetime-local ' ,
209209 ],
210210 ];
211- $ trExpires = WebsiteComponents::buildTableRowForFormular ($ dom , $ expiresSpecs );
211+ $ trExpires = WebsiteComponents::buildTableRowForInputFormular ($ dom , $ expiresSpecs );
212212
213213 $ serverSession = ServerSession::fromServerId ($ serverId , Config::getServers ());
214214 $ db = PhpPgAdminConnection::createFromServerSession ($ serverSession );
@@ -234,33 +234,30 @@ protected static function buildCreateOrEditRoleTable(
234234 'label-text ' => _ ('Member of ' ),
235235 'value ' => [
236236 'selected-values ' => $ currentMembersOf ,
237- 'selection-values ' => $ membersSelectionValues ,
238- 'type ' => 'selection ' ,
237+ 'values ' => $ membersSelectionValues ,
239238 ],
240239 ];
241- $ trMemberOf = WebsiteComponents::buildTableRowForFormular ($ dom , $ memberOfSpecs );
240+ $ trMemberOf = WebsiteComponents::buildTableRowForSelectionFormular ($ dom , $ memberOfSpecs );
242241
243242 $ membersSpecs = [
244243 'id ' => 'members[] ' ,
245244 'label-text ' => _ ('Members ' ),
246245 'value ' => [
247246 'selected-values ' => $ currentMembers ,
248- 'selection-values ' => $ membersSelectionValues ,
249- 'type ' => 'selection ' ,
247+ 'values ' => $ membersSelectionValues ,
250248 ],
251249 ];
252- $ trMembers = WebsiteComponents::buildTableRowForFormular ($ dom , $ membersSpecs );
250+ $ trMembers = WebsiteComponents::buildTableRowForSelectionFormular ($ dom , $ membersSpecs );
253251
254252 $ adminMembersSpecs = [
255253 'id ' => 'adminmembers[] ' ,
256254 'label-text ' => _ ('Admin members ' ),
257255 'value ' => [
258256 'selected-values ' => $ currentAdminMembers ,
259- 'selection-values ' => $ membersSelectionValues ,
260- 'type ' => 'selection ' ,
257+ 'values ' => $ membersSelectionValues ,
261258 ],
262259 ];
263- $ trAdminMembers = WebsiteComponents::buildTableRowForFormular ($ dom , $ adminMembersSpecs );
260+ $ trAdminMembers = WebsiteComponents::buildTableRowForSelectionFormular ($ dom , $ adminMembersSpecs );
264261
265262 $ tBody ->appendChild ($ trName );
266263 $ tBody ->appendChild ($ trPassword );
0 commit comments