From 0f10cbe11408ed1f9539248e230fac9d4451f987 Mon Sep 17 00:00:00 2001 From: bdeckerdev <65571369+bdeckerdev@users.noreply.github.com> Date: Sat, 6 Feb 2021 06:06:27 -0700 Subject: [PATCH 1/2] Update fabrik-element-calc-form.php Calc element had been written to use a class that had been defined as a static "input-medium" size and it would ignore the columns (width) param. This update translates cols into bootstrap class definition to allow variable width based on cols. Also cleaned up the code to use heredoc for the HTML. Cons: Previous, cols were ignored in bootstrap templates. Now, it will have an effect. A dev might need to adjust their cols param to suit and it's not obvious or documented that the translation points are 15, 40, and 60. If this commit is accepted, notify me and I'll update the wiki - bruced@zumasys.com --- .../calc/layouts/fabrik-element-calc-form.php | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/plugins/fabrik_element/calc/layouts/fabrik-element-calc-form.php b/plugins/fabrik_element/calc/layouts/fabrik-element-calc-form.php index 4bff7b8ebaa..4296c2b3829 100644 --- a/plugins/fabrik_element/calc/layouts/fabrik-element-calc-form.php +++ b/plugins/fabrik_element/calc/layouts/fabrik-element-calc-form.php @@ -1,6 +1,6 @@ height <= 1) : ?> @@ -10,4 +10,33 @@ - \ No newline at end of file + +*/ + +/* 06Feb2021 by Bruce Decker - rewrite to translate calc width to bootstrap class*/ +$d = $displayData; +if($d->cols <= 15){ + $bootWidth = 'input-small'; +} else { + if($d->cols <= 40){ + $bootWidth = 'input-medium'; + } else{ + if ($d->cols <=60){ + $bootWidth = 'input-large'; + } else { + $bootWidth = 'input-xlarge'; + } + } +} +if ($d->height <= 1){ + $htmlSnip = <<value + HTMLSNIP; +} else { + $htmlSnip = <<value> + HTMLSNIP; +} +echo $htmlSnip; +?> From db4091e7c07e0edaed8455d2ec8e12cf03bd5322 Mon Sep 17 00:00:00 2001 From: bdeckerdev <65571369+bdeckerdev@users.noreply.github.com> Date: Sat, 6 Feb 2021 06:28:59 -0700 Subject: [PATCH 2/2] Update fabrik-element-calc-form.php --- .../fabrik_element/calc/layouts/fabrik-element-calc-form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/fabrik_element/calc/layouts/fabrik-element-calc-form.php b/plugins/fabrik_element/calc/layouts/fabrik-element-calc-form.php index 4296c2b3829..acd2c37f0f6 100644 --- a/plugins/fabrik_element/calc/layouts/fabrik-element-calc-form.php +++ b/plugins/fabrik_element/calc/layouts/fabrik-element-calc-form.php @@ -35,7 +35,7 @@ } else { $htmlSnip = <<value> + id="$d->id" cols="$d->cols" rows="$d->rows">$d->value HTMLSNIP; } echo $htmlSnip;