Skip to content

Commit

Permalink
refactor(formanswer): simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Dec 9, 2022
1 parent f61ded1 commit 4b70dff
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions inc/formanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1110,29 +1110,23 @@ public function getFullForm($richText = false): string {
}

// Don't save tags in "full form"
if ($question_line['fieldtype'] == 'tag') {
continue;
}

if ($question_line['fieldtype'] == 'fields') {
if (in_array($question_line['fieldtype'], ['tag', 'fields', 'description'])) {
continue;
}

if (!PluginFormcreatorFields::isVisible($fields[$question_line['id']]->getQuestion(), $this->questionFields)) {
continue;
}

if ($question_line['fieldtype'] != 'description') {
$question_no++;
if ($richText) {
$output .= '<div>';
$output .= '<b>' . $question_no . ') ##question_' . $question_line['id'] . '## : </b>';
$output .= '##answer_' . $question_line['id'] . '##';
$output .= '</div>';
} else {
$output .= $question_no . ') ##question_' . $question_line['id'] . '## : ';
$output .= '##answer_' . $question_line['id'] . '##' . $eol . $eol;
}
$question_no++;
if ($richText) {
$output .= '<div>';
$output .= '<b>' . $question_no . ') ##question_' . $question_line['id'] . '## : </b>';
$output .= '##answer_' . $question_line['id'] . '##';
$output .= '</div>';
} else {
$output .= $question_no . ') ##question_' . $question_line['id'] . '## : ';
$output .= '##answer_' . $question_line['id'] . '##' . $eol . $eol;
}
}

Expand Down

0 comments on commit 4b70dff

Please sign in to comment.