Skip to content

Commit

Permalink
Update alignment to match glpi
Browse files Browse the repository at this point in the history
  • Loading branch information
Lainow committed Jan 23, 2024
1 parent b7f05dd commit 6d238c8
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions inc/object.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -646,15 +646,11 @@ public function displayField($canedit, $name, $value, $template, $description =
}

$this->startColumn();
echo $searchoption['name'];
if (isset($searchoption['autoname']) && $searchoption['autoname'] && $template) {
echo "* ";
}
$this->endColumn();
$this->startColumn();
echo '<label class="col-form-label col-xxl-5 text-xxl-end">' . $searchoption['name'] . '</label>';

// Keep only main column type by removing anything that is preceded by a space (e.g. " unsigned")
// or a parenthesis (e.g. "(255)").
echo '<div class="col-xxl-7 field-container">';
$column_type = preg_replace('/^([a-z]+)([ (].+)*$/', '$1', $description['Type']);
switch ($column_type) {
case "int":
Expand Down Expand Up @@ -774,6 +770,7 @@ public function displayField($canedit, $name, $value, $template, $description =
echo "<input type='text' name='$name' value='$value'>";
break;
}
echo '</div>';
$this->endColumn();
}
}
Expand All @@ -786,10 +783,14 @@ public function displayField($canedit, $name, $value, $template, $description =
public function startColumn()
{
if ($this->cpt == 0) {
echo "<tr class='tab_bg_1'>";
echo '<div class="card-body d-flex flex-wrap">';
echo '<div class="col-12 col-xxl-12 flex-column">';
echo '<div class="d-flex flex-row flex-wrap flex-xl-nowrap">';
echo '<div class="row flex-row align-items-start flex-grow-1">';
echo '<div class="row flex-row">';
}
echo '<div class="form-field row col-12 col-sm-6 mb-2">';

echo "<td>";
$this->cpt++;
}

Expand All @@ -800,12 +801,7 @@ public function startColumn()
**/
public function endColumn()
{
echo "</td>";

if ($this->cpt == 4) {
echo "</tr>";
$this->cpt = 0;
}
echo "</div>";
}


Expand All @@ -816,11 +812,7 @@ public function endColumn()
public function closeColumn()
{
if ($this->cpt > 0) {
while ($this->cpt < 4) {
echo "<td></td>";
$this->cpt++;
}
echo "</tr>";
echo "</div></div></div></div></div>";
}
}

Expand Down

0 comments on commit 6d238c8

Please sign in to comment.