@@ -66,6 +66,10 @@ class PluginFormcreatorEntityconfig extends CommonDBTM {
66
66
const CONFIG_SEARCH_ISSUE_HIDDEN = 0 ;
67
67
const CONFIG_SEARCH_ISSUE_VISIBLE = 1 ;
68
68
69
+ const CONFIG_UI_FORM_MASONRY = 0 ;
70
+ const CONFIG_UI_FORM_UNIFORM_HEIGHT = 1 ;
71
+
72
+
69
73
/**
70
74
* @var bool $dohistory maintain history
71
75
*/
@@ -146,6 +150,14 @@ public static function getEnumSearchIssueVisibility() : array {
146
150
];
147
151
}
148
152
153
+ public static function getEnumUIForm () : array {
154
+ return [
155
+ self ::CONFIG_PARENT => __ ('Inheritance of the parent entity ' ),
156
+ self ::CONFIG_UI_FORM_MASONRY => __ ('Variable height ' , 'formcreator ' ),
157
+ self ::CONFIG_UI_FORM_UNIFORM_HEIGHT => __ ('Uniform height ' , 'formcreator ' ),
158
+ ];
159
+ }
160
+
149
161
public static function displayTabContentForItem (CommonGLPI $ item , $ tabnum = 1 , $ withtemplate = 0 ) {
150
162
if ($ item ->getType () == 'Entity ' ) {
151
163
$ config = new self ();
@@ -342,6 +354,22 @@ public function showFormForEntity(Entity $entity) {
342
354
}
343
355
echo '</td></tr> ' ;
344
356
357
+ // Tiles Design
358
+ $ elements = self ::getEnumUIForm ();
359
+ if ($ entityId == 0 ) {
360
+ unset($ elements [self ::CONFIG_PARENT ]);
361
+ }
362
+ echo "<tr class='tab_bg_1'> " ;
363
+ echo "<td> " .__ ('Tile design ' , 'formcreator ' )."</td> " ;
364
+ echo "<td> " ;
365
+ Dropdown::showFromArray ('tile_design ' , $ elements , ['value ' => $ this ->fields ['tile_design ' ]]);
366
+ if ($ this ->fields ['tile_design ' ] == self ::CONFIG_PARENT ) {
367
+ $ tid = self ::getUsedConfig ('tile_design ' , $ entityId );
368
+ echo '<br> ' ;
369
+ Entity::inheritedValue ($ elements [$ tid ], true );
370
+ }
371
+ echo '</td></tr> ' ;
372
+
345
373
// header
346
374
echo "<tr class='tab_bg_1'> " ;
347
375
echo "<td> " . _n ('Header ' , 'Headers ' , 1 , 'formcreator ' ) . "</td> " ;
0 commit comments