|
|
What this is
This file is included in the DevDaily.com
"Java Source Code
Warehouse" project. The intent of this project is to help you "Learn
Java by Example" TM.
Other links
The source code
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
* Copyright (C) 2000 Sebastian Schaffert
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes"/>
<xsl:variable name="imgbase" select="/USERMODEL/STATEDATA/VAR[@name='img base uri']/@value"/>
<xsl:variable name="base" select="/USERMODEL/STATEDATA/VAR[@name='base uri']/@value"/>
<xsl:variable name="session-id" select="/USERMODEL/STATEDATA/VAR[@name='session id']/@value"/>
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>WebMail Casilla de correo para : Message List (Folder
<META CONTENT="AUTHOR" VALUE="Sebastian Schaffert"/>
</HEAD>
<BODY bgcolor="#ffffff">
<xsl:variable name="current" select="/USERMODEL/CURRENT[@type='folder']/@id"/>
<xsl:apply-templates select="/USERMODEL/MAILHOST_MODEL//FOLDER[@id=$current]"/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="FOLDER">
Mostrando mensajes <xsl:value-of select="/USERMODEL/CURRENT[@type='folder']/@first_msg"/>
to <xsl:value-of select="/USERMODEL/CURRENT[@type='folder']/@last_msg"/>
in folder <xsl:value-of select="@name"/> (Ayuda).
</H3> Banderas del mensaje: message with attachment
<IMG SRC="{$imgbase}/images/icon-new.gif" BORDER="0"/> new message
<IMG SRC="{$imgbase}/images/icon-seen.gif" BORDER="0"/> message seen
<IMG SRC="{$imgbase}/images/icon-answered.gif" BORDER="0"/> message answered
<IMG SRC="{$imgbase}/images/icon-deleted.gif" BORDER="0"/> message deleted
<HR/>
<xsl:template match="MESSAGELIST">
<FORM ACTION="{$base}/folder/list?flag=1&session-id={$session-id}&folder-id={../@id}&part={/USERMODEL/CURRENT[@type='folder']/@list_part}" METHOD="POST">
<TABLE WIDTH="100%" BORDER="0">
<TR>
<TD WIDTH="3%" BGCOLOR="#dddddd">
<xsl:text disable-output-escaping="yes">
</TD>
<TD WIDTH="3%" BGCOLOR="#dddddd">
<STRONG>Nr
</TD>
<TD WIDTH="5%" BGCOLOR="#dddddd">
<STRONG>Banderas
</TD>
<TD WIDTH="35%" BGCOLOR="#dddddd">
<STRONG>Asunto
</TD>
<TD WIDTH="24%" BGCOLOR="#dddddd">
<STRONG>Remitente
</TD>
<TD WIDTH="24%" BGCOLOR="#dddddd">
<STRONG>Fecha
</TD>
<TD WIDTH="6%" BGCOLOR="#dddddd">
<STRONG>Tamaño
</TD>
</TR>
<xsl:for-each select="MESSAGE[number(@msgnr) >= number(/USERMODEL/CURRENT[@type='folder']/@first_msg) and number(@msgnr) <= number(/USERMODEL/CURRENT[@type='folder']/@last_msg)]">
<xsl:sort select="@msgnr" data-type="number" order="descending"/>
<!--
<xsl:variable name="bgcolor" select="#ffffff"/>
-->
<xsl:choose>
<xsl:when test="@msgnr mod 2 = 1">
<TR bgcolor="#f7f3a8">
<xsl:call-template name="headerrow"/>
</TR>
</xsl:when>
<xsl:otherwise>
<TR>
<xsl:call-template name="headerrow"/>
</TR>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</TABLE>
<TABLE WIDTH="100%" BGCOLOR="#dddddd" CELLSPACING="0" BORDER="0">
<TR>
<FONT SIZE="-1">
<TD>
<SELECT NAME="MARK">
<OPTION VALUE="MARK">colocar*
<OPTION VALUE="UNMARK">borrar
</SELECT>
<STRONG>bandera del mensaje
<SELECT NAME="MESSAGE FLAG">
<OPTION VALUE="DELETED">borrado
<OPTION VALUE="SEEN">visto
<OPTION VALUE="ANSWERED">respondido
<OPTION VALUE="RECENT">reciente
<OPTION VALUE="DRAFT">borrador
</SELECT>
<INPUT TYPE="SUBMIT" NAME="flagmsgs" VALUE="Perform!"/>
</TD>
<TD>
<SELECT NAME="COPYMOVE">
<OPTION VALUE="COPY">copiar
<OPTION VALUE="MOVE">mover
</SELECT>
<STRONG>mensajes a la carpeta
<SELECT NAME="TO">
<xsl:for-each select="/USERMODEL/MAILHOST_MODEL//FOLDER">
<OPTION value="{@id}">
<xsl:value-of select="@name"/>
</OPTION>
</xsl:for-each>
</SELECT>
<INPUT TYPE="SUBMIT" NAME="copymovemsgs" VALUE="Perform!"/>
</TD>
</FONT>
</TR>
</TABLE>
</FORM>
</xsl:template>
<xsl:template name="navigation">
<P>
<TABLE WIDTH="100%">
<TR>
<TD ALIGN="left" VALIGN="center">
<EM>
<xsl:choose>
<xsl:when test="number(/USERMODEL/CURRENT[@type='folder']/@first_msg) > number(1)">
<A HREF="{$base}/folder/list?session-id={$session-id}&folder-id={@id}&part={/USERMODEL/CURRENT[@type='folder']/@list_part + 1}"> Previous messages
</xsl:when>
<xsl:otherwise> Previous messages
</xsl:otherwise>
</xsl:choose>
</EM>
</TD>
<TD ALIGN="right" VALIGN="center">
<EM>
<xsl:choose>
<xsl:when test="number(/USERMODEL/CURRENT[@type='folder']/@list_part) > number(1)">
<A HREF="{$base}/folder/list?session-id={$session-id}&folder-id={@id}&part={/USERMODEL/CURRENT[@type='folder']/@list_part - 1}">Siguiente messages
</xsl:when>
<xsl:otherwise>
Siguiente <xsl:value-of select="/USERMODEL/USERDATA/INTVAR[@name='max show messages']/@value"/> messages
</xsl:otherwise>
</xsl:choose>
</EM>
</TD>
</TR>
</TABLE>
</P>
</xsl:template>
<xsl:template name="headerrow">
<TD>
<INPUT TYPE="checkbox" NAME="CH%{@msgnr}"/>
</TD>
<TD>
<xsl:value-of select="@msgnr"/>
</TD>
<TD>
<xsl:if test="@attachment='true'">
<IMG SRC="{$imgbase}/images/icon-attachment.gif" BORDER="0"/>
</xsl:if>
<xsl:if test="@recent='true'">
<IMG SRC="{$imgbase}/images/icon-new.gif" BORDER="0"/>
</xsl:if>
<xsl:if test="@seen='true'">
<IMG SRC="{$imgbase}/images/icon-seen.gif" BORDER="0"/>
</xsl:if>
<xsl:if test="@answered='true'">
<IMG SRC="{$imgbase}/images/icon-answered.gif" BORDER="0"/>
</xsl:if>
<xsl:if test="@deleted='true'">
<IMG SRC="{$imgbase}/images/icon-deleted.gif" BORDER="0"/>
</xsl:if>
</TD>
<TD>
<A HREF="{$base}/folder/showmsg?session-id={$session-id}&folder-id={/USERMODEL/CURRENT[@type='folder']/@id}&message-nr={@msgnr}">
<xsl:apply-templates select="HEADER/SUBJECT"/>
</A>
</TD>
<TD>
<xsl:apply-templates select="HEADER/FROM"/>
</TD>
<TD>
<xsl:apply-templates select="HEADER/DATE"/>
</TD>
<TD>
<FONT SIZE="-1">
<xsl:value-of select="@size"/>
</FONT>
</TD>
</xsl:template>
<xsl:template match="DATE">
<FONT SIZE="-1">
<xsl:value-of select="."/>
</FONT>
</xsl:template>
<xsl:template match="SUBJECT">
<FONT SIZE="-1">
<xsl:value-of select="."/>
</FONT>
</xsl:template>
<xsl:template match="FROM">
<FONT SIZE="-1">
<xsl:choose>
<xsl:when test="contains(.,'<')">
<xsl:value-of select="substring-before(.,'<')"/>
<BR/>
<STRONG>CorreoE:
<xsl:value-of select="substring-before(substring-after(.,'<'),'>')"/>
</xsl:when>
<xsl:otherwise>
<BR/>
<STRONG>CorreoE:
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</FONT>
</xsl:template>
</xsl:stylesheet>
|