Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions plugins/fabrik_element/calc/layouts/fabrik-element-calc-form.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
defined('JPATH_BASE') or die;

/* DEPRECATED
$d = $displayData;
if ($d->height <= 1) :
?>
Expand All @@ -10,4 +10,33 @@
<textarea class="fabrikinput" disabled="disabled" name="<?php echo $d->name;?>"
id="<?php echo $d->id;?>" cols="<?php echo $d->cols; ?>"
rows="<?php echo $d->rows; ?>"><?php echo $d->value;?></textarea>
<?php endif; ?>
<?php endif; ?>
*/

/* 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 = <<<HTMLSNIP
<span class="fabrikinput fabrikElementReadOnly" style="display:inline-block;" name="$d->name" id="$d->id" $d->value</span>
HTMLSNIP;
} else {
$htmlSnip = <<<HTMLSNIP
<textarea class="fabrikinput $bootWidth" disabled="disabled" name="$d->name"
id="$d->id" cols="$d->cols" rows="$d->rows">$d->value</textarea>
HTMLSNIP;
}
echo $htmlSnip;
?>