Your IP : 3.135.215.74


Current Path : /usr/local/mgr5/skins/dragon/
Upload File :
Current File : //usr/local/mgr5/skins/dragon/setvalues.xsl

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mgr="http://ispsystem.com/xslplugin" xmlns:xdsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="mgr"><xsl:import href="extfunc.xsl"/><xsl:output method="xml" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/><xsl:key name="msg" match="/doc/messages/msg" use="@name"/><xsl:variable name="messages" select="/doc/messages"/><xsl:variable name="binary" select="/doc/@binary"/><xsl:variable name="host" select="/doc/@host"/><xsl:variable name="commondir">/manimg/common/</xsl:variable><xsl:variable name="url" select="concat($host, $binary)"/><xsl:template match="/doc"><!-- jsonp suppport header --><xsl:if test="/doc/tparams/callback"><xsl:value-of select="/doc/tparams/callback"/>(</xsl:if>{"setvalues": { <xsl:apply-templates select="./*"/> }}<!-- jsonp support footer --><xsl:if test="/doc/tparams/callback">);</xsl:if></xsl:template><xsl:variable name="form" select="/doc/metadata/form"/><xsl:template match="/doc/*"><xsl:if test="position() = 1">"nullmsg" : "<xsl:value-of select="/doc/messages/msg[@name='null']"/>"</xsl:if><xsl:variable name="name" select="local-name()"/><xsl:if test="$name != 'metadata' and $name != 'messages' and $name != 'doc'"><xsl:variable name="controltype" select="/doc/metadata//field//*[@name = $name]"/><xsl:choose><!--select elems --><xsl:when test="$name = 'slist'"><xsl:variable name="sname" select="@name"/>,"<xsl:value-of select="@name"/>" : { "slist" : [<xsl:apply-templates select="val"/>],<xsl:choose><xsl:when test="count(/doc/*[local-name() = $sname]) > 1">"value" : [<xsl:for-each select="/doc/*[local-name() = $sname]">"<xsl:value-of select="mgr:fixquote(.)"/>"<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>]</xsl:when><xsl:otherwise>"value" : "<xsl:value-of select="/doc/*[local-name() = $sname]"/>"</xsl:otherwise></xsl:choose><xsl:variable name="valueField" select="/doc/*[local-name() = $sname]"/><xsl:if test="$valueField/@readonly">, "readonly" : "<xsl:value-of select="$valueField/@readonly"/>"</xsl:if>}</xsl:when><!-- tree elems --><xsl:when test="$name = 'tlist'">,"<xsl:value-of select="@name"/>" : { "tlist" : [<xsl:apply-templates select="val"/>],"value" : "<xsl:value-of select="/doc/*[local-name() = current()/@name]"/>"}</xsl:when><!-- form list --><xsl:when test="$name = 'list'">,"<xsl:value-of select="@name"/>" : <xsl:apply-templates select="/doc/metadata/form//list[@name = current()/@name]"/></xsl:when><xsl:when test="$name = 'flist'">,"<xsl:value-of select="@name"/>": <xsl:apply-templates select="/doc/metadata/form//listfilter[@name = current()/@name]"/></xsl:when><!-- multiselect values --><xsl:when test="(count(/doc/*[local-name() = $name]) > 1) and (not(/doc/slist[@name = $name]))">,"<xsl:value-of select="$name"/>" : [<xsl:for-each select="/doc/*[local-name() = $name]">"<xsl:value-of select="mgr:fixquote(.)"/>"<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>]</xsl:when><!--ticket message--><xsl:when test="$name = 'mlist'"><xsl:variable name="mname" select="@name"/>,"<xsl:value-of select="$mname"/>" : { "mlist" : [<xsl:call-template name="mlist"><xsl:with-param name="msg" select="."/></xsl:call-template>]}</xsl:when><xsl:when test="$name = 'buttons'">,"buttons": [<xsl:for-each select="./*"><xsl:if test="position() != 1">,</xsl:if>{ "name" : "<xsl:value-of select="@name"/>","flags" : " default<xsl:if test="@keepform">| keepform</xsl:if><xsl:if test="$form/@cancelrefresh">| refresh</xsl:if><xsl:if test="@blocking">| blocking</xsl:if>"<xsl:if test="@func">,"func" : "<xsl:value-of select="@func"/>"</xsl:if><xsl:if test="@default">,"default": true</xsl:if>,"act" : "<xsl:choose><xsl:when test="$form/@target">blank</xsl:when><xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise></xsl:choose>","type" : "<xsl:choose><xsl:when test="@type = 'cancel' or @type = 'setvalues' or @type = 'reset'  or @type = 'func'"><xsl:value-of select="@type"/></xsl:when><xsl:otherwise>ok</xsl:otherwise></xsl:choose>","msg" : "<xsl:value-of select="mgr:fixquote(key('msg', concat('msg_', @name)))"/>","hint" : "<xsl:value-of select="mgr:fixquote(key('msg', concat('hint_', @name)))"/>","color" : "<xsl:value-of select="@color"/>","disabled": <xsl:choose><xsl:when test="@disabled">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose>,"disabledText" : "<xsl:value-of select="mgr:fixquote(key('msg', 'msg_disabled'))"/>" }</xsl:for-each>]</xsl:when><!--single value--><xsl:when test="not(/doc/slist[@name = $name])"><!--detect type of control--><xsl:choose><xsl:when test="local-name($controltype) = 'textdata'"><xsl:choose><xsl:when test="$controltype/@type = 'msgdata'">,"<xsl:value-of select="$name"/>" : { "value" : "<xsl:value-of select="mgr:fixquote(/doc/messages/msg[@name = current()/text()])"/>" }</xsl:when><xsl:otherwise>,"<xsl:value-of select="$name"/>" : { "value" : "<xsl:value-of select="mgr:fixquote(.)"/>" }</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>,"<xsl:value-of select="$name"/>": { "value": "<xsl:value-of select="mgr:fixquote(.)" disable-output-escaping="yes"/>"<xsl:if test="@readonly">, "readonly": "<xsl:value-of select="@readonly"/>"</xsl:if><xsl:if test="@mask">, "mask": "<xsl:value-of select="mgr:fixquote(@mask)"/>"</xsl:if><xsl:if test="//input[@name=$name][@prefix]">, "prefix": "<xsl:value-of select="mgr:fixquote(/doc/*[local-name() = concat($name, '_prefix')])"/>"</xsl:if><xsl:if test="@min">,"min": "<xsl:value-of select="@min"/>"</xsl:if><xsl:if test="@max">,"max": "<xsl:value-of select="@max"/>"</xsl:if><xsl:if test="@step">,"step": "<xsl:value-of select="@step"/>"</xsl:if>}</xsl:otherwise></xsl:choose></xsl:when></xsl:choose></xsl:if></xsl:template><xsl:template match="slist">"<xsl:value-of select="@name"/>" : { "slist" : [<xsl:apply-templates select="slist/val"/>],"value" : "<xsl:value-of select="/doc/*[local-name() = current()/@name]"/>"}</xsl:template><!--slist--><xsl:template match="slist/val"><xsl:variable name="key"><xsl:choose><xsl:when test="@key"><xsl:value-of select="mgr:fixquote(@key)"/></xsl:when><xsl:otherwise><xsl:value-of select="mgr:fixquote(.)"/></xsl:otherwise></xsl:choose></xsl:variable>{"key": "<xsl:value-of select="$key"/>","value": "<xsl:value-of select="mgr:fixquote(.)"/>","depend": "<xsl:value-of select="@depend"/>"<!--,"handlerValue" : "<xsl:value-of select="generate-id(@key)"/>"-->,"classes": "<xsl:if test="@color">b-myselect__item_color_<xsl:value-of select="@color"/></xsl:if>","code": "<xsl:value-of select="mgr:fixquote(@code)"/>","mask": "<xsl:value-of select="mgr:fixquote(@mask)"/>"<xsl:if test="@image">,"src" : "<xsl:value-of select="concat($host, mgr:fixquote(@image))"/>","width" : "<xsl:value-of select="@width"/>","height" : "<xsl:value-of select="@height"/>"</xsl:if><xsl:if test="@img"><xsl:variable name="width" select="@width"/><xsl:choose><xsl:when test="@sprite">,"img" : "<xsl:value-of select="concat(@img, ' s-icon s', $width, 'x', $width)"/>"</xsl:when><xsl:otherwise>,"src" : "<xsl:value-of select="concat($commondir, 'img/', @img, '.png')"/>"</xsl:otherwise></xsl:choose>,"width" : "<xsl:value-of select="@width"/>","height" : "<xsl:value-of select="@height"/>"</xsl:if>}<xsl:if test="position() != last()">,</xsl:if></xsl:template><!--tlist--><xsl:template match="tlist/val"><xsl:variable name="key"><xsl:choose><xsl:when test="@key"><xsl:value-of select="mgr:fixquote(@key)"/></xsl:when><xsl:otherwise><xsl:value-of select="mgr:fixquote(.)"/></xsl:otherwise></xsl:choose></xsl:variable>{"key" :"<xsl:value-of select="$key"/>","value" : "<xsl:value-of select="mgr:fixquote(.)"/>","img" : "<xsl:value-of select="@img"/>","collapsed" : <xsl:choose><xsl:when test="@collapsed">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose>,"child" : []}<xsl:if test="position() != last()">,</xsl:if></xsl:template><!--ticket list--><xsl:template name="mlist"><xsl:param name="msg"/><xsl:for-each select="$msg/message"><xsl:choose><xsl:when test="@type = 'info'">{"type" : "<xsl:value-of select="@type"/>","avatar" : { "is" : false },"rows" : [<xsl:for-each select="./*">{ "label" : "<xsl:value-of select="mgr:fixquote(key('msg', current()/@name))"/>","header" : true}<xsl:if test="position() != last()">,</xsl:if><xsl:if test="position() = last() and current()/row">,</xsl:if><xsl:for-each select="./*">{"label" : "<xsl:value-of select="mgr:fixquote(key('msg', current()/@name))"/>","v" : "<xsl:value-of select="mgr:fixquote(.)"/>"}<xsl:if test="position() != last() or count(parent::node()/following-sibling::node()) > 0">,</xsl:if></xsl:for-each></xsl:for-each>]}<xsl:if test="position() != last()">,</xsl:if></xsl:when><xsl:otherwise>{"type" : "<xsl:value-of select="@type"/>","title" : "<xsl:value-of select="mgr:fixquote(./title)"/>","body" : "<xsl:value-of select="mgr:fixquote(./body)"/>"<xsl:choose><xsl:when test="./avatar">,"avatar" : { "is" : true,"src" : "<xsl:value-of select="./avatar"/>","width" : "<xsl:value-of select="./avatar/@width"/>","height" : "<xsl:value-of select="./avatar/@height"/>"}</xsl:when><xsl:otherwise>,"avatar" : { "is" : false }</xsl:otherwise></xsl:choose><xsl:choose><xsl:when test="./file">,"file" : { "is" : true,"elems" : [<xsl:for-each select="./file">{ "action" : "<xsl:value-of select="@action"/>","preview" : <xsl:choose><xsl:when test="@imgpreview">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose>,"name" : "<xsl:value-of select="mgr:fixquote(./name)"/>","params" : [<xsl:for-each select="./param">{"name" : "<xsl:value-of select="@name"/>", "value" : "<xsl:value-of select="mgr:fixquote(.)"/>"}<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>]}<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>]}</xsl:when><xsl:otherwise>,"file" : { "is" : false }</xsl:otherwise></xsl:choose><xsl:variable name="ratelike" select="./setrate[@name='like']"/><xsl:variable name="ratedislike" select="./setrate[@name='dislike']"/><xsl:variable name="rate" select="./rate"/><xsl:choose><xsl:when test="./setrate">,"rate": {"is": true,"msg": "<xsl:value-of select="mgr:fixquote(key('msg', 'msg_rate'))"/>","id": "<xsl:value-of select="@id"/>","elid": "<xsl:value-of select="/doc/elid"/>","classes": "i-ticket__rate","like": {"img": "<xsl:value-of select="concat($commondir, 'img/', mgr:fixquote($ratelike/@img), '.png')"/>","func": "<xsl:value-of select="$ratelike/@func"/>","msg": "<xsl:value-of select="mgr:fixquote(key('msg', 'msg_rate_like'))"/>"},"dislike": {"img": "<xsl:value-of select="concat($commondir, 'img/', mgr:fixquote($ratedislike/@img), '.png')"/>","func": "<xsl:value-of select="$ratedislike/@func"/>","msg": "<xsl:value-of select="mgr:fixquote(key('msg', 'msg_rate_dislike'))"/>"}}</xsl:when><xsl:when test="./rate">,"rate": {"is": true,"classes": "","msg": "<xsl:value-of select="mgr:fixquote(key('msg', 'msg_rate_done'))"/>"<xsl:choose><xsl:when test="./rate/@name = 'like'">,"like": {"img": "<xsl:value-of select="concat($commondir, 'img/', mgr:fixquote($rate/@img), '.png')"/>","msg": "<xsl:value-of select="mgr:fixquote(key('msg', 'msg_rate_like'))"/>"}</xsl:when><xsl:otherwise>,"dislike": {"img": "<xsl:value-of select="concat($commondir, 'img/', mgr:fixquote($rate/@img), '.png')"/>","msg": "<xsl:value-of select="mgr:fixquote(key('msg', 'msg_rate_dislike'))"/>"}</xsl:otherwise></xsl:choose>}</xsl:when><xsl:otherwise>,"rate": {"is": false}</xsl:otherwise></xsl:choose>}<xsl:if test="position() != last()">,</xsl:if></xsl:otherwise></xsl:choose></xsl:for-each></xsl:template><!--form listfilter--><xsl:template match="/doc/metadata/form//listfilter"><xsl:variable select="parent::node()/@name" name="pname"/>{"label": "<xsl:value-of select="mgr:fixquote(key('msg', @name))"/>","type": "listfilter","name": "<xsl:value-of select="@name"/>","srcField": "<xsl:value-of select="@src_field"/>","srcName": "<xsl:value-of select="parent::node()/list/@name"/>"<xsl:if test="@fixed = 'yes'">,"fixed": true</xsl:if>,"resetMsg": "<xsl:value-of select="mgr:fixquote(key('msg', 'filterclear'))"/>","notFoundMsg": "<xsl:value-of select="mgr:fixquote(key('msg', 'msg_formlist_filter_notfound'))"/>","list": [<xsl:for-each select="/doc/flist[@name = current()/@name]/val">{"name": "filter__<xsl:value-of select="@key"/>","value": "<xsl:choose><xsl:when test="@val"><xsl:value-of select="@val"/></xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose>","cbclass": "","desc": "<xsl:value-of select="mgr:fixquote(.)"/>" }<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>]<xsl:if test="key('elsehide', $pname)">,"show" : [<xsl:call-template name="elsehidefield"><xsl:with-param name="el" select="key('elsehide', $pname)"/></xsl:call-template>]</xsl:if><xsl:if test="key('ifhide', $pname)">,"hide" : [<xsl:call-template name="hidefield"><xsl:with-param name="el" select="key('ifhide', $pname)"/></xsl:call-template>]</xsl:if>}</xsl:template><!--form list--><xsl:template match="/doc/metadata/form//list"><xsl:variable select="parent::node()/@name" name="pname"/><xsl:variable name="name" select="@name"/><xsl:variable name="col" select="col"/><xsl:variable name="listfilter" select="parent::node()/listfilter"/><xsl:variable name="list" select="."/>{"name": "<xsl:value-of select="$name"/>","type" : "list","view": "<xsl:choose><xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when><xsl:otherwise>list</xsl:otherwise></xsl:choose>"<xsl:if test="$listfilter">,"filterfield": "<xsl:value-of select="$listfilter/@src_field"/>"</xsl:if><!--,"formflags" : {--><!--"disabledText" : "<xsl:value-of select="mgr:fixquote(key('msg', 'msg_disabled'))"/>"--><!--}-->,"coldata": {<xsl:for-each select="$col">"<xsl:value-of select="@name"/>" : {"name" : "<xsl:value-of select="@name"/>","type" : "<xsl:value-of select="@type"/>","align" : "<xsl:choose><xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose>","width" : "<xsl:choose><xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose>"}<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>},"rows" : [<xsl:if test="@type = 'table'">{<xsl:for-each select="$col">"<xsl:value-of select="@name"/>" : {"v" : "<xsl:value-of select="mgr:fixquote(key('msg', concat('list_', current()/@name)))"/>","header" : true}<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>}<xsl:if test="count(/doc/list[@name = $name]/elem) > 0">,</xsl:if></xsl:if><xsl:for-each select="/doc/list[@name = $name]/elem">{<xsl:for-each select="./*"><xsl:variable name="colname" select="local-name()"/><xsl:variable name="type" select="$col[@name = $colname]/@type"/>"<xsl:value-of select="$colname"/>":<xsl:choose><xsl:when test="$type = 'button'">[<xsl:for-each select="./button">{"name" : "<xsl:value-of select="@name"/>","act" : "<xsl:choose><xsl:when test="$form/@target">blank</xsl:when><xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise></xsl:choose>","type" : "<xsl:choose><xsl:when test="@type = 'cancel' or @type = 'setvalues' or @type = 'reset' or @type = 'func'"><xsl:value-of select="@type"/></xsl:when><xsl:otherwise>ok</xsl:otherwise></xsl:choose>","msg" : "<xsl:value-of select="mgr:fixquote(key('msg', concat('msg_', @name)))"/>","id": "<xsl:choose><xsl:when test="@key"><xsl:value-of select="$list/@key"/>=<xsl:value-of select="../../*[local-name() = current()/@key]"/></xsl:when><xsl:otherwise><xsl:value-of select="$list/@key"/>=<xsl:value-of select="../../*[local-name() = $list/@key]"/></xsl:otherwise></xsl:choose>","hint" : "<xsl:value-of select="mgr:fixquote(key('msg', concat('hint_', @name)))"/>","flags" : " default<xsl:if test="@keepform">| keepform</xsl:if><xsl:if test="$form/@cancelrefresh">| refresh</xsl:if><xsl:if test="@blocking">| blocking</xsl:if>"<xsl:if test="@func">,"func" : "<xsl:value-of select="@func"/>"</xsl:if><xsl:if test="@default">,"default": true</xsl:if>,"color" : "<xsl:value-of select="@color"/>","disabled": <xsl:choose><xsl:when test="@disabled">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose>,"disabledText" : "<xsl:value-of select="mgr:fixquote(key('msg', 'msg_disabled'))"/>"}<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>]</xsl:when><xsl:when test="$type = 'img'">{<xsl:choose><xsl:when test="@img"><xsl:variable name="width" select="@width"/><xsl:choose><xsl:when test="@sprite">"img" : "<xsl:value-of select="concat(@img, ' s-icon s', $width, 'x', $width) "/>"</xsl:when><xsl:otherwise>"src" : "<xsl:value-of select="concat($host, $commondir, 'img/', @img, '.png')"/>"</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>"src" : "<xsl:value-of select="$host"/><xsl:value-of select="mgr:fixquote(.)"/>"</xsl:otherwise></xsl:choose>,"preview": <xsl:choose><xsl:when test="$col[@name = $colname]/@preview">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose>,"width" : "<xsl:value-of select="$col[@name = $colname]/@width"/>","height" : "<xsl:value-of select="$col[@name = $colname]/@height"/>"}</xsl:when>          <xsl:when test="$type = 'control'">[<xsl:for-each select="./input"><xsl:apply-templates select="."/></xsl:for-each><xsl:for-each select="./select"><xsl:apply-templates select="."/></xsl:for-each>]</xsl:when><xsl:when test="$type = 'msg'"><xsl:variable name="msgContent" select="mgr:fixquote(key('msg', current()))"/>{ "v" : "<xsl:choose><xsl:when test="$msgContent != ''"><xsl:value-of select="$msgContent"/></xsl:when><xsl:otherwise><xsl:value-of select="mgr:fixquote(current())"/></xsl:otherwise></xsl:choose>"<xsl:if test="@color">,"color" : "<xsl:value-of select="@color"/>"</xsl:if>}</xsl:when><xsl:when test="$listfilter and $listfilter/@src_field = local-name()">{"v": [<xsl:for-each select="./tag">"<xsl:value-of select="mgr:fixquote(.)"/>"<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>],"o": {<xsl:for-each select="./tag">"<xsl:value-of select="mgr:fixquote(.)"/>" : true<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>}}</xsl:when><xsl:otherwise>{ "v" : "<xsl:value-of select="mgr:fixquote(.)"/>"<xsl:if test="@color">,"color" : "<xsl:value-of select="@color"/>"</xsl:if>}</xsl:otherwise></xsl:choose><xsl:if test="position() != last()">,</xsl:if></xsl:for-each>}<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>]}<xsl:if test="position() != last()">,</xsl:if></xsl:template><!--input type=checkbox --><xsl:template match="input[@type = 'checkbox']"><xsl:variable select="@name" name="name"/><xsl:variable select="parent::node()/@name" name="pname"/><xsl:variable name="checked"><xsl:choose><xsl:when test="@diffvalues"></xsl:when><xsl:when test="/doc/*[local-name() = $name] = 'on'">checked</xsl:when></xsl:choose></xsl:variable>{"attr" : "type='checkbox' name='<xsl:value-of select="$name"/>' value='<xsl:if test="count(/doc/*[local-name() = $name]) != 0">on</xsl:if>'","label" : "<xsl:if test="not(parent::node()/@noname)"><xsl:value-of select="mgr:fixquote(key('msg', $pname))"/></xsl:if>","type" : "<xsl:value-of select="@type"/>","name" : "<xsl:value-of select="$name"/>","value" : "<xsl:choose><xsl:when test="/doc/*[local-name() = $name] = 'on'">on</xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose>","cbclass" : "<xsl:value-of select="$checked"/> <xsl:if test="@default"> i-checkbox_type_default</xsl:if>","hint" : "<xsl:value-of select="mgr:fixquote(key('msg', concat('hint_', $pname)))"/>"<xsl:if test="key('msg', concat('shadow_hint_', $pname))">,"shadowHint" :  "<xsl:value-of select="mgr:fixquote(key('msg', concat('shadow_hint_', $pname)))"/>"</xsl:if>,"dependFields" : "<xsl:if test="if or @plainhint">control-field</xsl:if>","fieldname" : "<xsl:value-of select="parent::node()/@name"/>","setvalue" : "<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 = 'blocking'">setvalue sv_blocking</xsl:when><xsl:when test="@setvalues = 'yes'">setvalue</xsl:when><xsl:when test="@setvalue"><xsl:value-of select="@setvalue"/></xsl:when></xsl:choose>","readonly" : "<xsl:if test="@readonly = 'yes'">readonly</xsl:if>"<xsl:variable name="desc" select="parent::node()/desc/@name"/>,"attrInput" : "<xsl:if test="@diffvalues">data-novalue='yes'</xsl:if>","desc" : "<xsl:value-of select="mgr:fixquote(key('msg', $desc))" disable-output-escaping="yes"/>"}<xsl:if test="position() != last()">,</xsl:if></xsl:template><!--input type = text --><xsl:template match="input[@type = 'text']"><xsl:variable select="@name" name="name"/><xsl:variable name="pname" select="parent::node()/@name"/><xsl:variable name="valuefield" select="/doc/*[local-name() = $name]"/><xsl:variable name="value" select="mgr:fixquote($valuefield/text())"/>{"attr" : "type='text' name='<xsl:value-of select="$name" disable-output-escaping="yes"/>'<xsl:if test="@maxlength">maxlength='<xsl:value-of select="@maxlength"/>'</xsl:if><xsl:if test="@readonly"> readonly</xsl:if><xsl:if test="@check"> data-check='<xsl:value-of select="@check"/>' data-fieldname='<xsl:value-of select="parent::node()/@name"/>' data-funcname='<xsl:value-of select="/doc/@func"/>'</xsl:if><xsl:if test="@checkargs"> data-check-args='<xsl:value-of select="@checkargs"/>'  </xsl:if><xsl:if test="@duplicate = 'yes'"> duplicate='yes' </xsl:if><xsl:if test="@required ='yes'"> required='required' </xsl:if><xsl:if test="$messages/msg[@name = concat('placeholder_', $pname)] != ''"> placeholder='<xsl:value-of select="mgr:fixquote($messages/msg[@name = concat('placeholder_', $pname)])"/>' </xsl:if><xsl:if test="@unlimit"> data-unlimit='<xsl:value-of select="@unlimit"/>' </xsl:if><xsl:if test="@convert"> data-convert='<xsl:value-of select="@convert"/>' </xsl:if><xsl:if test="@diffvalues"> data-novalue='yes' </xsl:if><xsl:if test="@delimiter"> data-delimiter='<xsl:value-of select="@delimiter"/>' </xsl:if><xsl:if test="@oncesyncfield"> data-syncfield='<xsl:value-of select="@oncesyncfield"/>'</xsl:if>","value" : "<xsl:value-of select="$value"/>","required" : "<xsl:if test="@required">required</xsl:if>","label" : "<xsl:if test="not(parent::node()/@noname)"><xsl:value-of select="mgr:fixquote(key('msg', $pname))"/></xsl:if>","type" : "<xsl:value-of select="@type"/>","name" : "<xsl:value-of select="$name"/>","hint" : "<xsl:value-of select="mgr:fixquote(key('msg', concat('hint_', $pname)))"/>"<xsl:if test="key('msg', concat('shadow_hint_', $pname))">,"shadowHint" :  "<xsl:value-of select="mgr:fixquote(key('msg', concat('shadow_hint_', $pname)))"/>"</xsl:if>,"fieldname" : "<xsl:value-of select="parent::node()/@name"/>"<xsl:variable name="desc" select="parent::node()/desc/@name"/>,"desc" : "<xsl:value-of select="mgr:fixquote($messages/msg[@name = $desc])"/>","descName": "<xsl:value-of select="$desc"/>"<xsl:if test="@zoom">,"textareaAttr" : " name= 'zoom-<xsl:value-of select="$name"/>' rows='<xsl:choose><xsl:when test="@zoom"><xsl:value-of select="@zoom"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose>' data-control-field='<xsl:value-of select="$name"/>' <xsl:if test="@readonly"> readonly</xsl:if>"</xsl:if><xsl:if test="@prefix">,"prefix" : "<xsl:value-of select="mgr:fixquote(/doc/*[local-name() = concat($name, '_prefix')])"/>"</xsl:if>,"unlimit" : <xsl:choose><xsl:when test="@unlimit">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose>,"change" : <xsl:choose><xsl:when test="@change">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose>,"zoom" : <xsl:choose><xsl:when test="@zoom">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose>,"hintBtn" : "<xsl:choose><xsl:when test="@zoom"><xsl:value-of select="mgr:fixquote(key('msg', 'msg_zoom')) "/></xsl:when><xsl:when test="@date"><xsl:value-of select="mgr:fixquote(key('msg', 'msg_calendar')) "/></xsl:when><xsl:when test="@unlimit"><xsl:value-of select="mgr:fixquote(key('msg', 'msg_unlimit')) "/></xsl:when><xsl:when test="@change"><xsl:value-of select="mgr:fixquote(key('msg', 'msg_change')) "/></xsl:when></xsl:choose>","zoomlen" : <xsl:choose><xsl:when test="@zoom"><xsl:value-of select="@zoom"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose>,"date" : <xsl:choose><xsl:when test="@date">"<xsl:value-of select="@date"/>"</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose>,"dependFields" : "<xsl:if test="if">control-field</xsl:if>","setvalue" : "<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 = 'blocking'">setvalue sv_blocking</xsl:when><xsl:when test="@setvalues = 'yes'">setvalue</xsl:when><xsl:when test="@setvalues"><xsl:value-of select="@setvalues"/></xsl:when></xsl:choose>"<xsl:if test="parent::node()/@fullwidth = 'yes'">,"fullwidth" : true</xsl:if><xsl:if test="parent::node()/@formwidth = 'yes'">,"formwidth" : true</xsl:if><xsl:if test="@delimiter">,"delimiter" : "<xsl:value-of select="@delimiter"/>"</xsl:if><xsl:variable name="addition" select="local-name(following-sibling::*[1])"/><xsl:variable name="additiontype" select="following-sibling::*[1]/@type"/><xsl:if test="$addition = 'select' or ($addition = 'input' and $additiontype != 'hidden') or $addition = 'link'">,"hasAddition": true</xsl:if><!--check if it addition field --><xsl:variable name="prevelem" select="local-name(preceding-sibling::*[1])"/><xsl:variable name="prevelemtype" select="preceding-sibling::*[1]/@type"/><xsl:if test="$prevelem = 'select' or ($prevelem = 'input' and $prevelemtype != 'hidden')">,"skip": true</xsl:if><xsl:if test="@check">,"test" : "<xsl:value-of select="@check"/>"</xsl:if><xsl:if test="/doc/error/@object = $name">,"error" : "<xsl:value-of select="mgr:fixquote(/doc/error/msg)"/>"</xsl:if>}<xsl:if test="position() != last()">,</xsl:if></xsl:template><!--select --><xsl:template match="select"><xsl:variable select="@name" name="name"/><xsl:variable name="pname" select="parent::node()/@name"/><xsl:variable name="value" select="mgr:fixquote(/doc/*[local-name() = $name]/text())"/><xsl:variable name="color" select="/doc/slist[@name = $name]/val[@key = /doc/*[local-name() = $name]/text()]/@color"/><xsl:variable name="depend" select="//select[@depend = $name]/@name"/><xsl:variable name="svalue"><xsl:choose><xsl:when test="@diffvalues"></xsl:when><xsl:when test="$value = ''"><xsl:value-of select="mgr:fixquote(/doc/slist[@name = $name]/val[1]/@key)"/></xsl:when><xsl:otherwise><xsl:value-of select="$value"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="selvalue" ><xsl:variable name="selvalueins" select="/doc/slist[@name = $name]/val[@key = $svalue]"/><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 = /doc/*[local-name() = $name]/text()]"/><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, '&quot;')"/><xsl:value-of select="concat('&lt;span class=&quot;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>{"label" : "<xsl:if test="not(parent::node()/@noname)"><xsl:value-of select="mgr:fixquote(key('msg', $pname))"/></xsl:if>","type" : "select","name" : "<xsl:value-of select="$name"/>"<xsl:if test="@period">,"period": true</xsl:if>,"slist" : [<xsl:call-template name="slist"><xsl:with-param name="nameslist" select="@name"/></xsl:call-template>]<xsl:if test="@plainhint">,"plainhint": [{}<xsl:call-template name="plainhint"><xsl:with-param name="name" select="@name"/><xsl:with-param name="type" select="@type"/></xsl:call-template>]</xsl:if>,"value" : "<xsl:value-of select="$svalue"/>","img": "<xsl:value-of select="mgr:fixquote($image)" disable-output-escaping="yes"/>","msg" : "<xsl:value-of select="mgr:fixquote(concat('&lt;span class=b-myselect__item_color_', $color, '&gt;', $selvalue, '&lt;/span&gt;'))" disable-output-escaping="yes" />","hint" : "<xsl:value-of select="mgr:fixquote(key('msg', concat('hint_', $pname)))"/>","hintByName" : "<xsl:value-of select="mgr:fixquote(key('msg', concat('hint_', $name)))"/>"<xsl:if test="key('msg', concat('shadow_hint_', $pname))">,"shadowHint" :  "<xsl:value-of select="mgr:fixquote(key('msg', concat('shadow_hint_', $pname)))"/>"</xsl:if>,"fieldname" : "<xsl:value-of select="parent::node()/@name"/>","depend" : "<xsl:if test="$depend != ''">depend</xsl:if>","propWidth": <xsl:choose><xsl:when test="@propwidth">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose>,"dependMaster" : "<xsl:value-of select="@depend"/>","dependFields" : "<xsl:if test="if or @plainhint">control-field</xsl:if>","readonly" : "<xsl:if test="@readonly = 'yes'">readonly</xsl:if>","required" : "<xsl:if test="@required">required</xsl:if>"<xsl:if test="@targetfontfamilyview">,"targetfontfamilyview" : "<xsl:value-of select="@targetfontfamilyview"/>"</xsl:if><!-- check addition field--><xsl:variable name="addition" select="local-name(following-sibling::*[1])"/><xsl:variable name="additiontype" select="following-sibling::*[1]/@type"/><xsl:if test="$addition = 'select' or ($addition = 'input' and $additiontype != 'hidden') or $addition = 'link'">,"hasAddition": true</xsl:if><!--check if it addition field --><xsl:variable name="prevelem" select="local-name(preceding-sibling::*[1])"/><xsl:variable name="prevelemtype" select="preceding-sibling::*[1]/@type"/><xsl:if test="$prevelem = 'select' or ($prevelem = 'input' and $prevelemtype != 'hidden')">,"skip": true</xsl:if><!--dangerous find in select here!!!-->,"setvalue" : "<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 = 'blocking'">setvalue sv_blocking</xsl:when><xsl:when test="@setvalues = 'yes'">setvalue</xsl:when><xsl:when test="@setvalues"><xsl:value-of select="@setvalues"/></xsl:when></xsl:choose><xsl:if test="count(//slist[@name = $name]/val) &gt; 10"> sb-select</xsl:if>","attrInput" : "<xsl:if test="@diffvalues">data-novalue='yes'</xsl:if>"<xsl:if test="/doc/error/@object = $name">,"error" : "<xsl:value-of select="mgr:fixquote(/doc/error/msg)"/>"</xsl:if>}<xsl:if test="position() != last()">,</xsl:if></xsl:template><!--slist value--><xsl:template name="slist"><xsl:param name="nameslist"/><xsl:apply-templates select="/doc/slist[@name = $nameslist]/*"/></xsl:template></xsl:stylesheet>