@@ -66,6 +66,10 @@ class PluginFormcreatorEntityconfig extends CommonDBTM {
6666 const CONFIG_SEARCH_ISSUE_HIDDEN = 0 ;
6767 const CONFIG_SEARCH_ISSUE_VISIBLE = 1 ;
6868
69+ const CONFIG_UI_FORM_MASONRY = 0 ;
70+ const CONFIG_UI_FORM_UNIFORM_HEIGHT = 1 ;
71+
72+
6973 /**
7074 * @var bool $dohistory maintain history
7175 */
@@ -146,6 +150,14 @@ public static function getEnumSearchIssueVisibility() : array {
146150 ];
147151 }
148152
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+
149161 public static function displayTabContentForItem (CommonGLPI $ item , $ tabnum = 1 , $ withtemplate = 0 ) {
150162 if ($ item ->getType () == 'Entity ' ) {
151163 $ config = new self ();
@@ -342,6 +354,22 @@ public function showFormForEntity(Entity $entity) {
342354 }
343355 echo '</td></tr> ' ;
344356
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+
345373 // header
346374 echo "<tr class='tab_bg_1'> " ;
347375 echo "<td> " . _n ('Header ' , 'Headers ' , 1 , 'formcreator ' ) . "</td> " ;
0 commit comments