Your IP : 18.222.35.177
<?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:import href="extfunc.xsl"/>
<xsl:output method="xml" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
<xsl:variable name="theme" select="/doc/@theme"/>
<xsl:variable name="localdir" select="/doc/@localdir"/>
<xsl:variable name="func" select="/doc/@func"/>
<xsl:variable name="msg" select="/doc/messages/msg"/>
<xsl:key name="msg" match="/doc/messages/msg" use="@name"/>
<xsl:variable name="commondir">/manimg/common/</xsl:variable>
<xsl:variable name="notify" select="/doc/@notify"/>
<xsl:template match="/" priority="100">
{ "title" : "<xsl:value-of select="mgr:fixquote(key('msg', 'title'))" />"
,"id" : "<xsl:value-of select="$func" />"
,"func": "<xsl:value-of select="$func" />"
,"blocks" : [<xsl:apply-templates select="//block"/>]
,"notify" : "<xsl:value-of select="$notify"/>"
<xsl:if test="/doc/tips/tip">
,"tips" : [<xsl:for-each select="/doc/tips/tip">{
"name": "<xsl:value-of select="."/>",
"content": "<xsl:value-of select="key('msg', concat('tip_', .))"/>"}<xsl:if test="position() != last()">,</xsl:if>
</xsl:for-each>]
</xsl:if>
}
</xsl:template>
<xsl:template match="block">
<xsl:variable name="name" select="@name"/>
{ "name" : "<xsl:value-of select="@name" />"
,"hintReload" : "<xsl:value-of select="mgr:fixquote(key('msg', 'hint_reload'))"/>"
,"type" : "<xsl:value-of select="@type"/>"
,"position" : "<xsl:value-of select="@position"/>"
<xsl:if test="@autoupdate">
,"autoupdate": "<xsl:value-of select="@autoupdate"/>"
</xsl:if>
<xsl:if test="@update">
,"update": true
</xsl:if>
<xsl:if test="@rows">
,"rows" : "<xsl:value-of select="@rows"/>"
</xsl:if>
<xsl:if test="@func">
,"func" : "<xsl:value-of select="@func"/>"
</xsl:if>
<xsl:if test="@type='url'">
,"url" : "<xsl:value-of select="mgr:fixquote(url)"/>"
</xsl:if>
,"params" : {
<xsl:for-each select="param">
"<xsl:value-of select="@name"/>" : "<xsl:value-of select="."/>"<xsl:if test="position() != last()">,</xsl:if>
</xsl:for-each>
}
<xsl:if test="@display">
,"display" : "<xsl:value-of select="@display"/>"
</xsl:if>
<xsl:if test="@type = 'toolbar'">
,"toolbar" : [<xsl:apply-templates select="toolbtn"><xsl:with-param name="blockname" select="$name"/></xsl:apply-templates> ]
</xsl:if>
<xsl:if test="@type = 'list'">
,"cols" : [<xsl:apply-templates select="col"/>]
</xsl:if>
,"title" : "<xsl:value-of select="mgr:fixquote($msg[@name = concat('title_', $name)])"/>"
}<xsl:if test="position() != last()">,</xsl:if>
</xsl:template>
<xsl:template match="toolbtn">
<xsl:param name="blockname"/>
<xsl:variable name="name" select="@name"/>
{ "name" : "<xsl:value-of select="@name"/>"
,"img" : "<xsl:value-of select="@img"/>"
,"style" : "<xsl:if test="not(@sprite)">style = 'background : url(<xsl:value-of select="concat($commondir, 'img/', @img, '.png')"/>) left top no-repeat';</xsl:if>"
,"hint": "<xsl:value-of select="mgr:fixquote(key('msg', concat('hint_', @name)))"/>"
,"type" : <xsl:choose>
<xsl:when test="@top">"top"</xsl:when>
<xsl:when test="@window">"window"</xsl:when>
<xsl:when test="@form and @list">"form-list"</xsl:when>
<xsl:when test="@form">"form"</xsl:when>
<xsl:when test="@list">"list"</xsl:when>
<xsl:when test="@link">"link"</xsl:when>
</xsl:choose>
,"func" : <xsl:choose>
<xsl:when test="@top">"<xsl:value-of select="@top"/>"</xsl:when>
<xsl:when test="@form and @list">"<xsl:value-of select="@form"/>"</xsl:when>
<xsl:when test="@form">"<xsl:value-of select="@form"/>"</xsl:when>
<xsl:when test="@list">"<xsl:value-of select="@list"/>"</xsl:when>
<xsl:otherwise>""</xsl:otherwise>
</xsl:choose>
<xsl:if test="@disabled">
,"disabled": true
</xsl:if>
<xsl:if test="@list">
,"list" : "<xsl:value-of select="@list"/>"
</xsl:if>
<xsl:if test="@form">
,"form" : "<xsl:value-of select="@form"/>"
</xsl:if>
<xsl:if test="@top">
,"top" : "<xsl:value-of select="@top"/>"
</xsl:if>
<xsl:if test="@window">
,"window": "?func=<xsl:value-of select="@window"/>&newwindow=yes"
,"target": "target='_blank'"
</xsl:if>
<xsl:if test="@link">
,"target": "<xsl:choose><xsl:when test="@target">target='<xsl:value-of select="@target"/>'</xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose>"
,"link": "<xsl:value-of select="mgr:fixquote(@link)"/>"
</xsl:if>
,"msg" : "<xsl:value-of select="mgr:fixquote($msg[@name = concat($blockname, '_', $name)])"/>"
}<xsl:if test="position() != last()">,</xsl:if>
</xsl:template>
</xsl:stylesheet>