AntonLV 7 лет назад
Родитель
Сommit
aa8a10786a

+ 2 - 2
studio/classes/BxDolStudioForm.php

@@ -213,7 +213,7 @@ class BxDolStudioFormCheckerHelper extends BxDolFormCheckerHelper
             $bValue = parent::checkAvail($sValue);
             $bValue = parent::checkAvail($sValue);
 
 
             if($bAll && !$bValue)
             if($bAll && !$bValue)
-                return false;
+                return $sLangName;
             if(!$bAll && $bValue)
             if(!$bAll && $bValue)
                 return true;
                 return true;
         }
         }
@@ -233,7 +233,7 @@ class BxDolStudioFormCheckerHelper extends BxDolFormCheckerHelper
             $bValue = parent::checkLength($sValue, $iLenMin, $iLenMax);
             $bValue = parent::checkLength($sValue, $iLenMin, $iLenMax);
 
 
             if($bAll && !$bValue)
             if($bAll && !$bValue)
-                return false;
+                return $sLangName;
             if(!$bAll && $bValue)
             if(!$bAll && $bValue)
                 return true;
                 return true;
         }
         }

+ 12 - 3
studio/template/scripts/BxBaseStudioFormView.php

@@ -138,7 +138,15 @@ class BxBaseStudioFormView extends BxDolStudioForm
         $oFunctions = BxTemplStudioFunctions::getInstance();
         $oFunctions = BxTemplStudioFunctions::getInstance();
 
 
         $oLanguage = BxDolStudioLanguagesUtils::getInstance();
         $oLanguage = BxDolStudioLanguagesUtils::getInstance();
-        $sLanguage = $oLanguage->getCurrentLangName(false);
+
+        if(!empty($aInput['error']) && is_string($aInput['error'])) {
+            $sLanguage = $aInput['error'];
+            $aInput['error'] = isset($aInput['checker']['error']) ? $aInput['checker']['error'] : '';
+            $aInput['error_updated'] = true;
+        }
+        else
+            $sLanguage = $oLanguage->getCurrentLangName(false);
+
         $aLanguages = $oLanguage->getLanguagesInfo();
         $aLanguages = $oLanguage->getLanguagesInfo();
 
 
         $aInput['type'] = 'hidden';
         $aInput['type'] = 'hidden';
@@ -148,16 +156,17 @@ class BxBaseStudioFormView extends BxDolStudioForm
         $sInput .= $this->genInputStandard($aInput);
         $sInput .= $this->genInputStandard($aInput);
 
 
         $aStrings = !empty($aInput['value']) ? $oLanguage->getLanguageString($aInput['value']) : array();
         $aStrings = !empty($aInput['value']) ? $oLanguage->getLanguageString($aInput['value']) : array();
-        
+
         $aTmplVars = array();
         $aTmplVars = array();
         foreach($aLanguages as $aLanguage) {
         foreach($aLanguages as $aLanguage) {
             $bLanguage = $aLanguage['name'] == $sLanguage;
             $bLanguage = $aLanguage['name'] == $sLanguage;
 
 
             $sValue = '';
             $sValue = '';
-            if(($bValue = key_exists($aLanguage['id'], $aStrings)) === true)
+            if(key_exists($aLanguage['id'], $aStrings))
                 $sValue = $aStrings[$aLanguage['id']]['string'];
                 $sValue = $aStrings[$aLanguage['id']]['string'];
             else if(isset($aInput['values'][$aLanguage['name']]))
             else if(isset($aInput['values'][$aLanguage['name']]))
                 $sValue = $aInput['values'][$aLanguage['name']];
                 $sValue = $aInput['values'][$aLanguage['name']];
+            $bValue = !empty($sValue);
 
 
             $aInput['type'] = $sType;
             $aInput['type'] = $sType;
             $aInput['name'] = $sInputName . '-' . $aLanguage['name'];
             $aInput['name'] = $sInputName . '-' . $aLanguage['name'];

+ 4 - 2
template/scripts/BxBaseFormView.php

@@ -528,8 +528,8 @@ EOS;
 
 
         $sClassWrapper = 'bx-form-element-wrapper';
         $sClassWrapper = 'bx-form-element-wrapper';
         if($isOneLine)
         if($isOneLine)
-        	$sClassWrapper .= ' ' . $sClassWrapper . '-oneline';
-		$sClassWrapper .= ' bx-def-margin-top';
+            $sClassWrapper .= ' ' . $sClassWrapper . '-oneline';
+        $sClassWrapper .= ' bx-def-margin-top';
 
 
         if (isset($aInput['name']))
         if (isset($aInput['name']))
             $aInput['tr_attrs']['id'] = "bx-form-element-" . $aInput['name'];
             $aInput['tr_attrs']['id'] = "bx-form-element-" . $aInput['name'];
@@ -546,6 +546,8 @@ EOS;
         }
         }
 
 
         $sInput = $this->genInput($aInput);
         $sInput = $this->genInput($aInput);
+        if(isset($aInput['error_updated']) && $aInput['error_updated'] === true)
+            $sErrorIcon = $this->genErrorIcon(empty($aInput['error']) ? '' : $aInput['error']);
 
 
         $sCaptionCode = '';
         $sCaptionCode = '';
         if ($sCaption)
         if ($sCaption)