Subversion Repositories Applications.papyrus

Rev

Rev 448 | Blame | Last modification | View Log | RSS feed


OVERVIEW
~~~~~~~~

Show what is this message template thing and how does it work?
When the software was being redesigned the idea of using a template
engine (like Smarty, http://smarty.php.net) was considered but in the
end was turned down because it would probably just add extra work to
setup. Instead, a very simple system for displaying messages via a
template was designed. Whenever a message is about to be displayed
the template is loaded up and variable substitution occurs.


THE VARIABLES
~~~~~~~~~~~~~

<ezmlm-headers>
<ezmlm-header-name>: <ezmlm-header-value>
</ezmlm-headers>

The way the headers are displayed is in a loop. If you look at the
default template below you will notice that only one table row has
been defined. When the template is being parsed everything in between
the <ezmlm-headers></ezmlm-headers> tags is displayed for each header.
In each loop <ezmlm-header-name> is replaced with the name of the next
header and <ezmlm-header-value> is replaced with the value of the next
header.


<ezmlm-body>

This is replaced with the body of the message (which has been decoded
following RFC2045 specifications).


And that's it!


DEFAULT TEMPLATE
~~~~~~~~~~~~~~~~
<table width="98%" bgcolor="#ffffff" border=1 cellpadding=4 cellspacing=0>
 <tr>
  <td>
   <table width="100%" bgcolor="#eeeeee" border=0 cellpadding=0 cellspacing=0>
    <ezmlm-headers>
    <tr>
     <td nowrap width="10%" align=right valign=top>&nbsp;<b><ezmlm-header-name> :</b>&nbsp;</td>
     <td align=left valign=top><ezmlm-header-value></td>
    </tr>
    <tr>
     <td width="10%"></td>
     <td bgcolor="#cccccc"></td>
    </tr>
    </ezmlm-headers>
   </table>
  </td>
 </tr>
 <tr>
  <td>
   <ezmlm-body>
  </td>
 </tr>
</table>