Subversion Repositories wimsdev

Rev

Rev 15246 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <p>
  2.   Each wims module has a private home directory in which go all the files
  3.   of this module.
  4. </p>
  5.  
  6. A module must have at least the following files:
  7. <ul>
  8.   <li>
  9.     $tit A variable definition file $emph var.def$emphend. $titend
  10.     This file defines $emph external$emphend variables of the module. A parameter given by the
  11.     user must have a name declared in this file, except parameter names reserved by
  12.     wims (cmd, session, module, ...). And exactly variables declared in this
  13.     file will be saved in the session directory (to be recalled at the next
  14.     request from the same session).
  15.   </li><li>
  16.     $tit A variable processing file $emph var.proc$emphend.$titend
  17.      This file is processed at EACH request of the module (except special
  18.      requests: when cmd=intro or getins).
  19.   </li><li>
  20.     $tit A main phtml file $emph main.phtml$emphend.$titend
  21.     This file will be processed at avery request to the module, except under
  22.     special commands (when cmd=intro or getins).
  23.   </li><li>
  24.     $tit An indexing file $emph INDEX$emphend, which defines the application's nature.$titend
  25.    This file will be used by wims database for searching available modules.
  26.  </li>
  27. </ul>
  28.  
  29. <p>And it may often contain the following (optional) files too:</p>
  30. <ul>
  31.  <li>
  32.    $tit A variable initialisation file $emph var.init$emphend.$titend
  33.    This file has the same syntax as the file $emph var.proc$emphend, and is processed
  34.    exactly at requests with cmd=new or cmd=renew.
  35.  </li><li>
  36.    $tit A introductory page $emph intro.phtml$emphend.$titend
  37.    This is a phtml file, which is processed when the module is
  38.    accessed with cmd=intro. It is usually used to introduce the content of the
  39.    module, and to let the user choose starting options.
  40.  </li>
  41. </ul>
  42.  
  43. <p>
  44.  There may be any number of other files, like a $emph README.md$emphend file, one or more
  45.  help pages, an $emph about$emphend page, one or more graphics files, files called by one
  46.  of the above mandatory or optional files, etc.
  47. </p>
  48.  
  49. <hr><h4>Variable processing files</h4>
  50. <p>
  51.  The files $emph var.init$emphend and $emph var.proc$emphend,
  52.  as well as any files called by these two
  53.  files, are variable processing files.
  54. </p><p>
  55.  A variable processing file is divided into lines, separated by
  56.  non-escaped new-line characters. A new-line character can be escaped by the
  57.  character $emph \$emphend, in which case it does not separate the two lines
  58.  before and after it.
  59. </p>
  60. Every line of a variable processing file must be one of the following:
  61. <ol>
  62.  <li>A comment line, whose first non-space character is either the character
  63.    $emph #$emphend, or $emph!$emphend followed by another $emph!$emphend.
  64.  </li>
  65.  <li>A variable definition line, in the form of
  66.    $emph name$emphend=$(emph)value$emphend. The content of
  67.    $(emph)value$emphend may be a string (if this string contains a new-line
  68.    character, it must be escaped by the character $emph \$emphend), or a wims
  69.    variable command (which must then start with the character $emph!$emphend).
  70.  </li>
  71.  <li>A command line, whose first non-space character is the character
  72.    $emph!$emphend, followed by the command name and optional parameters.
  73.    <br>If the command produces an output string, this output will be ignored.
  74.  </li>
  75.  <li>A label line, whose first non-space character is the character
  76.    $emph:$emphend, followed by the name of the label. Anything following the
  77.    label name will be considered as comment and ignored by the interpreter.
  78.    <br>Label is used in conjunction with the jumping command
  79.    $emph!goto$emphend.
  80.    <br>A label starting with the character '*' is catch-all, matching any
  81.    $emph!goto$emphend label.
  82.  </li>
  83.  <li>
  84.    Any line not fitting into one of the above 4 will generate a wims error
  85.    message.
  86.  </li>
  87. </ol>
  88.  
  89. <hr><h4>Phtml files</h4>
  90. <p>
  91.  The files main.phtml and intro.phtml, as well as any files called by these
  92.  two files, are phtml files (programmable html).
  93. </p><p>
  94.  A phtml file is an ordinary html file, except for lines whose
  95.  first non-space character is a $emph!$emphend or a $emph:$emphend.
  96. </p><p>
  97.  Lines can be escaped by $emph\$emphend, just as in the case of a variable
  98.  processing file.
  99. </p><p>
  100.  A line starting with $emph:$emphend is a label line, as in the case of a
  101.  variable processing file.
  102. </p><p>
  103.  A line starting with $emph!$emphend is a command line, as in the case of a
  104.  variable processing file. To the difference that if the command produces an
  105.  output string, this output will be inserted into the html page, at the place
  106.  of the line.
  107. </p><p>
  108.  Lines not of the above two types will be sent to the http client, after
  109.  substitution of variables.
  110. </p>
  111.