Your IP : 3.145.186.38


Current Path : /usr/local/mgr5/skins/orion/
Upload File :
Current File : //usr/local/mgr5/skins/orion/form.inc.xsl

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:mgr="http://ispsystem.com/xslplugin"
  exclude-result-prefixes="mgr">


  <xsl:template match="form">
    <xsl:choose>
      <xsl:when test="page">
        <xsl:for-each select="page">
          <div class="b-form-page b-form-page_view_form" id="{@name}-tab0">
            <xsl:variable name="name" select="@name"/>
            <xsl:attribute name="data-init-func">
            <xsl:if test="//if[@show=$name] or //else[@hide=$name]">
              <xsl:call-template name="showfield">
                <xsl:with-param name="el" select="//if[@show=$name]"/>
              </xsl:call-template>
              <xsl:call-template name="elsehidefield">
                <xsl:with-param name="el" select="//else[@hide=$name]"/>
              </xsl:call-template>
            </xsl:if>
            <xsl:if test="//if[@hide=$name] or //else[@show=$name]">
              <xsl:call-template name="hidefield">
                <xsl:with-param name="el" select="//if[@hide=$name]"/>
              </xsl:call-template>
              <xsl:call-template name="elseshowfield">
                <xsl:with-param name="el" select="//else[@show=$name]"/>
              </xsl:call-template>
            </xsl:if>
            </xsl:attribute>
            <h3 class="l-form-page__title-wr">
              <a href="#" class="b-form-page__title">
                <span>
                  <xsl:value-of select="key('msg', @name)"/>
                </span>
                <span class="b-triangle"></span>
              </a>
              <div class="b-form-page__vline"></div>
            </h3>
            <div class="b-form-page__inner">
              <table class="l-form__table">
                <!--error-->
                <xsl:if test="/doc/error and position = 1 and (/doc/error/@object/text() = '' or count(//field[@name = /doc/error/@object]) = 0)">
                  <tr>
                    <td colspan="2" class="login-error-content">
                      <div class="error b-message i-message">
                        <div class="b-message__inner b-message__inner_status_error">
                          <div class="text">
                            <xsl:value-of select="/doc/error/msg"/>
                          </div>
                        </div>
                        <div class="b-message__triangle b-message__triangle_status_error"></div>
                      </div>
                    </td>
                  </tr>
                </xsl:if>
                <xsl:apply-templates select="./*"/>
              </table>
            </div>
          </div>
        </xsl:for-each>
      </xsl:when>
      <xsl:otherwise>
        <div class="b-form-page b-form-page_view_form" id="{@name}-tab0">
          <div class="b-form-page__inner">
            <table class="l-form__table">
              <!--error-->
              <xsl:if test="/doc/error and (/doc/error/@object/text() = '' or count(//field[@name = /doc/error/@object]) = 0)">
                <tr>
                  <td colspan="2" class="login-error-content">
                    <div class="error  b-message i-message">
                      <div class="b-message__inner b-message__inner_status_error">
                        <div class="text">
                          <xsl:value-of select="/doc/error/msg"/>
                        </div>
                      </div>
                      <div class="b-message__triangle b-message__triangle_status_error"></div>
                    </div>
                  </td>
                </tr>
              </xsl:if>
              <xsl:apply-templates select="./*"/>
            </table>
          </div>
        </div>
      </xsl:otherwise>
    </xsl:choose>

  </xsl:template>

  <!--fields-->
  <xsl:template match="field">
    <xsl:variable name="name" select="@name"/>
    <tr>
      <xsl:attribute name="data-init-func">
        <xsl:if test="//if[@show=$name] or //else[@hide=$name]">
          <xsl:call-template name="showfield">
            <xsl:with-param name="el" select="//if[@show=$name]"/>
          </xsl:call-template>
          <xsl:call-template name="elsehidefield">
            <xsl:with-param name="el" select="//else[@hide=$name]"/>
          </xsl:call-template>
        </xsl:if>
        <xsl:if test="//if[@hide=$name] or //else[@show=$name]">
          <xsl:call-template name="hidefield">
            <xsl:with-param name="el" select="//if[@hide=$name]"/>
          </xsl:call-template>
          <xsl:call-template name="elseshowfield">
            <xsl:with-param name="el" select="//else[@show=$name]"/>
          </xsl:call-template>
        </xsl:if>
      </xsl:attribute>
      <xsl:attribute name="class">
        <xsl:text>l-form__row</xsl:text>
        <xsl:if test="@fullwidth"> fullwidth-row</xsl:if>
        <xsl:if test="@formwidth"> formwidth-row</xsl:if>
        <xsl:if test="input[@type='checkbox'] and not(desc)"> row-with-no-desc</xsl:if>
        <xsl:text> l-form__row_type_</xsl:text>
        <xsl:choose>
         <xsl:when test="select[@type='radio']">radio</xsl:when>
         <xsl:when test="select[@type='multiple']">multiselect</xsl:when>
         <xsl:when test="select[@type='radioimg']">radioimg</xsl:when>
         <xsl:when test="select">select</xsl:when>
         <xsl:when test="link">link</xsl:when>
         <xsl:when test="slider">slider</xsl:when>
         <xsl:when test="htmldata">htmldata</xsl:when>
         <xsl:when test="textdata">textdata</xsl:when>
         <xsl:when test="textarea">textarea</xsl:when>
         <xsl:when test="input[@type='file']">file</xsl:when>
         <xsl:when test="input[@type='text']">text</xsl:when>
         <xsl:when test="input[@type='checkbox']">checkbox</xsl:when>
         <xsl:when test="input[@type='hidden']">hidden</xsl:when>
         <xsl:when test="captcha">captcha</xsl:when>
        </xsl:choose>
        <xsl:choose>
          <xsl:when test="input[@type='text'] and select"> l-form__row_has_addition</xsl:when>
          <xsl:when test="input[@type='text'] and link"> l-form__row_has_addition</xsl:when>
          <xsl:when test="select and link"> l-form__row_has_addition</xsl:when>
          <xsl:when test="input[@type='text'] and input[@type='checkbox']"> l-form__row_has_addition</xsl:when>
          <xsl:when test="count(input[@type='text']) = 2"> l-form__row_has_addition</xsl:when>
        </xsl:choose>
        <xsl:choose>
          <xsl:when test="select[@propwidth]"> l-form__row_propwidth</xsl:when>
        </xsl:choose>
        <xsl:if test="/doc/error/@object = @name"> row-error</xsl:if>
      </xsl:attribute>
    <xsl:choose>
      <!--fullwidth from row view-->
      <xsl:when test="@fullwidth or captcha">
        <td colspan="3" class="l-form__col_type_fullwidth l-form__col l-form__col_cont_control">
          <xsl:variable name="label" select="boolean(not(@noname) and key('msg', @name))"/>
          <xsl:if test="$label">
            <!--label-->
            <xsl:call-template name="label">
              <xsl:with-param name="name" select="@name"/>
              <xsl:with-param name="required"><xsl:if test="input/@required or //input[@checkpasswd = current()/@name]/@required or select/@required or textarea/@required">required</xsl:if></xsl:with-param>
            </xsl:call-template>
          </xsl:if>
          <table class="l-table-fullwidth fullwidth">
            <tr>
              <td class="l-form__col-control">
                <div class="l-form__control-wr">
                  <xsl:apply-templates select="./*"/>
                </div>
              </td>
              <td class="l-form__col l-form__col_cont_hint">
                <div class="field-help hint">
                  <xsl:if test="$msg/msg[@name = concat('hint_', current()/@name)]">
                    <xsl:attribute name="class">field-help hint field-help_available_yes</xsl:attribute>
                    <xsl:attribute name="data-hint"><xsl:value-of select="key('msg', concat('hint_', @name))"/></xsl:attribute>
                  </xsl:if>
                </div>
              </td>
              <td class="l-form__col l-form__col_cont_status">
                <div class="field-desc">
                  <xsl:if test="desc">
                    <xsl:if test="input/@type='text'">
                      <xsl:value-of select="mgr:fixquote(key('msg', current()/desc/@name))"/>
                    </xsl:if>
                  </xsl:if>
                </div>
                <div class="field-status"></div>
              </td>
            </tr>
            <tr class="l-form__col-error">
              <td colspan="3" class="error">
                <div class="b-error-box__wrapper" data-id="{@name}-tab0">
                  <div class="b-error-box">
                    <div class="b-error-box__top-triangle"></div>
                    <div class="b-error-box__inner">
                      <xsl:if test="/doc/error/@object = @name">
                        <xsl:value-of select="/doc/error/msg"/>
                      </xsl:if>
                    </div>
                  </div>
                </div>
              </td>
            </tr>
          </table>
        </td>
      </xsl:when>
      <!--formwidth form rows view-->
      <xsl:when test="@formwidth or select[@type='radioimg']">
        <td colspan="2" class="formwidth l-form__col l-form__col_cont_control">
          <xsl:variable name="label" select="boolean(not(@noname) and key('msg', @name))"/>
          <xsl:if test="$label">
            <!--label-->
            <xsl:call-template name="label">
              <xsl:with-param name="name" select="@name"/>
              <xsl:with-param name="required"><xsl:if test="input/@required or //input[@checkpasswd = current()/@name]/@required or select/@required or textarea/@required">required</xsl:if></xsl:with-param>
            </xsl:call-template>
          </xsl:if>
          <table class="l-form__table-formwidth">
            <tr>
              <td class="l-form__col-control">
                <div class="l-form__control-wr">
                  <xsl:apply-templates select="./*"/>
                </div>
              </td>
              <td class="l-form__col l-form__col_cont_hint">
                <div class="field-help hint">
                  <xsl:if test="$msg/msg[@name = concat('hint_', current()/@name)]">
                    <xsl:attribute name="class">field-help hint field-help_available_yes</xsl:attribute>
                    <xsl:attribute name="data-hint"><xsl:value-of select="key('msg', concat('hint_', @name))"/></xsl:attribute>
                  </xsl:if>
                </div>
              </td>
              <td class="l-form__col l-form__col_cont_status">
                <div class="field-desc">
                  <xsl:if test="desc">
                    <xsl:if test="input/@type='text'">
                      <xsl:value-of select="mgr:fixquote(key('msg', current()/desc/@name))"/>
                    </xsl:if>
                  </xsl:if>
                </div>
                <div class="field-status"></div>
              </td>
            </tr>
            <tr class="l-form__col-error">
              <td colspan="3" class="error">
                <div class="b-error-box__wrapper" data-id="{@name}-tab0">
                  <div class="b-error-box">
                    <div class="b-error-box__top-triangle"></div>
                    <div class="b-error-box__inner">
                      <xsl:if test="/doc/error/@object = @name">
                        <xsl:value-of select="/doc/error/msg"/>
                      </xsl:if>
                    </div>
                  </div>
                </div>
              </td>
            </tr>
          </table> 
        </td>
        <td class="l-form__col l-form__col_cont_row-end"></td>
      </xsl:when>
      <xsl:when test="input[@type = 'hidden'] and count(./input) = 10">
        <tr class="hidden l-form__row_type_hidden">
          <td class="l-form__col l-form__col_cont_label"></td>
          <td class="l-form__col l-form__col_cont_control">
            <xsl:apply-templates select="./*"/>
          </td>
          <td class="l-form__col l-form__col_cont_hint"></td>
          <td class="l-form__col l-form__col_cont_status"></td>
          </tr>
      </xsl:when>
      <!--list form row views-->
      <xsl:when test="list">
        <tr class="{{=it.classes}} l-form__row">
          <td class="l-form__col l-form__col_cont_control" colspan="3">
            <div id="tab0-{@name}" data-type="list" class="tab0-list">
              <xsl:apply-templates select="./*"/>
            </div>
          </td>
        </tr>
      </xsl:when>
      <!--default form row view-->
      <xsl:otherwise>
        <xsl:variable name="label" select="boolean(not(@noname) and key('msg', @name))"/>
        <xsl:if test="$label or (not(textdata) and $label)">
          <td class="l-form__col l-form__col_cont_label">
            <xsl:if test="$label">
              <!--label-->
              <xsl:call-template name="label">
                <xsl:with-param name="name" select="@name"/>
                <xsl:with-param name="required"><xsl:if test="input/@required or //input[@checkpasswd = current()/@name]/@required or select/@required or textarea/@required">required</xsl:if></xsl:with-param>
              </xsl:call-template>
            </xsl:if>
          </td>
        </xsl:if>
        <td class="l-form__col l-form__col_cont_control">
          <!--check for error on field-->
          <xsl:attribute name="colspan">
            <xsl:choose>
              <xsl:when test="/doc/error/@object = @name">2</xsl:when>
              <xsl:when test="$label">1</xsl:when>
              <xsl:otherwise>2</xsl:otherwise>
            </xsl:choose>
          </xsl:attribute>
          <div class="l-form__table-control-wrapper">
          <table class="l-form__table-control">
            <tr>
              <td class="l-form__col-control">
                <div class="l-form__control-wr">
                  <xsl:apply-templates select="./*"/>
                </div>
                </td>
              <td class="l-form__col l-form__col_cont_hint">
                <div class="field-help hint">
                  <xsl:if test="$msg/msg[@name = concat('hint_', current()/@name)]">
                    <xsl:attribute name="class">field-help hint field-help_available_yes</xsl:attribute>
                    <xsl:attribute name="data-hint"><xsl:value-of select="key('msg', concat('hint_', @name))"/></xsl:attribute>
                  </xsl:if>
                </div>
                </td>
              <td class="l-form__col l-form__col_cont_status">
                <div class="field-desc">
                  <xsl:if test="desc">
                    <xsl:if test="input/@type='text'">
                      <xsl:value-of select="mgr:fixquote(key('msg', current()/desc/@name))"/>
                    </xsl:if>
                  </xsl:if>
                </div>
                <div class="field-status"></div>
              </td>
            </tr>
            <tr class="l-form__col-error">
              <td colspan="3" class="error">
                <div class="b-error-box__wrapper" data-id="{@name}-tab0">
                  <div class="b-error-box">
                    <div class="b-error-box__top-triangle"></div>
                    <div class="b-error-box__inner">
                      <xsl:if test="/doc/error/@object = @name">
                        <xsl:value-of select="/doc/error/msg"/>
                      </xsl:if>
                    </div>
                  </div>
                </div>
              </td>
            </tr>
          </table>
          </div>
        </td>
        <!--check for list form-->
        <td class="l-form__col l-form__col_cont_row-end"></td>
      </xsl:otherwise>
    </xsl:choose>
   </tr>
    <xsl:if test="select/@plainhint or input/@plainhint">
      <xsl:choose>
        <xsl:when test="input[@type = 'checkbox']">
          <xsl:variable name="cname" select="input/@name"/>
          <xsl:variable name="hintnameon" select="concat('hint_', $cname, '__on')"/>
          <xsl:if test="key('msg', $hintnameon)">
            <tr class="depended-hidden-s l-form__row l-form__row_type_plainhint">
              <xsl:attribute name="data-init-func">
                convertIfRules('on', 'data-show-<xsl:value-of select="$cname"/>-__VALUE__', self)<xsl:if test="position() != last()">||</xsl:if>
              </xsl:attribute>
              <td class="l-form__col-control" colspan="2"><xsl:value-of select="mgr:fixquote(key('msg', $hintnameon))" disable-output-escaping="yes"/></td>
              <td class="l-form__col l-form__col_cont_row-end"></td>
            </tr>
          </xsl:if>
          <xsl:variable name="hintnameoff" select="concat('hint_', $cname, '__off')"/>
          <xsl:if test="key('msg', $hintnameoff)">
            <tr class="depended-hidden-s l-form__row l-form__row_type_plainhint">
              <xsl:attribute name="data-init-func">
                convertIfRules('off', 'data-show-<xsl:value-of select="$cname"/>-__VALUE__', self)<xsl:if test="position() != last()">||</xsl:if>
              </xsl:attribute>
              <td class="l-form__col-control" colspan="2"><xsl:value-of select="mgr:fixquote(key('msg', $hintnameon))" disable-output-escaping="yes"/></td>
              <td class="l-form__col l-form__col_cont_row-end"></td>
            </tr>
          </xsl:if>
        </xsl:when>
        <xsl:otherwise>
          <xsl:variable name="cname" select="select/@name"/>
          <xsl:for-each select="/doc/slist[@name=$cname]/val">
            <xsl:variable name="hintname" select="concat('hint_', $cname, '__', @key)"/>
            <xsl:if test="key('msg', $hintname)">
              <tr class="depended-hidden-s l-form__row l-form__row_type_plainhint">
                <xsl:attribute name="data-init-func">
                  convertIfRules('<xsl:value-of select="mgr:fixquote(@key)"/>', 'data-show-<xsl:value-of select="$cname"/>-__VALUE__', self)<xsl:if test="position() != last()">||</xsl:if>
                </xsl:attribute>
                <td class="l-form__col-control" colspan="2"><xsl:value-of select="key('msg', $hintname)" disable-output-escaping="yes"/></td>
                <td class="l-form__col l-form__col_cont_row-end"></td>
              </tr>
            </xsl:if>
          </xsl:for-each>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:if>
  </xsl:template>

  <!--label template-->
  <xsl:template name="label">
    <xsl:param name="name"/>
    <xsl:param name="required"/>
    <div class="l-label__wrapper">
      <div class="l-label__inner">
        <label class="b-label__visible" data-tabid="tab0" data-id="{$name}-tab0" ><xsl:value-of select="key('msg', $name)"/></label>
        <label class="b-label__invisible"><xsl:value-of select="key('msg', $name)"/></label>
        <span class="b-label__line-dotted"></span>
        <xsl:if test="$required = 'required'">
          <span class="b-required-star">*</span>
        </xsl:if>
      </div>
    </div>
  </xsl:template>

  <!--captcha-->
  <xsl:template match="captcha">
    <div class="b-captcha">
      <div class="b-captcha__inner">
      </div>
    </div>
  </xsl:template>

  <!--input type=hidden-->
  <xsl:template match="input[@type='hidden']">
    <xsl:variable name="name" select="@name"/>
    <xsl:variable name="value" select="mgr:fixquote(/doc/*[local-name() = $name]/text())"/>
    <div>
      <input type="hidden" name="{@name}" value="{$value}" id="{@name}-tab0" data-tabid="tab0">
        <xsl:if test="@event"><xsl:attribute name="onchange"><xsl:value-of select="@name"/>_event();</xsl:attribute></xsl:if>
        <xsl:if test="@nosetvalues">
          <xsl:attribute name="class">i-nosetvalues</xsl:attribute>
        </xsl:if>
      </input>
    </div>
  </xsl:template>


  <!--input@type=file-->
  <xsl:template match="input[@type='file']">
    <xsl:variable name="name" select="@name"/>
    <xsl:variable name="value" select="mgr:fixquote(/doc/*[local-name() = $name]/text())"/>
    <div>
      <xsl:attribute name="class">
        <xsl:if test="if">control-field</xsl:if>
        <xsl:choose>
          <xsl:when test="@setvalues = 'finalblock'">setvalue sv_nochange sv_blocking</xsl:when>
          <xsl:when test="@setvalues = 'final'"> setvalue sv_nochange</xsl:when>
          <xsl:when test="@setvalues"> setvalue</xsl:when>
        </xsl:choose>
      </xsl:attribute>
      <input value="{$value}" type="file" name="{@name}" id="{@name}-tab0" data-tabid="tab0" class="b-input b-input_type_file">
        <xsl:if test="@multiple">
          <xsl:attribute name="multiple">multiple</xsl:attribute>
        </xsl:if>
        <xsl:if test="@required">
          <xsl:attribute name="required">required</xsl:attribute>
          <xsl:attribute name="data-required">required</xsl:attribute>
        </xsl:if>
        <xsl:if test="@accept">
          <xsl:attribute name="accept"><xsl:value-of select="@accept"/></xsl:attribute>
        </xsl:if>
        <xsl:if test="@event"><xsl:attribute name="onchange"><xsl:value-of select="@name"/>_event();</xsl:attribute></xsl:if>
      </input>
      <div class="b-input-file-fake" data-source="{@name}-tab0">
        <div class="b-input-file-fake__input hint" id="f-{@name}-tab0" data-hint=""></div>
        <div class="b-input-file-fake__btn">
          <xsl:value-of select="mgr:fixquote(key('msg', 'msg_choosefile'))"/>
        </div>
      </div>
    </div>
  </xsl:template>

  <!--input@type=checkbox-->
  <xsl:template match="input[@type='checkbox']">
    <xsl:variable name="desc" select="parent::node()/desc/@name"/>
    <xsl:variable name="desc-value" select="mgr:fixquote(key('msg', $desc))"/>
    <xsl:variable name="value" select="/doc/*[local-name() = current()/@name]"/>
    <xsl:variable name="checked">
      <xsl:if test="/doc/*[local-name() = current()/@name] = 'on'">checked</xsl:if>
    </xsl:variable>

    <div>
      <xsl:attribute name="class">
        <xsl:if test="not($desc-value)"> nodesc</xsl:if>
        <xsl:if test="if or @plainhint"> control-field</xsl:if>
        <xsl:choose>
          <xsl:when test="@setvalues = 'finalblock'">setvalue sv_nochange sv_blocking</xsl:when>
          <xsl:when test="@setvalues = 'final'"> setvalue sv_nochange</xsl:when>
          <xsl:when test="@setvalues"> setvalue</xsl:when>
        </xsl:choose>
        <xsl:if test="not(key('msg', concat('hint_', parent::node()/@name)))"> nohint</xsl:if>
        <xsl:if test="@img"> l-checkbox-img</xsl:if>
        <xsl:if test="../select or ../input[@type='text'] or ../link"> l-form__control_inline_yes</xsl:if>
      </xsl:attribute>
      <xsl:if test="@img">
        <div class="s16x16 s-icon b-checkbox__img {@img}"></div>
      </xsl:if>
      <div class="b-checkbox">
        <div class="b-checkbox__control {$checked} {local-name(@readonly)} force-hint"
          id="tab0-{@name}"
          data-tabid="tab0"
          tabindex="0"
          data-id="{@name}"></div></div><div class="l-label__wrapper l-label__wrapper_for_checkbox">
        <xsl:if test="parent::node()/@noname and @required and @show_required">
          <span class="b-required-star" style="left: 0px; z-index: -10;">*</span>
        </xsl:if>
        <xsl:choose>
          <xsl:when test="parent::node()/@noname and @required and @show_required">
            <div class="b-label__visible b-label__visible_for_checkbox" data-tabid="tab0" data-id="{@name}" style="left: 20px; width: 100%;"><xsl:value-of select="key('msg', $desc)" disable-output-escaping="yes"/></div>
          </xsl:when>
          <xsl:otherwise>
            <div class="b-label__visible b-label__visible_for_checkbox" data-tabid="tab0" data-id="{@name}"><xsl:value-of select="key('msg', $desc)" disable-output-escaping="yes"/></div>
          </xsl:otherwise>
        </xsl:choose>
        <div class="b-label__invisible b-label__invisible_for_checkbox"><xsl:value-of select="$desc-value" disable-output-escaping="yes"/></div>
        <div class="b-label__line-dotted b-label__line-dotted_for_checkbox"></div>
      </div>
      <input type="hidden"
        value="{$value}"
        data-handler-val="{generate-id($value)}"
        name="{@name}"
        data-type="checkbox"
        data-tabid="tab0">
          <xsl:if test="@event">
            <xsl:attribute name="onchange"><xsl:value-of select="@name"/>_event();</xsl:attribute>
          </xsl:if>
          <xsl:if test="@nosetvalues">
            <xsl:attribute name="class">i-nosetvalues</xsl:attribute>
          </xsl:if>
        </input>
    </div>
  </xsl:template>

  <!--input@type=text/password-->
  <xsl:template match="input">
    <xsl:variable name="pname" select="parent::node()/@name"/>
    <xsl:variable name="name" select="@name"/>
    <!--input buttons-->
    <xsl:choose>
      <xsl:when test="@type='password' and not(@checkpasswd) and @name != 'confirm'">
        <div class="b-input-btn b-input-btn_type_showpwd hint" data-hint="{key('msg', 'msg_eye')}" data-control-field="{@name}" data-tabid="tab0"></div>
      </xsl:when>
      <xsl:when test="@checkpasswd">
        <div class="b-input-btn b-input-btn_type_passwd hint" data-hint="{key('msg', 'msg_genpwd')}" data-control-field="{@name}"></div>
      </xsl:when>
      <xsl:when test="@date">
        <div class="b-input-btn b-input-btn_type_calendar hint" data-hint="{key('msg', 'msg_calendar')}" data-control-field="{@name}" data-type="{@date}"></div>
      </xsl:when>
      <xsl:when test="@unlim">
        <div class="b-input-btn b-input-btn_type_unlimit hint" data-hint="{key('msg', 'msg_unlimit')}" data-control-field="{@name}"></div>
      </xsl:when>
      <xsl:when test="@zoom">
        <div class="b-input-btn b-input-btn_type_zoom hint" data-hint="{key('msg', 'msg_zoom')}" data-control-field="{@name}"></div>
      </xsl:when>
      <xsl:when test="@change">
        <div class="b-input-btn b-input-btn_type_change hint" data-hint="{key('msg', 'msg_change')}"></div>
      </xsl:when>
    </xsl:choose>
    <div>
      <xsl:attribute name="class">
        <xsl:if test="if"> control-field</xsl:if>
        <xsl:choose>
          <xsl:when test="@setvalues = 'finalblock'">setvalue sv_nochange sv_blocking</xsl:when>
          <xsl:when test="@setvalues = 'final'"> setvalue sv_nochange</xsl:when>
          <xsl:when test="@setvalues"> setvalue</xsl:when>
        </xsl:choose>
        <xsl:if test="../select or ../input[@type='checkbox'] or ../link"> l-form__control_inline_yes</xsl:if>
        <xsl:text> l-form__input-wr</xsl:text>
      </xsl:attribute>

    <input value="{/doc/*[local-name() = current()/@name]}"
      type="{@type}"
      name="{@name}"
      id="{@name}-tab0" data-tabid="tab0">
      <xsl:if test="@event">
        <xsl:attribute name="onchange"><xsl:value-of select="@name"/>_event();</xsl:attribute>
      </xsl:if>
      <!--class-->
      <xsl:attribute name="class">
        <xsl:if test="@nosetvalues"> i-nosetvalues </xsl:if>
        <xsl:text>force-hint b-input b-input_type_</xsl:text><xsl:value-of select="@type"/>
        <xsl:if test="@check">
          <xsl:choose>
            <xsl:when test="@zoom"> testzoom</xsl:when>
            <xsl:otherwise> test</xsl:otherwise>
          </xsl:choose>
        </xsl:if>
        <xsl:if test="@type='password' and not(//input[@checkpasswd = current()/@name])"> b-form-passwd-field </xsl:if>
        <xsl:if test="@type='password' and //input[@checkpasswd = current()/@name]"> b-form-confirm-field </xsl:if>
        <xsl:if test="@prefixselect"> b-input_has_prefixselect i-input_has_prefix </xsl:if>
        <xsl:if test="@mask"> i-input-mask </xsl:if>
      </xsl:attribute>
      <!--input@type=text attributes-->
      <xsl:if test="@maxlength and not(@type='password')">
        <xsl:attribute name="maxlength"><xsl:value-of select="@maxlength"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@prefixselect">
        <xsl:attribute name="data-prefix-name"><xsl:value-of select="@prefixselect"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@readonly">
        <xsl:attribute name="readonly">readonly</xsl:attribute>
      </xsl:if>

      <xsl:if test="@mask">
         <xsl:attribute name="data-mask"><xsl:value-of select="@mask"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@check">
        <xsl:attribute name="data-check"><xsl:value-of select="@check"/></xsl:attribute>
        <xsl:attribute name="data-fieldname"><xsl:value-of select="$pname"/></xsl:attribute>
        <xsl:attribute name="data-funcname"><xsl:value-of select="/doc/@func"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@checkargs">
        <xsl:attribute name="data-check-args"><xsl:value-of select="@checkargs"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@duplicate = 'yes'">
        <xsl:attribute name="duplicate">yes</xsl:attribute>
      </xsl:if>
      <xsl:if test="@required = 'yes' or //input[@checkpasswd = current()/@name]/@required">
        <xsl:attribute name="required">required</xsl:attribute>
        <xsl:attribute name="data-required">required</xsl:attribute>
      </xsl:if>
      <xsl:if test="$msg/msg[@name = concat('placeholder_', $pname)]">
        <xsl:attribute name="placeholder"><xsl:value-of select="key('msg', concat('placeholder_', $pname))"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@unlimit">
        <xsl:attribute name="data-unlimit"><xsl:value-of select="@unlimit"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@convert">
        <xsl:attribute name="data-convert"><xsl:value-of select="@convert"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@delimiter">
        <xsl:attribute name="data-delimiter"><xsl:value-of select="@delimiter"/></xsl:attribute>
      </xsl:if>
      <!--input@type=password attributes-->
      <xsl:if test='@checkpasswd'>
        <xsl:attribute name="data-check-field"><xsl:value-of select="@checkpasswd"/></xsl:attribute>
        <xsl:attribute name="data-confirm">yes</xsl:attribute>
        <xsl:attribute name="data-error-msg"><xsl:value-of select="key('msg', concat('msg_', current()/@name))"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@type='password'">
        <xsl:attribute name="data-parent"><xsl:value-of select="@name"/>-tab0</xsl:attribute>
        <xsl:attribute name="data-confirm-field"><xsl:value-of select="//input[@checkpasswd = current()/@name]/@name"/>-tab0</xsl:attribute>
        <xsl:attribute name="autocomplete">off</xsl:attribute>
      </xsl:if>
    </input>
    <xsl:if test="@prefix">
      <div class="b-input__prefix">
        <xsl:value-of select="/doc/*[local-name() = concat($name, '_prefix')]"/>
      </div>
    </xsl:if>
    <xsl:if test="@type='password'">
      <!--input@type=password gen field-->
      <input type="text"
        id="{@name}-tab0-fake"
        data-parent="{@name}-tab0"
        data-tabid="tab0"
        style="display:none;"
        data-confirm-field="{//input[@checkpasswd = current()/@name]/@name}-tab0"
        class="fakePasswd {{=it.classes}} force-hint b-input"
        autocomplete="off">
        <xsl:if test="@required = 'yes' or //input[@checkpasswd = current()/@name]/@required">
          <xsl:attribute name="required">required</xsl:attribute>
          <xsl:attribute name="data-required">required</xsl:attribute>
        </xsl:if>
        </input>
    </xsl:if>
    <!--input@type=text zoom=10-->
    <xsl:if test="@zoom">
      <textarea class="textarea-zoom force-hint b-form-textarea b-textarea b-textarea_for_zoom"
        data-control-field="{@name}"
        name="zoom-{@name}"
       data-tabid="tab0">
        <!--set rows-->
        <xsl:choose>
          <xsl:when test="@zoom">
            <xsl:attribute name="rows"><xsl:value-of select="@zoom"/></xsl:attribute>
          </xsl:when>
          <xsl:otherwise>
            <xsl:attribute name="rows">0</xsl:attribute>
          </xsl:otherwise>
        </xsl:choose>
        <!--set readonly-->
        <xsl:if test="@readonly">
          <xsl:attribute name="readonly">readonly</xsl:attribute>
        </xsl:if>
      </textarea>
    </xsl:if>
  </div>
    <xsl:if test="@type='password' and @checkpasswd">
      <div class="checkpass-indicator-wrapper">
        <div id="checkpass-indicator-wrapper-{@name}-tab0">
          <span class="strength-pass-indicator">
            <span class="ci-square si-one"></span>
            <span class="ci-square si-two"></span>
            <span class="ci-square si-three"></span>
            <span class="ci-square si-four"></span>
          </span>
          <span class="strength-pass-text">
            <span class="st-text st-one"><xsl:value-of select="key('msg', 'msg_pwcheck_short')"/></span>
            <span class="st-text st-two"><xsl:value-of select="key('msg', 'msg_pwcheck_weak')"/></span>
            <span class="st-text st-three"><xsl:value-of select="key('msg', 'msg_pwcheck_good')"/></span>
            <span class="st-text st-four"><xsl:value-of select="key('msg', 'msg_pwcheck_strong')"/></span>
          </span>
        </div>
      </div>
    </xsl:if>
    <xsl:if test="@type='password' and //input[@checkpasswd = current()/@name]">
      <div class="b-form-confirm-message" id="check-confirm-{@name}-tab0">
        <xsl:value-of select="key('msg', 'msg_pwcheck_donotmatch')"/>
      </div>
    </xsl:if>
  </xsl:template>

  <!--htmldata-->
  <xsl:template match="htmldata">
    <div class="b-htmldata__inner b-htmldata">
      <xsl:variable name="img" select="parent::node()/img/@name"/>
      <xsl:if test="parent::node()/img">
        <div class="b-htmldata__img">
          <img data-type="img"
            src="{mgr:fixquote(/doc/*[local-name() = $img]/text())}"
            width="{$img/@width}"
            height="{$img/@height}"
            id="tab0-{$img/@name}"/>
        </div>
      </xsl:if>
      <div id="tab0-{@name}">
        <xsl:value-of select="/doc/*[local-name() = current()/@name]" disable-output-escaping="yes"/>
      </div>
      <div class="b-htmldata__clear l-clear-both"></div>
    </div>
  </xsl:template>

  <!--textdata-->
  <xsl:template match="textdata">
    <xsl:variable name="value">
      <xsl:choose>
        <xsl:when test="@type='msg'">
          <xsl:value-of select="key('msg', current()/@name)" disable-output-escaping="yes"/>
        </xsl:when>
        <xsl:when test="@type='data'">
          <xsl:value-of select="/doc/*[local-name()=current()/@name]" disable-output-escaping="yes"/>
        </xsl:when>
        <xsl:when test="@type='msgdata'">
          <xsl:value-of select="key('msg', /doc/*[local-name()=current()/@name])" disable-output-escaping="yes"/>
        </xsl:when>
      </xsl:choose>
    </xsl:variable>

    <xsl:variable name="img" select="parent::node()/img"/>
    <xsl:if test="$img">
      <div class="b-textdata__img">
        <img data-type="img" src="{mgr:fixquote(/doc/*[local-name() = $img/@name]/text())}" id="tab0-{$img/@name}" width="{$img/@width}" height="{$img/@height}"/>
      </div>
    </xsl:if>

    <div id="tab0-{@name}">
      <xsl:attribute name="class">
        <xsl:if test="@warning"> b-textdata_type_warning</xsl:if>
        <xsl:text> b-textdata b-textdata__inner</xsl:text>
      </xsl:attribute>
      <xsl:value-of select="$value" disable-output-escaping="yes"/>
    </div>
    <div class="b-textdata__clear l-clear-both"></div>
  </xsl:template>

  <!--link-->
  <xsl:template match="link">
    <xsl:variable name="name" select="@name"/>
    <div class="b-form-link">
      <a href="{/doc/*[local-name() = current()/@name]}">
        <xsl:if test="@target">
          <xsl:attribute name="target"><xsl:value-of select="@target"/></xsl:attribute>
        </xsl:if>
        <xsl:value-of select="mgr:fixquote(key('msg', $name))"/>
      </a>
    </div>
  </xsl:template>

  <!--select@type=autocomplete-->
  <xsl:template match="select[@type='autocomplete']">
    <xsl:variable name="value" select="/doc/*[local-name() = current()/@name]"/>
    <xsl:variable name="pname" select="parent::node()/@name"/>
    <div>
      <xsl:attribute name="class">
        <xsl:text>setvalues b-select-ac </xsl:text>
        <xsl:if test="if"> control-field</xsl:if>
      </xsl:attribute>
      <input value="" type="text" autocomplete="off" data-name="{@name}" class="{{=it.classes}} b-input b-select-ac__input force-hint" id="{@name}-tab0" data-tabid="tab0">
       <xsl:if test="@required ='yes'"><xsl:attribute name="required">required</xsl:attribute><xsl:attribute name="data-required">required</xsl:attribute></xsl:if>
       <xsl:if test="$msg/msg[@name = concat('placeholder_', $pname)]">
         <xsl:attribute name="placeholder"><xsl:value-of select="key('msg', concat('placeholder_', $pname))"/></xsl:attribute>
       </xsl:if>"
      </input>
      <ul class="b-select-ac__list" data-id="{@name}-tab0" id="b-select-ac-list__{@name}-tab0" style="display:none;"></ul>
      <input value="{$value}"  type="hidden" name="{@name}" class="{{=it.classes}}" id="key-{@name}-tab0" data-tabid="tab0">
        <xsl:if test="@event">
          <xsl:attribute name="onchange"><xsl:value-of select="@name"/>_event();</xsl:attribute>
        </xsl:if>
      </input>
    </div>
  </xsl:template>

  <!--select@type=radioimg-->
  <xsl:template match="select[@type = 'radioimg']">
    <xsl:variable name="value" select="/doc/*[local-name() = current()/@name]"/>
    <xsl:variable name="name" select="@name"/>
    <div>
      <xsl:attribute name="class">
        <xsl:text>b-radio</xsl:text>
        <xsl:if test="if or @plainhint"> control-field</xsl:if>
        <xsl:if test="@readonly"> readonly</xsl:if>
        <xsl:choose>
          <xsl:when test="@setvalues = 'finalblock'">setvalue sv_nochange sv_blocking</xsl:when>
          <xsl:when test="@setvalues = 'final'"> setvalue sv_nochange</xsl:when>
          <xsl:when test="@setvalues"> setvalue</xsl:when>
        </xsl:choose>
      </xsl:attribute>
      <table class="b-radio-img">
      <!--slist-->
      <xsl:for-each select="/doc/slist[@name=current()/@name]/val">
        <tr class="b-radio-img__row" data-r-class="{$name}-tab0-{generate-id(@key)}">
          <td class="b-radio-img__col b-radio-img__col_radio">
            <div data-id="{$name}-tab0"  data-tabid="tab0" data-val="{@key}" data-handler-val="{generate-id(@key)}" data-init-func="convertDataHandler('{@key}', self)">
              <xsl:attribute name="class">
                <xsl:text>b-radio__control </xsl:text><xsl:value-of select="$name"/><xsl:text>-tab0</xsl:text><xsl:text> </xsl:text><xsl:value-of select="concat($name, '-tab0-', generate-id(@key))"/>
                <xsl:if test="/doc/*[local-name() = $name] = @key"> checked</xsl:if>
              </xsl:attribute>

              <xsl:if test="/doc/*[local-name() = $name] = @key">
                <xsl:attribute name="tabindex">0</xsl:attribute>
              </xsl:if>
            </div>
          </td>
          <td class="b-radio-img__col b-radio-img__col_img">
            <div class="b-radio-img__img-wrapper">
              <xsl:choose>
                <xsl:when test="@sprite">
                  <span class="b-radio-img__img {@img} s-icon s{@width}x{@width}"></span>
                </xsl:when>
                <xsl:when test="@image">
                  <span class="b-radio-img__img">
                    <xsl:attribute name="style">
                      <xsl:text>background-image: url(</xsl:text><xsl:value-of select="@image"/><xsl:text>);</xsl:text>
                      <xsl:if test="@width">width:<xsl:value-of select="@width"/>px;</xsl:if>
                      <xsl:if test="@height">height:<xsl:value-of select="@height"/>px;</xsl:if>
                    </xsl:attribute>
                  </span>
                </xsl:when>
                <xsl:otherwise>
                  <span class="b-radio-img__img" style="background:url({concat($commondir, 'img/', @img, '.png')});"></span>
                </xsl:otherwise>
              </xsl:choose>
            </div>
          </td>
          <td class="b-radio-img__col b-radio-img__col_desc">
            <div class="b-radio-img__desc">
              <xsl:value-of select="." disable-output-escaping="yes"/>
            </div>
          </td>
        </tr>
      </xsl:for-each>
  </table>
  <input type="hidden" name="{@name}" id="{@name}-tab0" data-handler-val="{generate-id(/doc/slist[@name = $name]/val[@key = $value]/@key)}" value="{$value}" data-type="radio" data-tabid="tab0" data-init-func="convertDataHandler('{/doc/slist[@name = $name]/val[@key = $value]/@key}', self)" >
    <xsl:if test="@event">
      <xsl:attribute name="onchange"><xsl:value-of select="@name"/>_event();</xsl:attribute>
    </xsl:if>
  </input>
  </div>
  </xsl:template>

  <!--select@type=radio-->
  <xsl:template match="select[@type='radio']">
    <xsl:variable name="value" select="/doc/*[local-name() = current()/@name]"/>
    <xsl:variable name="name" select="@name"/>
    <div id="tab0-{$name}-radio" data-depend="{@depend}">
      <xsl:attribute name="class">
        <xsl:text>b-radio radios</xsl:text>
        <xsl:if test="//select[@depend = $name]/@name"> depend</xsl:if>
        <xsl:if test="@readonly"> readonly</xsl:if>
        <xsl:if test="if or @plainhint"> control-field</xsl:if>
        <xsl:choose>
          <xsl:when test="@setvalues = 'finalblock'">setvalue sv_nochange sv_blocking</xsl:when>
          <xsl:when test="@setvalues = 'final'"> setvalue sv_nochange</xsl:when>
          <xsl:when test="@setvalues"> setvalue</xsl:when>
        </xsl:choose>
        <xsl:if test="@inline = 'yes'"> b-radio__inline</xsl:if>
        <xsl:if test="not(key('msg', concat('hint_', parent::node()/@name)))"> nohint</xsl:if>
      </xsl:attribute>
      <xsl:for-each select="/doc/slist[@name=current()/@name]/val">
        <div data-dependkey="{@depend}">
          <xsl:attribute name="class">
            <xsl:text>l-radio__item</xsl:text>
            <xsl:choose>
              <xsl:when test="@depend"> dependelem</xsl:when>
              <xsl:otherwise> show</xsl:otherwise>
            </xsl:choose>
          </xsl:attribute>
          <div class="b-radio__control-wr">
            <div data-id="{$name}-tab0"  data-tabid="tab0" data-val="{@key}" data-handler-val="{generate-id(@key)}" data-init-func="convertDataHandler('{@key}', self)">
              <xsl:if test="/doc/*[local-name() = $name] = @key">
                <xsl:attribute name="tabindex">0</xsl:attribute>
              </xsl:if>
              <xsl:attribute name="class">
                <xsl:text>b-radio__control force-hint </xsl:text><xsl:value-of select="concat($name, '-tab0')"/><xsl:text> </xsl:text><xsl:value-of select="concat($name, '-tab0-', generate-id(@key))"/>
                <xsl:if test="/doc/*[local-name() = $name] = @key"> checked</xsl:if>
              </xsl:attribute>
            </div>
          </div>
          <div class="l-label__wrapper l-label__wrapper_for_radio">
            <div class="b-label__visible b-label__visible_for_radio" data-r-class="{$name}-tab0-{generate-id(@key)}"><xsl:value-of select="."/></div>
            <div class="b-label__invisible b-label__invisible_for_radio"><xsl:value-of select="."/></div>
            <span class="b-label__line-dotted  b-label__line-dotted_for_radio"></span>
          </div>
        </div>
    </xsl:for-each>
    <input type="hidden" name="{@name}"
      data-handler-val="{generate-id(/doc/slist[@name = $name]/val[@key = $value]/@key)}"
      id="{@name}-tab0"
      value="{$value}"
      data-type="radio"
      data-tabid="tab0"
      data-init-func="convertDataHandler('{/doc/slist[@name = $name]/val[@key = $value]/@key}', self)">
        <xsl:if test="@event">
          <xsl:attribute name="onchange"><xsl:value-of select="@name"/>_event();</xsl:attribute>
        </xsl:if>
        <xsl:if test="@nosetvalues">
          <xsl:attribute name="class"> i-nosetvalues </xsl:attribute>
        </xsl:if>
    </input>
    </div>
  </xsl:template>

  <!--select@type=multiple-->
  <xsl:template match="select[@type='multiple']">
    <xsl:variable name="name" select="@name"/>
    <div id="tab0-{@name}-ms">
      <xsl:attribute name="class">
        <xsl:text>mselect b-mselect</xsl:text>
        <xsl:choose>
          <xsl:when test="not(@readonly = 'yes')"> mselect-av</xsl:when>
          <xsl:otherwise> readonly</xsl:otherwise>
        </xsl:choose>
        <xsl:if test="count(/doc/*[local-name() = $name]) > 0"> selected</xsl:if>
      </xsl:attribute>
    <div class="b-mselect__view-value force-hint" data-id="tab0-{@name}" tabindex="0">
      <div class="b-myselect__arrow-down b-myselect__arrow-down_for_mselect"><div class="b-myselect__triangle-down"></div></div>
      <ul class="b-mselect__ul-view" id="tab0-{@name}-ms-view" data-tabid="tab0" data-maxselect="{@maxselect}">
        <li class="b-mselect__item b-mselect__item_msg_unselected">
          <xsl:value-of select="mgr:fixquote(key('msg', 'null'))"/>
        </li>
        <xsl:for-each select="/doc/slist[@name=current()/@name]/val">
          <xsl:if test="/doc/*[local-name() = $name] = @key">
            <li data-val="{@key}" unselectable="on" data-s-id="tab0-{$name}-{position()}">
              <xsl:attribute name="class">
                <xsl:text>b-mselect__item</xsl:text>
                <xsl:if test="/doc/*[local-name() = $name] = @key"> chosen</xsl:if>
              </xsl:attribute>
              <xsl:value-of select="."/>
              <span class="b-mselect__unselect"></span>
            </li>
          </xsl:if>
        </xsl:for-each>
      </ul>
    </div>
    <div class="b-mselect__options closed" id="tab0-{@name}-ms-list-wrapper" data-id="tab0-{@name}" data-tabid="tab0">
      <div class="b-mselect__list-value" id="tab0-{@name}-ms-list">
        <ul class="b-mselect__ul-choose" id="tab0-{@name}-ms-list-ul" data-id="tab0-{@name}">
          <li class="b-mselect__item b-mselect__item_select-all"><xsl:value-of select="mgr:fixquote(key('msg', 'msg_select_all'))"/></li>
          <xsl:for-each select="/doc/slist[@name=current()/@name]/val">
            <li data-handler-val="{generate-id(@key)}" data-dependkey="{@depend}" data-val="{@key}" unselectable="on" id="tab0-{$name}-{position()}">
              <xsl:attribute name="class">
                <xsl:text>b-mselect__item</xsl:text>
                <xsl:if test="/doc/*[local-name() = $name] = @key"> chosen</xsl:if>
              </xsl:attribute>
              <xsl:value-of select="."/>
              <span class="b-mselect__unselect"></span>
            </li>
          </xsl:for-each>
          </ul>
      </div>
    </div>
    <input type="hidden" name="{@name}" value="{{=v}}" data-type="multiple" id="tab0-{@name}-ms-value" data-id="tab0-{@name}">
      <xsl:if test="@event">
        <xsl:attribute name="onchange"><xsl:value-of select="@name"/>_event();</xsl:attribute>
      </xsl:if>
      <xsl:if test="@required">
        <xsl:attribute name="required">required</xsl:attribute>
        <xsl:attribute name="data-required">required</xsl:attribute>
      </xsl:if>
      <xsl:if test="@nosetvalues">
        <xsl:attribute name="class"> i-nosetvalues </xsl:attribute>
      </xsl:if>
    </input>
    </div>
  </xsl:template>

  <!--select-->
  <xsl:template match="select">
    <xsl:variable name="value" select="/doc/*[local-name() = current()/@name]"/>
    <xsl:variable name="name" select="@name"/>
    <xsl:variable name="prefixselect" select="//input[@prefixselect = current()/@name]"/>
    <xsl:variable name="color" select="/doc/slist[@name = $name]/val[@key = /doc/*[local-name() = $name]/text()]/@color"/>
    <xsl:variable name="selvalue" >
      <xsl:variable name="selvalueins" select="/doc/slist[@name = $name]/val[@key = $value]"/>
      <xsl:choose>
        <xsl:when test="@diffvalues"><xsl:value-of select="key('msg', 'null')"/></xsl:when>
        <xsl:when test="$selvalueins != ''"><xsl:value-of select="$selvalueins"/></xsl:when>
        <xsl:otherwise><xsl:value-of select="key('msg', 'null')"/></xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:variable name="image">
      <xsl:variable name="selected" select="/doc/slist[@name = $name]/val[@key = $value]"/>
      <xsl:choose>
        <xsl:when test="$selected/@image">
          <xsl:variable name="src" select="mgr:fixquote($selected/@image)"/>
          <xsl:variable name="width" select="mgr:fixquote($selected/@width)"/>
          <xsl:variable name="height" select="mgr:fixquote($selected/@height)"/>
          <xsl:value-of select="concat('&lt;span class=b-myselect__img style=background:url(', $src, ');width:', $width , 'px;height:', $height, 'px; &gt;&lt;/span&gt;')"/>
        </xsl:when>
        <xsl:when test="$selected/@sprite and $selected/@img">
          <xsl:variable name="width" select="$selected/@width"/>
          <xsl:variable name="src" select="concat($selected/@img, ' s-icon s', $width, 'x', $width)"/>
          <xsl:value-of select="concat('&lt;span class=b-myselect__img', $src, '&gt;&lt;/span&gt;')"/>
        </xsl:when>
        <xsl:when test="$selected/@img">
          <xsl:variable name="width" select="$selected/@width"/>
          <xsl:variable name="src" select="concat($commondir, 'img/', $selected/@img, '.png')"/>
          <xsl:value-of select="concat('&lt;span class=b-myselect__img style=background:url(', $src, ');width:', $width , 'px; &gt;&lt;/span&gt;')"/>
        </xsl:when>
        <xsl:otherwise>&amp;nbsp;</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:variable name="depend" select="//select[@depend = $name]/@name"/>
    <div class="b-myselect b-myselect_st_close" data-depend="{@depend}" id="_{@name}-tab0">
      <xsl:attribute name="class">
        <xsl:text>b-myselect sb-select b-myselect_st_close </xsl:text>
        <xsl:if test="if or @plainhint"> control-field </xsl:if>
        <xsl:choose>
          <xsl:when test="@setvalues = 'finalblock'">setvalue sv_nochange sv_blocking</xsl:when>
          <xsl:when test="@setvalues = 'final'"> setvalue sv_nochange </xsl:when>
          <xsl:when test="@setvalues"> setvalue </xsl:when>
        </xsl:choose>
        <xsl:if test="@readonly"> readonly </xsl:if>
        <xsl:if test="$prefixselect"> b-myselect_is_prefix </xsl:if>
        <xsl:if test="$depend"> depend </xsl:if>
      </xsl:attribute>
    <div class="b-myselect__select-selected" data-id="_{@name}-tab0">
      <div class="b-myselect__select-value force-hint" tabindex="0" data-tabid="tab0">
        <xsl:value-of select="$image" disable-output-escaping="yes"/><xsl:value-of select="concat('&lt;span class=b-myselect__item_color_', $color, '&gt;', $selvalue, '&lt;/span&gt;')" disable-output-escaping="yes" />
      </div>
      <div class="b-myselect__arrow-down">
        <div class="b-myselect__triangle-down"></div>
      </div>
    </div>
    <div class="b-myselect__search-box">
      <input type="text" class="scrlbr sb-input force-hint b-input b-input_for_search" data-id="tab0-{@name}" data-tabId="tab0" id="sb-cont-tab0-{@name}"/>
      <div class="sb-info" id="sb-info-tab0-{@name}"></div></div>

    <div class="b-myselect__option-wr" id="opt_{@name}-tab0" data-tabid="tab0">
      <div class="b-myselect__select-list" id="cont-tab0-{@name}">
        <ul data-id="_{@name}-tab0" id="tab0-{@name}" class="b-myselect__select-ul">
          <xsl:for-each select="/doc/slist[@name=current()/@name]/val">
            <li data-val="{@key}"
              data-code="{@code}"
              data-mask="{@mask}"
              data-handler-val="{generate-id(@key)}"
              data-init-func="convertDataHandler('{@key}', self)"
              data-dependkey="{@depend}">
                <xsl:attribute name="class">
                  <xsl:text>b-myselect__select-li </xsl:text>
                  <xsl:if test="$value = @key">selected </xsl:if>
                  <xsl:choose>
                    <xsl:when test="@depend">dependelem </xsl:when>
                    <xsl:otherwise> b-myselect__select-li_show_yes </xsl:otherwise>
                  </xsl:choose>
                  <xsl:if test="@img or @image"> b-myselect__item-image </xsl:if>
                </xsl:attribute>
              <xsl:if test="@img">
                <span class="b-myselect__img {@img}"></span>
              </xsl:if>
              <xsl:if test="@image">
                <span class="b-myselect__img">
                   <xsl:attribute name="style">
                     background-image: url(<xsl:value-of select="@image"/>);
                     <xsl:if test="@width">width: <xsl:value-of select="@width"/>px;</xsl:if>
                     <xsl:if test="@height">height: <xsl:value-of select="@height"/>px;</xsl:if>
                   </xsl:attribute>
                </span>
              </xsl:if>
              <span>
                <xsl:attribute name="class">
                  <xsl:text>b-myselect__option-value</xsl:text>
                  <xsl:if test="@color">b-myselect__item_color_<xsl:value-of select="@color"/></xsl:if>
                </xsl:attribute>
                <xsl:value-of select="."/>
              </span>
            </li>
          </xsl:for-each>
          </ul>
        </div>
      </div>
    <input type="hidden" value="{$value}"
      data-handler-val="{generate-id(/doc/slist[@name = $name]/val[@key = $value]/@key)}"
      name="{@name}"
      id="_{@name}-tab0-val"
      data-type="select"
      data-tabid="tab0"
      data-init-func="convertDataHandler('{/doc/slist[@name = $name]/val[@key = $value]/@key}', self)">
      <xsl:if test="@event">
        <xsl:attribute name="onchange"><xsl:value-of select="@name"/>_event();</xsl:attribute>
      </xsl:if>
      <xsl:attribute name="class">
        <xsl:if test="$prefixselect"> i-myselect_is_prefix </xsl:if>
        <xsl:if test="@nosetvalues"> i-nosetvalues </xsl:if>
      </xsl:attribute>
      <xsl:if test="$prefixselect">
        <xsl:attribute name="data-targetinput"><xsl:value-of select="$prefixselect/@name"/></xsl:attribute>
      </xsl:if>
      </input>
    </div>
  </xsl:template>

  <!--slider-->
  <xsl:template match="slider">
    <xsl:variable name="name" select="@name"/>
    <xsl:variable name="value" select="mgr:fixquote(/doc/*[local-name() = $name]/text())"/>
    <table class="b-slider">
      <tr>
        <td class="l-slider__col l-slider__col_cont_slider">
          <div class="l-slider__wr {local-name(@readonly)}">
            <div class="b-slider__line"></div>
            <div class="b-slider__border b-slider__border_pos_left"></div>
            <div class="b-slider__c-border b-slider__c-border_pos_top"></div>
            <div class="b-slider__c-border b-slider__c-border_pos_bottom"></div>
            <a id="tab0-{@name}-slider" class="b-slider__el" data-min="{@min}" data-tabid="tab0"  data-max="{@max}" data-step="{@step}" data-id="tab0-{@name}" data-value="{$value}">
              <div class="b-slider__core"></div>
            </a>
            <div class="b-slider__border b-slider__border_pos_right"></div>
          </div>
        </td>
        <td class="l-slider__col l-slider__col_cont_input">
          <div>
            <xsl:attribute name="class">
              <xsl:text>l-slider__input-wr</xsl:text>
              <xsl:choose>
                <xsl:when test="@setvalues = 'finalblock'">setvalue sv_nochange sv_blocking</xsl:when>
                <xsl:when test="@setvalues = 'final'"> setvalue sv_nochange</xsl:when>
                <xsl:when test="@setvalues"> setvalue</xsl:when>
              </xsl:choose>
            </xsl:attribute>
            <input type="text" len="32" class="" id="tab0-{@name}" data-tabid="tab0" name="{@name}" value="{$value}">
              <xsl:if test="@readonly">
                <xsl:attribute name="readonly">readonly</xsl:attribute>
              </xsl:if>
              <xsl:attribute name="class">
                <xsl:if test="@nosetvalues"> i-nosetvalues </xsl:if>
                <xsl:text> b-input b-input_for_slider force-hint</xsl:text><xsl:value-of select="local-name(@readonly)"/>
              </xsl:attribute>
              <xsl:if test="@event">
                <xsl:attribute name="onchange"><xsl:value-of select="@name"/>_event();</xsl:attribute>
              </xsl:if>
            </input>
          </div>
        </td>
      </tr>
    </table>
  </xsl:template>

  <!--textarea-->
  <xsl:template match="textarea">
    <xsl:variable name="name" select="@name"/>
    <div>
      <xsl:attribute name="class">
        <xsl:choose>
          <xsl:when test="@setvalues = 'finalblock'">setvalue sv_nochange sv_blocking</xsl:when>
          <xsl:when test="@setvalues = 'final'"> setvalue sv_nochange</xsl:when>
          <xsl:when test="@setvalues"> setvalue</xsl:when>
        </xsl:choose>
      </xsl:attribute>
      <xsl:if test="@quote">
        <div>
          <a href="#" class="b-quote hint" data-target="{@name}-tab0" data-hint="{key('msg', 'hint_quote')}"><xsl:value-of select="key('msg', 'msg_quote')"/></a>
        </div>
      </xsl:if>
      <textarea class="{{=it.classes}} force-hint b-form-textarea b-textarea" id="{@name}-tab0" name="{@name}" rows="{@rows}" wrap="{@wrap}" data-tabid="tab0" data-codelang="{@code}">
        <xsl:if test="@event">
          <xsl:attribute name="onchange"><xsl:value-of select="@name"/>_event();</xsl:attribute>
        </xsl:if>
        <xsl:if test="@readonly"><xsl:attribute name="readonly">readonly</xsl:attribute></xsl:if>
        <xsl:if test="@height"><xsl:attribute name="style"><xsl:value-of select="@height"/>px;</xsl:attribute></xsl:if>
        <xsl:if test="@focus"><xsl:attribute name="data-focus">yes</xsl:attribute></xsl:if>
        <xsl:if test="@required"><xsl:attribute name="required">required</xsl:attribute><xsl:attribute name="data-required">required</xsl:attribute></xsl:if>
        <xsl:if test="$msg/msg[@name = concat('placeholder_', $name)]"><xsl:attribute name="placeholder"><xsl:value-of select="key('msg', concat('placeholder_', $name))"/></xsl:attribute></xsl:if>
        <xsl:attribute name="class">
          <xsl:text> force-hint b-form-textarea b-textarea </xsl:text>
          <xsl:if test="@nosetvalues"> i-nosetvalues </xsl:if>
        </xsl:attribute>
        <xsl:value-of select="mgr:fixquote(/doc/*[local-name() = $name]/text())"/>
      </textarea>
      <div id="{@name}-tab0-editor" data-id="{@name}-tab0"></div>
      <div class="b-resizer b-resizer_for_editor" id="resizer_editor-{@name}-tab0" data-id="{@name}-tab0" data-move-trigger="resizeEditor" data-tabid="tab0">
        <xsl:attribute name="class">
          <xsl:choose>
            <xsl:when test="@editor">b-resizer b-resizer_for_editor</xsl:when>
            <xsl:when test="@texteditor">b-resizer b-resizer_for_texteditor</xsl:when>
            <xsl:otherwise>b-resizer b-resizer_for_textarea</xsl:otherwise>
          </xsl:choose>
        </xsl:attribute>
      </div>
    </div>
  </xsl:template>

  <!--form list block content-->
  <xsl:template match="list[@type='block']">
    <xsl:variable name="col" select="col"/>
    <xsl:variable name="list" select="."/>
    <xsl:variable name="name" select="@name"/>
    <xsl:variable name="form" select="/doc/metadata/form"/>
    <xsl:variable name="disabled-text" select="mgr:fixquote(key('msg', 'msg_disabled'))"/>
    <div class="b-form-blocks">
      <xsl:for-each select="/doc/list[@name = $name]/elem">
        <xsl:variable name="elem" select="."/>
        <div class="b-form-blocks__block">
          <xsl:for-each select="$col">
            <xsl:variable name="colname" select="@name"/>
            <xsl:variable name="curelem" select="$elem/*[local-name() = $colname]"/>
            <xsl:variable name="type" select="@type"/>
            <xsl:variable name="align">
              <xsl:choose>
                <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
                <xsl:otherwise>left</xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <xsl:variable name="width">
              <xsl:choose>
                <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
                <xsl:otherwise>auto</xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <xsl:variable name="height" select="@height"/>
            <div class="b-form-list__col-inner b-form-blocks__col-inner_type_{@type}">
              <xsl:choose>
              <xsl:when test="$type = 'data'">
                <div class="b-form-list__data"><xsl:value-of select="$curelem" disable-output-escaping="yes"/></div>
              </xsl:when>
              <xsl:when test="$type = 'img' and $curelem">
                <img src="{$curelem}" class="b-form-list__img" width="{$width}" height="{$height}"/>
              </xsl:when>
              <xsl:when test="$type = 'button'">
                <div class="b-form-list__button-wrapper">
                  <xsl:for-each select="$curelem/button">
                    <xsl:variable name="cancel-type">
                      <xsl:if test="@type = 'cancel'">
                        <xsl:choose>
                          <xsl:when test="$form/@cancelrefresh">refresh</xsl:when>
                          <xsl:otherwise>default</xsl:otherwise>
                        </xsl:choose>
                      </xsl:if>
                    </xsl:variable>
                    <xsl:variable name="act">
                      <xsl:choose>
                        <xsl:when test="$form/@target">blank</xsl:when>
                        <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
                      </xsl:choose>
                    </xsl:variable>
                    <xsl:variable name="typebtn">
                      <xsl:choose>
                        <xsl:when test="@type = 'cancel' or @type = 'setvalues' or @type = 'reset'"><xsl:value-of select="@type"/></xsl:when>
                        <xsl:otherwise>ok</xsl:otherwise>
                      </xsl:choose>
                    </xsl:variable>
                    <xsl:variable name="enabledtext" select="mgr:fixquote(key('msg', concat('msg_', @name)))"/>
                    <xsl:variable name="text" select="key('msg', concat('msg_', @name))"/>
                    <div class="b-button i-button b-button_color_{@color} b-button_style_{$typebtn} b-button_type_{$typebtn} i-button_type_{$typebtn} {$cancel-type} b-button_act_{$act}"
                      data-tabid="tab0"
                      data-name="{@name}"
                      data-type="{@type}"
                      data-disabled="{$disabled-text}"
                      data-act="{$act}"
                      tabindex="0"
                      data-enabled="{$enabledtext}">
                      <xsl:attribute name="data-id">
                        <xsl:value-of select="$list/@key"/>:<xsl:value-of select="../../*[local-name() = $list/@key]"/>
                      </xsl:attribute>
                      <xsl:value-of select="$text"/>
                    </div>
                  </xsl:for-each>
                  </div>
                </xsl:when>
                </xsl:choose>
              </div>
          </xsl:for-each>
          </div>
      </xsl:for-each>
    </div>
  </xsl:template>

  <!--form list content-->
  <xsl:template match="list">
    <xsl:variable name="col" select="col"/>
    <xsl:variable name="list" select="."/>
    <xsl:variable name="name" select="@name"/>
    <xsl:variable name="form" select="/doc/metadata/form"/>
    <xsl:variable name="disabled-text" select="mgr:fixquote(key('msg', 'msg_disabled'))"/>
    <div class="b-form-list">
      <table class="b-form-list__table">
        <xsl:for-each select="/doc/list[@name = $name]/elem">
          <xsl:variable name="elem" select="."/>
          <tr class="b-form-list__row">
            <xsl:for-each select="$col">
            <!--<xsl:for-each select="./*">-->
              <xsl:variable name="colname" select="@name"/>
              <xsl:variable name="curelem" select="$elem/*[local-name() = $colname]"/>
              <xsl:variable name="type" select="@type"/>
              <xsl:variable name="align">
                <xsl:choose>
                  <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
                  <xsl:otherwise>left</xsl:otherwise>
                </xsl:choose>
              </xsl:variable>
              <xsl:variable name="width">
                <xsl:choose>
                  <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
                  <xsl:otherwise>auto</xsl:otherwise>
                </xsl:choose>
             </xsl:variable>
              <xsl:variable name="height" select="@height"/>
              <td class="b-form-list__col b-form-list__col_align_{$align}" style="width: {$width};">
                <div class="b-form-list__col-inner b-form-list__col-inner_type_{$type}">
                <xsl:choose>
                  <xsl:when test="$type = 'data'">
                    <div class="b-form-list__data"><xsl:value-of select="$curelem" disable-output-escaping="yes"/></div>
                  </xsl:when>
                  <xsl:when test="$type = 'img' and $curelem">
                    <img src="{$curelem}" class="b-form-list__img" width="{$width}" height="{$height}"/>
                  </xsl:when>
                  <xsl:when test="$type = 'button'">
                    <xsl:for-each select="$curelem/button">
                      <xsl:variable name="cancel-type">
                        <xsl:if test="@type = 'cancel'">
                          <xsl:choose>
                            <xsl:when test="$form/@cancelrefresh">refresh</xsl:when>
                            <xsl:otherwise>default</xsl:otherwise>
                          </xsl:choose>
                        </xsl:if>
                      </xsl:variable>
                      <xsl:variable name="act">
                        <xsl:choose>
                          <xsl:when test="$form/@target">blank</xsl:when>
                          <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
                        </xsl:choose>
                      </xsl:variable>
                      <xsl:variable name="typebtn">
                        <xsl:choose>
                          <xsl:when test="@type = 'cancel' or @type = 'setvalues' or @type = 'reset'"><xsl:value-of select="@type"/></xsl:when>
                          <xsl:otherwise>ok</xsl:otherwise>
                        </xsl:choose>
                      </xsl:variable>
                      <xsl:variable name="enabledtext" select="mgr:fixquote(key('msg', concat('msg_', @name)))"/>
                      <xsl:variable name="text" select="key('msg', concat('msg_', @name))"/>
                      <div class="b-button i-button b-button_color_{@color} b-button_style_{$typebtn} b-button_type_{$typebtn} i-button_type_{$typebtn} {$cancel-type} b-button_act_{$act}"
                      data-tabid="tab0"
                      data-name="{@name}"
                      data-type="{@type}"
                      data-disabled="{$disabled-text}"
                      data-act="{$act}"
                      tabindex="0"
                      data-enabled="{$enabledtext}">
                        <xsl:attribute name="data-id">
                          <xsl:value-of select="$list/@key"/>:<xsl:value-of select="../../*[local-name() = $list/@key]"/>
                        </xsl:attribute>
                        <xsl:value-of select="$text"/>
                      </div>
                    </xsl:for-each>
                  </xsl:when>
                </xsl:choose>
                </div>
              </td>
            </xsl:for-each>
            </tr>
        </xsl:for-each>
      </table>
    </div>
  </xsl:template>

  <xsl:template name="showfield">
    <xsl:param name="el"/>
    <xsl:for-each select="$el">
      <xsl:variable name="name" select="parent::node()/@name"/>
      <!--<xsl:variable name="value">-->
        <!--<xsl:choose>-->
          <!--<xsl:when test="/doc/slist[@name=$name]">-->
            <!--<xsl:value-of select="/doc/slist[@name=$name]/val[@key = current()/@value]/@key"/>-->
          <!--</xsl:when>-->
          <!--<xsl:otherwise>-->
            <!--<xsl:value-of select="@value"/>-->
          <!--</xsl:otherwise>-->
        <!--</xsl:choose>-->
      <!--</xsl:variable>-->
      <xsl:variable name="attr">
        <xsl:choose>
          <xsl:when test="@empty">data-show-<xsl:value-of select="$name"/>-empty
          </xsl:when>
          <xsl:otherwise>data-show-<xsl:value-of select="$name"/>-__VALUE__
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <!--<xsl:attribute name="data-init-func">convertIfRules('<xsl:value-of select="@value"/>', '<xsl:value-of select="$attr"/>', self);</xsl:attribute>-->
      convertIfRules('<xsl:value-of select="@value"/>', '<xsl:value-of select="$attr"/>', self)<xsl:if test="position() != last()">||</xsl:if>
    </xsl:for-each>
  </xsl:template>

  <xsl:template name="elseshowfield">
    <xsl:param name="el"/>
    <xsl:for-each select="$el">
      <xsl:variable name="name" select="parent::node()/@name"/>
      <xsl:for-each select="//field[@name=$name]/*/if">
        <!--<xsl:variable name="value" select="/doc/slist[@name=$name]/val[@key = current()/@value]/@key"/>-->
        <xsl:variable name="attr">data-hide-<xsl:value-of select="$name"/>-__VALUE__</xsl:variable>
        <!--<xsl:attribute name="data-init-func">convertIfRules('<xsl:value-of select="@value"/>', '<xsl:value-of select="$attr"/>', self)</xsl:attribute>-->
        convertIfRules('<xsl:value-of select="@value"/>', '<xsl:value-of select="$attr"/>', self)<xsl:if test="position() != last()">||</xsl:if>
      </xsl:for-each>
    </xsl:for-each>
  </xsl:template>

  <!--hide-->
  <xsl:template name="hidefield">
    <xsl:param name="el"/>
    <xsl:for-each select="$el">
      <xsl:variable name="name" select="parent::node()/@name"/>
      <xsl:variable name="value">
        <xsl:choose>
          <xsl:when test="@empty">
            <xsl:if test="@empty='yes'">empty-yes</xsl:if>
            <xsl:if test="@empty='no'">empty-no</xsl:if>
          </xsl:when>
          <!--<xsl:when test="/doc/slist[@name=$name]">-->
            <!--<xsl:value-of select="/doc/slist[@name=$name]/val[@key=current()/@value]/@key"/>-->
          <!--</xsl:when>-->
          <xsl:otherwise>
            <xsl:value-of select="@value"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:variable name="attr">data-hide-<xsl:value-of select="$name"/>-__VALUE__</xsl:variable>
      <!--<xsl:attribute name="data-init-func">convertIfRules('<xsl:value-of select="$value"/>', '<xsl:value-of select="$attr"/>', self)</xsl:attribute>-->
      convertIfRules('<xsl:value-of select="$value"/>', '<xsl:value-of select="$attr"/>', self)<xsl:if test="position() != last()">||</xsl:if>
    </xsl:for-each>
  </xsl:template>

  <!--hide-->
  <xsl:template name="elsehidefield">
    <xsl:param name="el"/>
    <xsl:for-each select="$el">
      <xsl:variable name="name" select="parent::node()/@name"/>
      <xsl:for-each select="//field[@name=$name]/*/if">
        <!--<xsl:variable name="value" select="/doc/slist[@name=$name]/val[@key = current()/@value]/@key"/>-->
        <xsl:variable name="attr">data-show-<xsl:value-of select="$name"/>-__VALUE__</xsl:variable>
        <!--<xsl:attribute name="data-init-func">convertIfRules('<xsl:value-of select="@value"/>', '<xsl:value-of select="$attr"/>', self)</xsl:attribute>-->
        convertIfRules('<xsl:value-of select="@value"/>', '<xsl:value-of select="$attr"/>', self)<xsl:if test="position() != last()">||</xsl:if>
        <!--<xsl:attribute name="{concat('data-show-', $name, '-', $value)}">yes</xsl:attribute>-->
      </xsl:for-each>
    </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>