diff --git a/app/src/View/Helper/FieldHelper.php b/app/src/View/Helper/FieldHelper.php index faf3a1653..bc0664d77 100644 --- a/app/src/View/Helper/FieldHelper.php +++ b/app/src/View/Helper/FieldHelper.php @@ -100,8 +100,9 @@ public function control(string $fieldName, // Specify a class on the
  • form control wrapper $liClass = $cssClass; - // Collect any supplemental markup and/or JavaScript to pass along for field construction - $fieldSupplement = !empty($config['supplement']) ? $config['supplement'] : ''; + // Collect any supplemental markup and/or JavaScript to pass along for field construction. + // Suppliment is an array: supplement['beforeField' => 'string', 'afterField' => 'string']. + $fieldSupplement = !empty($config['supplement']) ? $config['supplement'] : []; // Remove prefix from field value if(isset($config['prefix'], $this->getView()->get('vv_obj')->$fieldName)) { @@ -278,10 +279,18 @@ protected function endLine(): string { * @return string Form Info HTML */ - protected function formInfoDiv(string $content, string $supplement): string { - return '
    - ' . $content . $supplement . ' -
    '; + protected function formInfoDiv(string $content, array $supplement): string { + $div = '
    ' . PHP_EOL; + if(!empty($supplement['beforeField'])) { + $div .= $supplement['beforeField'] . PHP_EOL; + } + $div .= $content . PHP_EOL; + if(!empty($supplement['afterField'])) { + $div .= $supplement['afterField'] . PHP_EOL; + } + $div .= '
    ' . PHP_EOL; + + return $div; } /** @@ -293,16 +302,21 @@ protected function formInfoDiv(string $content, string $supplement): string { * @return string Form Info HTML */ - protected function formInfoWithPrefixDiv(string $context, string $prefix, string $supplement): string { - $div = '
    ' . PHP_EOL - . '
    ' . PHP_EOL - . '
    ' . PHP_EOL - . '' . $prefix . '' - . '
    ' . PHP_EOL - . $context - . '
    ' - . $supplement - . '
    '; + protected function formInfoWithPrefixDiv(string $context, string $prefix, array $supplement): string { + $div = '
    ' . PHP_EOL; + if(!empty($supplement['beforeField'])) { + $div .= $supplement['beforeField'] . PHP_EOL; + } + $div .= '
    ' . PHP_EOL; + $div .= '
    ' . PHP_EOL; + $div .= '' . $prefix . ''; + $div .= '
    ' . PHP_EOL; + $div .= $context; + $div .= '
    '; + if(!empty($supplement['afterField'])) { + $div .= $supplement['afterField'] . PHP_EOL; + } + $div .= '
    '; return $div; } diff --git a/app/templates/Jobs/fields.inc b/app/templates/Jobs/fields.inc index f8d066b0c..71c3eee08 100644 --- a/app/templates/Jobs/fields.inc +++ b/app/templates/Jobs/fields.inc @@ -38,30 +38,35 @@ if($vv_action == 'view') { ); } - $fieldSupplement = ' -
    -
    - - -
    -
    - - '; + $fieldSupplement = + [ + 'beforeField' => ' +
    +
    + + +
    +
    + ', + 'afterField' => ' + + ' + ]; print $this->Field->control('parameters', [], null, ['supplement' => $fieldSupplement]); print $this->Field->control('register_time');