Skip to content

Commit

Permalink
fix(descriptionfield): bad form rendering
Browse files Browse the repository at this point in the history
clnflicts with GLPI's CSS rules
  • Loading branch information
btry committed Aug 29, 2022
1 parent ae28ed6 commit 87a7405
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions css/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,16 @@ form#plugin_formcreator_form {
width: 48px;
}

.plugin_formcreator_description {
table {
border-width: 1px;

tr, td {
border-width: 1px;
}
}
}

/* CONDITIONS */

.div_show_condition_field, .div_show_condition_operator,
Expand Down
3 changes: 2 additions & 1 deletion inc/field/descriptionfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public function showForm(array $options): void {
public function getRenderedHtml($domain, $canEdit = true): string {
$value = Toolbox::convertTagToImage(__($this->question->fields['description'], $domain), $this->getQuestion());
$value = Sanitizer::unsanitize($value);
return nl2br(html_entity_decode($value));
$value = '<div class="plugin_formcreator_description">' . $value . '</div>';
return $value;
}

public function serializeValue(PluginFormcreatorFormAnswer $formanswer): string {
Expand Down

0 comments on commit 87a7405

Please sign in to comment.