AlexeyUna 2 lat temu
rodzic
commit
ed215b46ff

+ 4 - 0
modules/boonex/artificer/data/template/system/css/forms.css

@@ -27,6 +27,10 @@ import url(../../../../../../../template/css/forms.css);
     position: relative;
 }
 
+.bx-form-option-info {
+    display: inline-flex;
+    flex-direction: column;
+}
 
 /*-- Section Toggler ---*/
 .bx-form-section-wrapper {

+ 5 - 0
template/css/forms.css

@@ -75,6 +75,11 @@
     font-style:italic;
 }
 
+.bx-form-option-info {
+    display: inline-flex;
+    flex-direction: column;
+}
+
 .bx-form-info {
 
 }

+ 4 - 0
template/form_field_option_info.html

@@ -0,0 +1,4 @@
+<div class="bx-form-option-info">
+    <div>__input__</div>
+    <div>__info__</div>
+</div>

+ 18 - 1
template/scripts/BxBaseFormView.php

@@ -2050,6 +2050,10 @@ BLAH;
 
         $sOptions = '';
 
+        $aAdditionalFieldInfo = [];
+        if (in_array($aInput['type'], ['radio_set', 'checkbox_set']) && !empty($aInput['values_list_name']))
+            $aAdditionalFieldInfo = BxDolFormQuery::getDataItems($aInput['values_list_name'], false, BX_DATA_VALUES_ALL);
+
         if (isset($aInput['values']) && is_array($aInput['values'])) {
             if (count($aInput['values']) > $iDividerThreshold && $sDivider == $this->_sDivider)
                 $sDivider = $this->_sDividerAlt;
@@ -2074,7 +2078,11 @@ BLAH;
                 if (isset($aInput['label_as_html']))
                     $aNewInput['label_as_html'] = $aInput['label_as_html'];
 
-                $sNewInput  = $this->genInput($aNewInput);
+                $sNewInput = $this->genInput($aNewInput);
+
+                // add additional info for the field
+                if (isset($aAdditionalFieldInfo[$sValue]) && !empty($aAdditionalFieldInfo[$sValue]['LKey2']))
+                    $sNewInput = $this->genFiledItemInfoWrapper($sNewInput, _t($aAdditionalFieldInfo[$sValue]['LKey2']));
 
                 // attach new input to complex
                 $sOptions .= ($sNewInput . $sDivider);
@@ -2229,6 +2237,15 @@ BLAH;
         ));
     }
 
+    function genFiledItemInfoWrapper($sInput, $sInfoValue)
+    {
+        $sInfo = $this->genInfoIcon($sInfoValue) ;
+        return $this->oTemplate->parseHtmlByName('form_field_option_info.html', [
+            'input' => $sInput,
+            'info' => $sInfo
+        ]);
+    }
+
     function genInfoIcon($sInfo)
     {
         return '<div class="bx-form-info bx-def-font-grayed bx-def-font-small">' . bx_process_output($sInfo, BX_DATA_HTML) . '</div>';