Annotation of kupu/apache-lenya/lenya/kupumacros.xsl, revision 1.1.1.1

1.1       dwinter     1: <?xml version="1.0"?>
                      2: 
                      3: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                      4:   xmlns:xhtml="http://www.w3.org/1999/xhtml" 
                      5:   xmlns:i18n="http://apache.org/cocoon/i18n/2.1" 
                      6:   exclude-result-prefixes="xhtml i18n" >
                      7:   
                      8:   <xsl:param name="document-path"/>
                      9:   <xsl:param name="contentfile"/>
                     10:   <xsl:param name="save-destination"/>
                     11:   <xsl:param name="exit-destination"/>
                     12:   <xsl:param name="reload-after-save" select="'1'"/>
                     13:   <xsl:param name="use-css" select="'1'"/>
                     14:   <xsl:param name="context-prefix" select="/"/>
                     15:   <xsl:param name="kupu-common-dir" 
                     16:     select="concat($context-prefix,'/kupu/common/')"/>
                     17:   <xsl:param name="kupu-logo" 
                     18:     select="concat($kupu-common-dir, 'kupuimages/kupu_icon.gif')"/>
                     19:   <xsl:param name="lenya-logo" 
                     20:     select="concat($context-prefix, '/lenya/images/project-logo-small.png')"/>
                     21:   <xsl:param name="imagedrawer-xsl-uri"/>
                     22:   <xsl:param name="image-libraries-uri"/>
                     23:   <xsl:param name="linkdrawer-xsl-uri"/>
                     24:   <xsl:param name="link-libraries-uri"/>
                     25:       
                     26:   <!--
                     27:     Kupu config
                     28:   -->
                     29:   <xsl:template match="xhtml:kupuconfig/xhtml:dst">
                     30:     <dst>
                     31:       <xsl:value-of select="$save-destination"/>
                     32:     </dst>
                     33:   </xsl:template>
                     34:   
                     35:   <xsl:template match="xhtml:kupuconfig/xhtml:reload_after_save">
                     36:     <reload_after_save>
                     37:       <xsl:value-of select="$reload-after-save"/>
                     38:     </reload_after_save>
                     39:   </xsl:template>
                     40:   
                     41:   <xsl:template match="xhtml:kupuconfig/xhtml:use_css">
                     42:     <use_css>
                     43:       <xsl:value-of select="$use-css"/>
                     44:     </use_css>
                     45:   </xsl:template>
                     46:   
                     47:   <xsl:template match="xhtml:kupuconfig/xhtml:exit_destination">
                     48:     <exit_destination>
                     49:       <xsl:value-of select="$exit-destination"/>
                     50:     </exit_destination>
                     51:   </xsl:template>
                     52:   
                     53:   <xsl:template match="xhtml:kupuconfig/xhtml:image_xsl_uri">
                     54:     <image_xsl_uri>
                     55:       <xsl:value-of select="$imagedrawer-xsl-uri"/>
                     56:     </image_xsl_uri>
                     57:   </xsl:template>
                     58:   
                     59:   <xsl:template match="xhtml:kupuconfig/xhtml:link_xsl_uri">
                     60:     <link_xsl_uri>
                     61:       <xsl:value-of select="$linkdrawer-xsl-uri"/>
                     62:     </link_xsl_uri>
                     63:   </xsl:template>
                     64:  
                     65:   <xsl:template match="xhtml:kupuconfig/xhtml:image_libraries_uri">
                     66:     <image_libraries_uri>
                     67:       <xsl:value-of select="$image-libraries-uri"/>
                     68:     </image_libraries_uri>
                     69:   </xsl:template>
                     70:   
                     71:   <xsl:template match="xhtml:kupuconfig/xhtml:link_libraries_uri">
                     72:     <link_libraries_uri>
                     73:       <xsl:value-of select="$link-libraries-uri"/>
                     74:     </link_libraries_uri>
                     75:   </xsl:template>
                     76:   
                     77:   <!-- 
                     78:     Use default tables classes from xmlconfig.kupu.
                     79:     Override if appropriate.
                     80:   -->
                     81:   <xsl:template match="xhtml:kupuconfig/xhtml:table_classes">
                     82:     <xsl:copy-of select="."/>
                     83:   </xsl:template>
                     84:   
                     85:     <xsl:template match="//xhtml:*[@id='kupu-editor']/@src">
                     86:     <xsl:attribute name="src">
                     87:       <xsl:value-of select="$contentfile"/>
                     88:     </xsl:attribute>
                     89:   </xsl:template>
                     90:   
                     91:   <!--
                     92:     Link rewriting.
                     93:     TODO: Take care of Lenya's link rewriting machanism.
                     94:   -->
                     95:   <xsl:template match="xhtml:link/@href">
                     96:     <xsl:attribute name="href">
                     97:       <xsl:value-of select="concat($kupu-common-dir, .)"/>
                     98:     </xsl:attribute>
                     99:   </xsl:template>
                    100:   
                    101:   <xsl:template match="xhtml:script/@src">
                    102:     <xsl:attribute name="src">
                    103:       <xsl:value-of select="concat($kupu-common-dir, .)"/>
                    104:     </xsl:attribute>
                    105:   </xsl:template>
                    106:   
                    107:   <!--
                    108:     Content stuff.
                    109:   -->
                    110:   <xsl:template match="xhtml:title">
                    111:     <title>Apache Lenya | Edit <xsl:value-of select="$document-path"/> with Kupu </title>
                    112:   </xsl:template>
                    113:   
                    114:   <xsl:template match="xhtml:h1[1]">
                    115:     <div style="float:left; width: 50%; margin-left: 5px;">
                    116:       <h1 style="margin: 0; padding: 0;">Edit document</h1>
                    117:       <span 
                    118:         style="font-style: italic; font-size: 1.3em; letter-spacing: 1px; color: gray;">
                    119:         <xsl:value-of select="$document-path"/>
                    120:       </span>
                    121:     </div>
                    122:     <div style="display: inline; float: right;">
                    123:       <a href="http://kupu.oscom.org/" target="_blank">
                    124:         <img src="{$kupu-logo}" style="vertical-align: top; border: 0;" 
                    125:           alt="Kupu logo"/>
                    126:       </a>
                    127:       <a href="http://lenya.apache.org" target="_blank">
                    128:         <img src="{$lenya-logo}" 
                    129:           alt="Lenya project logo" style="border: 0;"/>
                    130:       </a>
                    131:     </div>
                    132:     <br clear="all"/>    
                    133:   </xsl:template>
                    134:   
                    135:   <xsl:template match="@*|node()">
                    136:     <xsl:copy>
                    137:       <xsl:apply-templates select="@*|node()"/>
                    138:     </xsl:copy>
                    139:   </xsl:template>
                    140:   
                    141: </xsl:stylesheet>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>