Branch: Tag:

2000-02-06

2000-02-06 11:55:18 by Martin Nilsson <mani@lysator.liu.se>

Changed if-caller to plugin. Moved documentation to bottom. CVS appears to have a very bad grasp on the concept of moved text.

Rev: server/modules/tags/rxmltags.pike:1.58

7:   #define _rettext id->misc->defines[" _rettext"]   #define _ok id->misc->defines[" _ok"]    - constant cvs_version="$Id: rxmltags.pike,v 1.57 2000/02/03 15:10:42 wellhard Exp $"; + constant cvs_version="$Id: rxmltags.pike,v 1.58 2000/02/06 11:55:18 nilsson Exp $";   constant thread_safe=1;   constant language = roxen->language;   
39:    return "modified";   }    - TAGDOCUMENTATION; - #ifdef manual - constant tagdoc=(["roxen_automatic_charset_variable":#"<desc tag> -  Internal Roxen tag. Not yet documented. - </desc>", -  - "aconf":#"<desc cont> -  Creates a link that can modify the persistent states in the cookie -  RoxenConfig. - </desc> -  - <attr name=href value=uri> -  Indicates which page should be linked to, if any other than the -  present one. - </attr> -  - <attr name=add value=string> -  The \"cookie\" or \"cookies\" that should be added, in a comma -  seperated list. - </attr> -  - <attr name=drop value=string> -  The \"cookie\" or \"cookies\" that should be droped, in a comma -  seperated list. - </attr> -  - <attr name=class value=string> -  This CSS class definition will apply to the a-element. - </attr> -  <p>All other attributes will be inherited by the generated a tag.</p>", -  - "append":#"<desc tag> -  Appends a value to a variable. The variable attribute and one more is -  required. - </desc> -  - <attr name=variable value=string> -  The name of the variable. - </attr> -  - <attr name=value value=string> -  The value the variable should have appended. - </attr> -  - </attr name=from value=string> -  The name of another variable that the value should be copied from. - </attr> -  - <attr name=other value=string> -  The name of a id->misc->variables that the value should be copied from. - </attr>", -  - "apre":#"<desc cont> -  Creates a link that can modify prestates. - </desc> -  - <attr name=href value=uri> -  Indicates which page should be linked to, if any other than the -  present one. - </attr> -  - <attr name=add value=string> -  The prestate or prestates that should be added, in a comma seperated list. - </attr> -  - <attr name=drop value=string> -  The prestate or prestates that should be droped, in a comma seperated -  list. - </attr> -  - <attr name=class value=string> -  This CSS class definition will apply to the a-element. - </attr> -  -  Adds or removes a prestate option. Prestate options are simple -  toggles, and are added to the URL of the page. Use <tag>if</tag> -  prestate=...<tag>/if</tag> to test for the presence of a prestate. -  <tag>apre</tag> works just like the <tag>a href=...</tag> container, -  but if no \"href\" attribute is specified, the current page is used.", -  - "auth-required":#"<desc tag> -  Adds an HTTP auth required header and return code (401), that will force -  the user to supply a login name and password. This tag is needed when -  using access control in RXML in order for the user to be prompted to -  login. - </desc> -  - <attr name=realm value=string> -  The realm you are logging on to, i.e \"Intranet foo\". - </attr> -  - <attr name=message value=string> -  Returns a message if a login failed or cancelled. - </attr>", -  - "autoformat":#"<desc cont> -  Replaces newlines with <tag>br</tag>:s. - </desc> -  - <attr name=nobr> -  Do not replace newlines with <tag>br</tag>:s. - </attr> -  - <attr name=p> -  Replace double newlines with <tag>p</tag>:s. - </attr> -  - <attr name=class value=string> -  This CSS definition will be applied on the p elements. - </attr>", -  - "cache":#"<desc cont> -  This simple tag RXML parse its contents and cache them using the -  normal Roxen memory cache. They key used to store the cached contents -  is the MD5 hash sum of the contents, the accessed file name, the -  query string, the server URL and the authentication information, if -  available. This should create an unique key. - </desc> -  - <attr name=key value=string> -  Append this value to the hash used to identify the contents for less -  risk of incorrect caching. This shouldn't really be needed. - </attr>", -  - "catch":#"<desc cont> -  Evaluates the RXML code, and, if nothing goes wrong, returns the -  parsed contents. If something does go wrong, the error message is -  returned instead. See also <tag><ref type=tag>throw</ref></tag>. - </desc>", -  - "configimage":#"<desc tag> -  Returns one of the configuration images. The src attribute is required. - </desc> -  - <attr name=src value=string> -  The name of the picture to show. - </attr> -  - <attr name=border value=number> -  The image border when used as a link. Default is 0. - </attr> -  - <attr name=alt value=string> -  The picture description. Default is the src string. - </attr> -  - <attr name=class value=string> -  This CSS class definition will be applied to the image. - </attr> -  All other attributes will be inherited by the generated img tag.", -  - "configurl":#"<desc tag> -  Returns a URL to the configuration interface. - </desc>", -  - "cset":#"<desc cont></desc>", -  - "crypt":#"<desc cont> -  Encrypts the contents as a Unix style password. Useful when combined -  with services that use such passwords. <p>Unix style passwords are -  one-way encrypted, to prevent the actual clear-text password from -  being stored anywhere. When a login attempt is made, the password -  supplied is also encrypted and then compared to the stored encrypted -  password.</p> - </desc>", -  - "date":#"<desc tag> -  Inserts the time and date. Does not require attributes. - </desc> -  - <attr name=unix-time value=number> -  Display this time instead of the current. - </attr> -  - <attr name=years value=number> -  Add this number of years to the result. - </attr> -  - <attr name=months value=number> -  Add this number of months to the result. - </attr> -  - <attr name=weeks value=number> -  Add this number of weeks to the result. - </attr> -  - <attr name=days value=number> -  Add this number of days to the result. - </attr> -  - <attr name=hours value=number> -  Add this number of hours to the result. - </attr> -  - <attr name=beats value=number> -  Add this number of beats to the result. - </attr> -  - <attr name=minutes value=number> -  Add this number of minutes to the result. - </attr> -  - <attr name=seconds value=number> -  Add this number of seconds to the result. - </attr> -  - <attr name=adjust value=number> -  Add this number of seconds to the result. - </attr> -  - <attr name=brief> -  Show in brief format. - </attr> -  - <attr name=time> -  Show only time. - </attr> -  - <attr name=date> -  Show only date. - </attr> -  - <attr name=type value=string,ordered,iso,discordian,stardate,number> -  Defines in which format the date should be displayed in. - </attr> -  - <attr name=part value=year,month,day,wday,date,mday,hour,minute,second,yday,beat,week,seconds> -  Defines which part of the date should be displayed. Day and wday is -  the same. Date and mday is the same. Yday is the day number of the -  year. Seconds is unix time type. Only the types string, number and -  ordered applies when the part attribute is used. - </attr> -  - <attr name=lang value=language_code> -  Defines in what language the a string will be presented in. - </attr> -  - <attr name=case value=upper,lower,capitalized> -  Changes the case of the output to upper, lower or capitalized. - </attr> -  - <attr name=prec value=number> -  The number of decimals in the stardate. - </attr>", -  - "debug":#"<desc tag> -  Helps debugging RXML-pages as well as modules. When debugging mode is -  turned on, all error messages will be displayed in the HTML code. - </desc> -  - <attr name=on> -  Turns debug mode on. - </attr> -  - <attr name=off> -  Turns debug mode off. - </attr> -  - <attr name=toggle> -  Toggles debug mode. - </attr> -  - <attr name=showid value=string> -  Shows a part of the id object. E.g. showid=\"id->request_headers\". - </attr>", -  - "dec":#"<desc tag> -  Subtracts 1 from a variable. Attribute variable is required. - </desc> -  - <attr name=variable value=string> -  The variable to be decremented. - </attr>", -  - "default":#"<desc cont> -  -  Makes it easier to give default values to \"<tag>select</tag>\" or -  \"<tag>checkbox</tag>\" form elements. -  -  <p>The <tag>default</tag> container tag is placed around the form element it -  should give a default value.</p> -  -  <p>This tag is particularly useful in combination with database tags.</p> - </desc> -  - <attr name=value value=string> -  The value to set. - </attr> -  - <attr name=separator value=string> -  - </attr> -  - <attr name=name value=string> -  Only affect form element with this name. - </attr> -  - <attr name=variable value=string> -  - </attr>", -  - "doc":#"<desc cont> -  Eases documentation by replacing \"{\", \"}\" and \"&\" with \"<\", \">\" and -  \"&\". No attributes required. - </desc> -  - <attr name=quote> -  Instead of replacing \"{\" and \"}\", \"<\" and \">\" is replaced with \"&amp;lt;\" -  and \"&amp;gt;\". - </attr> -  - <attr name=pre> -  The result is encapsulated within a <tag>pre</tag> container. - </attr> -  - <attr name=class value=string> -  This CSS definition will be applied on the pre element. - </attr>", -  - "expire-time":#"<desc tag> -  Sets cache expire time for this document. Default bla bla. - </desc> -  - <attr name=now> -  The document expires now. - </attr> -  - <attr name=years value=number> -  Add this number of years to the result. - </attr> -  - <attr name=months value=number> -  Add this number of months to the result. - </attr> -  - <attr name=weeks value=number> -  Add this number of weeks to the result. - </attr> -  - <attr name=days value=number> -  Add this number of days to the result. - </attr> -  - <attr name=hours value=number> -  Add this number of hours to the result. - </attr> -  - <attr name=beats value=number> -  Add this number of beats to the result. - </attr> -  - <attr name=minutes value=number> -  Add this number of minutes to the result. - </attr> -  - <attr name=seconds value=number> -  Add this number of seconds to the result. - </attr> -  It is not possible at the time to set the date beyond year 2038, -  since a unix time_t is used.", -  - "for":#"<desc cont> -  Makes it possible to create loops in RXML. - </desc> -  - <attr name=from value=number> -  Initial value of the loop variable. - </attr> -  - <attr name=step value=number> -  How much to increment the variable per loop iteration. By default one. - </attr> -  - <attr name=to value=number> -  How much the loop variable should be incremented to. - </attr> -  - <attr name=variable value=name> -  Name of the loop variable. - </attr>", -  - "foreach":#"<desc cont> -  - </desc> -  - <attr name=variable> -  - </attr> -  - <attr name=variables> -  - </attr> -  - <attr name=in> -  - </attr>", -  - "formoutput":#"<desc cont></desc>", -  - "fsize":#"<desc tag> -  - </desc> -  - <attr name=file value=string> -  - </attr>", -  - "gauge":#"<desc cont> -  Measures how much CPU time it takes to run its contents through the -  RXML parser. Returns the number of seconds it took to parse the -  contents. - </desc> -  - <attr name=define value=string> -  The result will be put into a variable. E.g. define=var.gauge vill -  put the result in a variable that can be reached with &var.gauge;. - </attr> -  - <attr name=silent> -  Don't print anything. - </attr> -  - <attr name=timeonly> -  Only print the time. - </attr> -  - <attr name=resultonly> -  Only the result of the parsing. Useful if you want to put the time in -  a database or such. - </attr>", -  - "header":#"<desc tag> -  Adds a header to this document. - </desc> -  - <attr name=name value=string> -  The name of the header. - </attr> -  - <attr name=value value=string> -  The value of the header. - </attr> -  See the Appendix for a list of HTTP headers.", -  - "imgs":#"<desc tag> -  Generates a image tag with proper dimensions. Attribute src is required. - </desc> -  - <attr name=src value=string> -  The name of the file that should be shown. - </attr> -  - <attr name=alt value=string> -  Description of the image. Default is the image file name. - </attr> -  All other attributes will be inherited by the generated img tag.", -  - "inc":#"<desc tag> -  Adds 1 to a variable. Attribute variable is required. - </desc> -  - <attr name=variable value=string> -  The variable to be incremented. - </attr>", -  - "insert":#"<desc tag> -  Inserts a file, variable or other object into a webpage. -  One attribute is required. - </desc> -  - <attr name=variable value=string> -  Inserts the value of that variable. - </attr> -  - <attr name=variables> -  Inserts a variable listing. - </attr> -  - <attr name=cookies> -  Inserts a cookie listing. - </attr> -  - <attr name=cookie value=string> -  Inserts the value of that cookie. - </attr> -  - <attr name=file value=string> -  Inserts the contents of that file. - </attr> -  - <attr name=href value=string> -  Inserts the contents at that URL. - </attr> -  - <attr name=other value=string> -  Inserts a misc variable (id->misc->variables). - </attr> -  - <attr name=quote value=html,none> -  How the inserted data should be quoted. Default is \"html\", except for -  href and file where it's \"none\". - </attr>", -  - "maketag":#"<desc cont> -  This tag creates tags. The contents of the container will be put into -  the contents of the produced container. Requires the name attribute. - </desc> -  - <attr name=name value=string> -  The name of the tag. - </attr> -  - <attr name=noxml> -  Tags should not be terminated with a trailing slash. - </attr> -  - <attr name=type value=tag,container> -  What kind of tag should be produced. Default is tag. - </attr> -  Inside the maketag container the container attrib is defined. It is -  used to add attributes to the produced tag. It has the required -  attribute attrib, which is the name of the attribute. The contents of -  the attribute container will be the attribute value. E.g. -  -  <p>&lt;maketag name=replace type=container&gt; -  &lt;attrib name=from&gt;A&lt;/attrib&gt; -  &lt;attrib name=to&gt;U&lt;/attrib&gt; -  MAD -  &lt;/maketag&gt; -  -  will result in -  -  &lt;replace from=A to=U&gt;MAD&lt;/replace&gt; -  &lt;/pre&gt;</p>", -  - "modified":#"<desc tag> -  Prints when or by whom a page was last modified, by default the current page. - </desc> -  - <attr name=by> -  Print by whom the page was modified. Takes the same attributes as the -  <tag><ref type=tag>user</ref></tag> tag. This attribute requires a -  userdatabase. - </attr> -  - <attr name=date> -  Print the modification date. Takes all the date attributes in the -  <tag><ref type=tag>date</ref></tag> tag. - </attr> -  - <attr name=file value=path> -  Get information from this file rather than the current page. - </attr> -  - <attr name=realfile value=path> -  Get information from this file in the computers filesystem rather -  than Roxen Webserver's virtual filesystem. - </attr>", -  - "quote":#"<desc tag></desc> -  - <attr name=start value=character> -  Set the end quote character. - </attr> -  - <attr name=end value=character> -  Set the start quote character. - </attr> -  -  Warning: This function is not thread-safe, and might behave -  unexpectedly when used in a threaded roxen on several different -  pages, using several different quote characters. The only safe use is -  to use a standard begin and endquote, start=\"[\" end=\"]\", as an -  example, please note that you have to quote the quote characters, -  since utter caos would be the result the second time you use this tag -  otherwise. Consider:<p> -  -  <tag>quote start=[ end=]</tag> -  <tag>quote start=[ end=]</tag> -  <p> -  <p>The second time this code is run, the starting quote character would -  be set to \" \".</p>", -  -  - "random":#"<desc cont> -  Randomly chooses a message from its contents. - </desc> -  - <attr name=separator value=string> -  The separator used to separate the messages, by default newline. - </attr>", -  - "recursive-output":#"<desc cont> -  - </desc> -  - <attr name=limit value=number> -  - </attr> -  - <attr name=inside value=string> -  - </attr> -  - <attr name=outside value=string> -  - </attr> -  - <attr name=separator value=string> -  - </attr>", -  - "redirect":#"<desc tag> -  Redirects the user to another page. Requires the to attribute. - </desc> -  - <attr name=to value=string> -  Where the user should be sent to. - </attr> -  - <attr name=add value=string> -  The prestate or prestates that should be added, in a comma seperated -  list. - </attr> -  - <attr name=drop value=string> -  The prestate or prestates that should be dropped, in a comma seperated -  list. - </attr> -  - <attr name=text value=string> -  Sends a text string to the browser, that hints from where and why the -  page was redirected. Not all browsers will show this string. Only -  special clients like Telnet uses it. - </attr> -  Arguments prefixed with \"add\" or \"drop\" are treated as prestate -  toggles, which are added or removed, respectively, from the current -  set of prestates in the URL in the redirect header (see also <tag -  <ref type=tag>apre</ref></tag>). Note that this only works when the -  to=... URL is absolute, i.e. begins with a \"/\", otherwise these -  state toggles have no effect.", -  - "remove-cookie":#"<desc tag> -  Removes a cookie. - </desc> -  - <attr name=name> -  Name of the cookie to remove. - </attr> -  - <attr name=value value=text> -  Even though the cookie has been marked as expired some browsers -  will not remove the cookie until it is shut down. The text provided -  with this attribute will be the cookies intemediate value. - </attr> -  - Note that removing a cookie won't take effect until the next page - load.", -  - "repeat":#"<desc cont> -  Repeats the contents until a <tag>leave</tag> tag has been found. -  Requires no attributes. - </desc> -  - <attr name=maxloops> -  The maximum number of loops. Default is 10000. - </attr>", -  - "replace":#"<desc cont> -  Replaces strings in the contents with other strings. Requires the -  from attribute. - </desc> -  - <attr name=from value=string> -  String or list of strings that should be replaced. - </attr> -  - <attr name=to value=string> -  String or list of strings with the replacement strings. Default is the -  empty string. - </attr> -  - <attr name=separator value=string> -  Defines what string should seperate the strings in the from and to -  attributes. Default is \",\". - </attr> -  - <attr name=type value=word,words> -  Word means that a single string should be replaced. Words that from -  and to are lists. Default is word. - </attr>", -  - "return":#"<desc tag> -  Changes the HTTP return code for this page. -  -  See the Appendix for a list of HTTP return codes. - </desc> -  - <attr name=code> -  The return code to set. - </attr>", -  - "roxen":#"<desc tag> -  Returns a nice Roxen logo. - </desc> -  - <attr name=size value=small,medium,large> -  Defines the size of the image. Default is small. - </attr> -  - <attr name=color value=blue,green,purple,brown> -  Defines the color of the image. Default is blue. - </attr> -  - <attr name=alt value=string> -  The image description. Default is \"Powered by Roxen\". - </attr> -  - <attr name=border value=number> -  The image border. Default is 0. - </attr> -  - <attr name=class value=string> -  This CSS definition will be applied on the img element. - </attr> -  All other attributes will be inherited by the generated img tag.", -  - "scope":#"<desc cont> -  Creates a different variable scope. Variable changes inside the scope -  container will not affect variables in the rest of the page. -  Variables set outside the scope is not available inside the scope -  unless the extend attribute is used. No attributes are required. - </desc> -  - <attr name=extend> -  If set, all variables will be copied into the scope. - </attr>", -  - "set":#"<desc tag> - Sets a variable. The variable attribute is required. - </desc> -  - <attr name=variable value=string> -  The name of the variable. - </attr> -  - <attr name=value value=string> -  The value the variable should have. - </attr> -  - <attr name=expr value=string> -  An expression whose evaluated value the variable should have. - </attr> -  - <attr name=from value=string> -  The name of another variable that the value should be copied from. - </attr> -  - <attr name=other value=string> -  The name of a id->misc->variables that the value should be copied from. - </attr> -  - <attr name=eval value=string> -  An RXML expression whose evaluated value the variable should have. - </attr> -  -  If none of the above attributes are specified, the variable is unset. -  If debug is currently on, more specific debug information is provided -  if the operation failed. See also: <tag><ref type=tag>append</ref></tag> -  and <tag><ref type=tag>debug</ref></tag>", -  - "set-cookie":#"<desc tag> -  Sets a cookie that will be stored by the user's browser. This is a -  simple and effective way of storing data that is local to the user. -  The cookie will be persistent, the next time the user visits the -  site, she will bring the cookie with her. - </desc> -  - <attr name=name value=string> -  The name of the cookie. - </attr> -  - <attr name=seconds value=number> -  Add this number of seconds to the time the cookie is kept. - </attr> -  - <attr name=minutes value=number> -  Add this number of minutes to the time the cookie is kept. - </attr> -  - <attr name=hours value=number> -  Add this number of hours to the time the cookie is kept. - </attr> -  - <attr name=days value=number> -  Add this number of days to the time the cookie is kept. - </attr> -  - <attr name=weeks value=number> -  Add this number of weeks to the time the cookie is kept. - </attr> -  - <attr name=months value=number> -  Add this number of months to the time the cookie is kept. - </attr> -  - <attr name=years value=number> -  Add this number of years to the time the cookie is kept. - </attr> -  - <attr name=persistent> -  Keep the cookie for two years. - </attr> -  - <attr name=value value=string> -  The value the cookie will be set to. - </attr> -  - <attr name=path value=string> - Adds a cookie named \"name\" with the value \"value\". - </attr> -  -  If persistent is specified; the cookie will be persistent until year -  2038, otherwise, the specified delays are used, just as for -  <tag><ref type=tag>expire-time</ref></tag>. -  -  Note that the change of a cookie will not take effect until the -  next page load.", -  - "set-max-cache":#"<desc tag> -  Set the maximum time this document can be cached in any ram caches. -  -  <p>Default is to get this time from the other tags in the document -  (as an example, <tag>if supports=...</tag> sets the time to 0 seconds since -  the result of the test depends on the client used.</p> -  -  <p>You must do this at the end of the document, since many of the -  normal tags will override this value.</p> - </desc> -  - <attr name=time value=number of seconds> -  Add this number of seconds to the time this page was last loaded. - </attr>", -  - "smallcaps":#"<desc cont> -  This tag prints the contents in smallcaps. If the size attribute is -  given, font tags will be used, otherwise big and small tags will be -  used. - </desc> -  - <attr name=space> -  Put a space between every character. - </attr> -  - <attr name=class value=string> -  Apply this CSS style on all elements. - </attr> -  - <attr name=smallclass value=string> -  Apply this CSS style on all small elements. - </attr> -  - <attr name=bigclass value=string> -  Apply this CSS style on all big elements. - </attr> -  - <attr name=size value=number> -  Use font tags, and this number as big size. - </attr> -  - <attr name=small value=number> -  Size of the small tags. Only applies when size is specified. Default -  is size-1. - </attr>", -  - "sort":#"<desc cont> -  Sorts the contents. No attributes required. - </desc> -  - <attr name=separator value=string> -  Defines what the strings to be sorted are separated with. - </attr> -  - <attr name=reverse> -  Reversed order sort. - </attr>", -  - "throw":#"<desc cont> -  Throws an exception, with the enclosed text as the error message. -  This tag has a close relation to <tag>catch</tag>. The RXML parsing -  will stop at the <tag>throw</tag> tag. - </desc>", -  - "trimlines":#"<desc cont> -  This tag removes all empty lines from the contents. - </desc>", -  - "unset":#" - <desc tag> -  Unsets a variable, i.e. removes it. The variable attribute is required. - </desc> -  - <attr name=variable value=string> -  The name of the variable. - </attr>", -  - "user":#"<desc tag> -  Prints information about the specified user. By default, the full -  name of the user and her e-mail address will be printed, with a -  mailto link and link to the home page of that user. -  -  The <tag>user</tag> tag requires an authentication module to work. - </desc> -  - <attr name=email> -  Only print the e-mail address of the user, with no link. - </attr> -  - <attr name=link> -  Include links. Only meaningful together with the realname or email attribute. - </attr> -  - <attr name=name> -  The login name of the user. - </attr> -  - <attr name=nolink> -  Don't include the links. - </attr> -  - <attr name=realname> -  Only print the full name of the user, with no link. - </attr>", -  ]); - #endif -  +    constant permitted = "123456789.xabcdefint\"XABCDEFlo<>=0-*+/%%|()"/"";      string sexpr_eval(string what)
1016:   }      class Entity_page_scope { -  string rxml_var_eval(RXML.Context c) { return sprintf("%O", c->current_scope() ); } +  string rxml_var_eval(RXML.Context c) { return c->current_scope(); }   }      class Entity_page_filesize {
1309:    }   }    - string tag_quote(string tagname, mapping m) - { - #if efun(set_start_quote) -  if(m->start && strlen(m->start)) -  set_start_quote(m->start[0]); -  if(m->end && strlen(m->end)) -  set_end_quote(m->end[0]); - #endif -  return ""; - } -  +    class TagInc {    inherit RXML.Tag;    constant name = "inc";
1354:    }   }    - string inc(mapping m, RequestID id) + private string inc(mapping m, RequestID id)   {    RXML.Context context=RXML.get_context();    array entity=context->parse_user_var(m->variable, m->scope);
1364:    return 0;   }    - string dec(mapping m, RequestID id) + private string dec(mapping m, RequestID id)   {    m->value=-(int)m->value||-1;    return inc(m, id);
1454:    constant flags=0;    class Frame {    inherit RXML.Frame; -  constant space=({115, 156, 164, 153, 156, 155, 87, 170, 169, 154, 116, 89, -  159, 171, 171, 167, 113, 102, 102, 174, 174, 174, 101, 169, -  166, 175, 156, 165, 101, 154, 166, 164, 102, 156, 158, 158, -  102, 171, 172, 165, 156, 101, 164, 160, 155, 89, " width=\"0\" height=\"0\"", -  117, 115, 102, 156, 164, 153, 156, 155, 117}); +  constant space=({147, 188, 196, 185, 188, 187, 119, 202, 201, 186, 148, 121, 191, 203, +  203, 199, 145, 134, 134, 206, 206, 206, 133, 201, 198, 207, 188, 197, +  133, 186, 198, 196, 134, 188, 190, 190, 134, 138, 133, 196, 192, 187, +  121, 119, 191, 192, 187, 187, 188, 197, 148, 121, 203, 201, 204, 188, +  121, 119, 184, 204, 203, 198, 202, 203, 184, 201, 203, 148, 121, 203, +  201, 204, 188, 121, 119, 195, 198, 198, 199, 148, 121, 203, 201, 204, +  188, 121, 149});    array do_return(RequestID id) {    result=Array.map(space, lambda(int|string c) { -  return intp(c)?(string)({c-(sizeof(space)-is_RXML_Frame)}):c; +  return intp(c)?(string)({c-(sizeof(space))}):c;    } )*"";    }    }
2142:    contents = parse_rxml( contents, id );    t = gethrtime()-t;    -  if(args->define) RXML.get_context()->user_set_var(args->define, t/1000000.0, args->scope); +  if(args->variable) RXML.get_context()->user_set_var(args->variable, t/1000000.0, args->scope);    if(args->silent) return ({ "" });    if(args->timeonly) return ({ sprintf("%3.6f", t/1000000.0) });    if(args->resultonly) return ({contents});
2361:    return ({ "" });   }    +    // ----------------- If registration stuff --------------    - mapping query_if_callers() - { -  return ([ -  "expr":lambda( string q){ return (int)sexpr_eval(q); } -  ]); + class TagIfexpr { +  inherit RXML.Tag; +  constant plugin_name = "expr"; +  int `() (string u) { +  return (int)sexpr_eval(u);    } -  + }    -  +    // ---------------- API registration stuff ---------------      string api_query_modified(RequestID id, string f, int|void by)
2377:    mapping m = ([ "by":by, "file":f ]);    return tag_modified("modified", m, id, id);   } +  + // --------------------- Documentation ----------------------- +  + TAGDOCUMENTATION; + #ifdef manual + constant tagdoc=(["roxen_automatic_charset_variable":#"<desc tag> +  Internal Roxen tag. Not yet documented. + </desc>", +  + "aconf":#"<desc cont> +  Creates a link that can modify the persistent states in the cookie +  RoxenConfig. + </desc> +  + <attr name=href value=uri> +  Indicates which page should be linked to, if any other than the +  present one. + </attr> +  + <attr name=add value=string> +  The \"cookie\" or \"cookies\" that should be added, in a comma +  seperated list. + </attr> +  + <attr name=drop value=string> +  The \"cookie\" or \"cookies\" that should be droped, in a comma +  seperated list. + </attr> +  + <attr name=class value=string> +  This CSS class definition will apply to the a-element. + </attr> +  <p>All other attributes will be inherited by the generated a tag.</p>", +  + "append":#"<desc tag> +  Appends a value to a variable. The variable attribute and one more is +  required. + </desc> +  + <attr name=variable value=string> +  The name of the variable. + </attr> +  + <attr name=value value=string> +  The value the variable should have appended. + </attr> +  + </attr name=from value=string> +  The name of another variable that the value should be copied from. + </attr> +  + <attr name=other value=string> +  The name of a id->misc->variables that the value should be copied from. + </attr>", +  + "apre":#"<desc cont> +  Creates a link that can modify prestates. + </desc> +  + <attr name=href value=uri> +  Indicates which page should be linked to, if any other than the +  present one. + </attr> +  + <attr name=add value=string> +  The prestate or prestates that should be added, in a comma seperated list. + </attr> +  + <attr name=drop value=string> +  The prestate or prestates that should be droped, in a comma seperated +  list. + </attr> +  + <attr name=class value=string> +  This CSS class definition will apply to the a-element. + </attr> +  +  Adds or removes a prestate option. Prestate options are simple +  toggles, and are added to the URL of the page. Use <tag>if</tag> +  prestate=...<tag>/if</tag> to test for the presence of a prestate. +  <tag>apre</tag> works just like the <tag>a href=...</tag> container, +  but if no \"href\" attribute is specified, the current page is used.", +  + "auth-required":#"<desc tag> +  Adds an HTTP auth required header and return code (401), that will force +  the user to supply a login name and password. This tag is needed when +  using access control in RXML in order for the user to be prompted to +  login. + </desc> +  + <attr name=realm value=string> +  The realm you are logging on to, i.e \"Intranet foo\". + </attr> +  + <attr name=message value=string> +  Returns a message if a login failed or cancelled. + </attr>", +  + "autoformat":#"<desc cont> +  Replaces newlines with <tag>br</tag>:s. + </desc> +  + <attr name=nobr> +  Do not replace newlines with <tag>br</tag>:s. + </attr> +  + <attr name=p> +  Replace double newlines with <tag>p</tag>:s. + </attr> +  + <attr name=class value=string> +  This CSS definition will be applied on the p elements. + </attr>", +  + "cache":#"<desc cont> +  This simple tag RXML parse its contents and cache them using the +  normal Roxen memory cache. They key used to store the cached contents +  is the MD5 hash sum of the contents, the accessed file name, the +  query string, the server URL and the authentication information, if +  available. This should create an unique key. + </desc> +  + <attr name=key value=string> +  Append this value to the hash used to identify the contents for less +  risk of incorrect caching. This shouldn't really be needed. + </attr>", +  + "catch":#"<desc cont> +  Evaluates the RXML code, and, if nothing goes wrong, returns the +  parsed contents. If something does go wrong, the error message is +  returned instead. See also <tag><ref type=tag>throw</ref></tag>. + </desc>", +  + "configimage":#"<desc tag> +  Returns one of the configuration images. The src attribute is required. + </desc> +  + <attr name=src value=string> +  The name of the picture to show. + </attr> +  + <attr name=border value=number> +  The image border when used as a link. Default is 0. + </attr> +  + <attr name=alt value=string> +  The picture description. Default is the src string. + </attr> +  + <attr name=class value=string> +  This CSS class definition will be applied to the image. + </attr> +  All other attributes will be inherited by the generated img tag.", +  + "configurl":#"<desc tag> +  Returns a URL to the configuration interface. + </desc>", +  + "cset":#"<desc cont></desc>", +  + "crypt":#"<desc cont> +  Encrypts the contents as a Unix style password. Useful when combined +  with services that use such passwords. <p>Unix style passwords are +  one-way encrypted, to prevent the actual clear-text password from +  being stored anywhere. When a login attempt is made, the password +  supplied is also encrypted and then compared to the stored encrypted +  password.</p> + </desc>", +  + "date":#"<desc tag> +  Inserts the time and date. Does not require attributes. + </desc> +  + <attr name=unix-time value=number> +  Display this time instead of the current. + </attr> +  + <attr name=years value=number> +  Add this number of years to the result. + </attr> +  + <attr name=months value=number> +  Add this number of months to the result. + </attr> +  + <attr name=weeks value=number> +  Add this number of weeks to the result. + </attr> +  + <attr name=days value=number> +  Add this number of days to the result. + </attr> +  + <attr name=hours value=number> +  Add this number of hours to the result. + </attr> +  + <attr name=beats value=number> +  Add this number of beats to the result. + </attr> +  + <attr name=minutes value=number> +  Add this number of minutes to the result. + </attr> +  + <attr name=seconds value=number> +  Add this number of seconds to the result. + </attr> +  + <attr name=adjust value=number> +  Add this number of seconds to the result. + </attr> +  + <attr name=brief> +  Show in brief format. + </attr> +  + <attr name=time> +  Show only time. + </attr> +  + <attr name=date> +  Show only date. + </attr> +  + <attr name=type value=string,ordered,iso,discordian,stardate,number> +  Defines in which format the date should be displayed in. + </attr> +  + <attr name=part value=year,month,day,wday,date,mday,hour,minute,second,yday,beat,week,seconds> +  Defines which part of the date should be displayed. Day and wday is +  the same. Date and mday is the same. Yday is the day number of the +  year. Seconds is unix time type. Only the types string, number and +  ordered applies when the part attribute is used. + </attr> +  + <attr name=lang value=language_code> +  Defines in what language the a string will be presented in. + </attr> +  + <attr name=case value=upper,lower,capitalized> +  Changes the case of the output to upper, lower or capitalized. + </attr> +  + <attr name=prec value=number> +  The number of decimals in the stardate. + </attr>", +  + "debug":#"<desc tag> +  Helps debugging RXML-pages as well as modules. When debugging mode is +  turned on, all error messages will be displayed in the HTML code. + </desc> +  + <attr name=on> +  Turns debug mode on. + </attr> +  + <attr name=off> +  Turns debug mode off. + </attr> +  + <attr name=toggle> +  Toggles debug mode. + </attr> +  + <attr name=showid value=string> +  Shows a part of the id object. E.g. showid=\"id->request_headers\". + </attr>", +  + "dec":#"<desc tag> +  Subtracts 1 from a variable. Attribute variable is required. + </desc> +  + <attr name=variable value=string> +  The variable to be decremented. + </attr>", +  + "default":#"<desc cont> +  +  Makes it easier to give default values to \"<tag>select</tag>\" or +  \"<tag>checkbox</tag>\" form elements. +  +  <p>The <tag>default</tag> container tag is placed around the form element it +  should give a default value.</p> +  +  <p>This tag is particularly useful in combination with database tags.</p> + </desc> +  + <attr name=value value=string> +  The value to set. + </attr> +  + <attr name=separator value=string> +  + </attr> +  + <attr name=name value=string> +  Only affect form element with this name. + </attr> +  + <attr name=variable value=string> +  + </attr>", +  + "doc":#"<desc cont> +  Eases documentation by replacing \"{\", \"}\" and \"&\" with \"<\", \">\" and +  \"&\". No attributes required. + </desc> +  + <attr name=quote> +  Instead of replacing \"{\" and \"}\", \"<\" and \">\" is replaced with \"&amp;lt;\" +  and \"&amp;gt;\". + </attr> +  + <attr name=pre> +  The result is encapsulated within a <tag>pre</tag> container. + </attr> +  + <attr name=class value=string> +  This CSS definition will be applied on the pre element. + </attr>", +  + "expire-time":#"<desc tag> +  Sets cache expire time for this document. Default bla bla. + </desc> +  + <attr name=now> +  The document expires now. + </attr> +  + <attr name=years value=number> +  Add this number of years to the result. + </attr> +  + <attr name=months value=number> +  Add this number of months to the result. + </attr> +  + <attr name=weeks value=number> +  Add this number of weeks to the result. + </attr> +  + <attr name=days value=number> +  Add this number of days to the result. + </attr> +  + <attr name=hours value=number> +  Add this number of hours to the result. + </attr> +  + <attr name=beats value=number> +  Add this number of beats to the result. + </attr> +  + <attr name=minutes value=number> +  Add this number of minutes to the result. + </attr> +  + <attr name=seconds value=number> +  Add this number of seconds to the result. + </attr> +  It is not possible at the time to set the date beyond year 2038, +  since a unix time_t is used.", +  + "for":#"<desc cont> +  Makes it possible to create loops in RXML. + </desc> +  + <attr name=from value=number> +  Initial value of the loop variable. + </attr> +  + <attr name=step value=number> +  How much to increment the variable per loop iteration. By default one. + </attr> +  + <attr name=to value=number> +  How much the loop variable should be incremented to. + </attr> +  + <attr name=variable value=name> +  Name of the loop variable. + </attr>", +  + "foreach":#"<desc cont> +  + </desc> +  + <attr name=variable> +  + </attr> +  + <attr name=variables> +  + </attr> +  + <attr name=in> +  + </attr>", +  + "formoutput":#"<desc cont></desc>", +  + "fsize":#"<desc tag> +  + </desc> +  + <attr name=file value=string> +  + </attr>", +  + "gauge":#"<desc cont> +  Measures how much CPU time it takes to run its contents through the +  RXML parser. Returns the number of seconds it took to parse the +  contents. + </desc> +  + <attr name=define value=string> +  The result will be put into a variable. E.g. define=var.gauge vill +  put the result in a variable that can be reached with &var.gauge;. + </attr> +  + <attr name=silent> +  Don't print anything. + </attr> +  + <attr name=timeonly> +  Only print the time. + </attr> +  + <attr name=resultonly> +  Only the result of the parsing. Useful if you want to put the time in +  a database or such. + </attr>", +  + "header":#"<desc tag> +  Adds a header to this document. + </desc> +  + <attr name=name value=string> +  The name of the header. + </attr> +  + <attr name=value value=string> +  The value of the header. + </attr> +  See the Appendix for a list of HTTP headers.", +  + "imgs":#"<desc tag> +  Generates a image tag with proper dimensions. Attribute src is required. + </desc> +  + <attr name=src value=string> +  The name of the file that should be shown. + </attr> +  + <attr name=alt value=string> +  Description of the image. Default is the image file name. + </attr> +  All other attributes will be inherited by the generated img tag.", +  + "inc":#"<desc tag> +  Adds 1 to a variable. Attribute variable is required. + </desc> +  + <attr name=variable value=string> +  The variable to be incremented. + </attr>", +  + "insert":#"<desc tag> +  Inserts a file, variable or other object into a webpage. +  One attribute is required. + </desc> +  + <attr name=variable value=string> +  Inserts the value of that variable. + </attr> +  + <attr name=variables> +  Inserts a variable listing. + </attr> +  + <attr name=cookies> +  Inserts a cookie listing. + </attr> +  + <attr name=cookie value=string> +  Inserts the value of that cookie. + </attr> +  + <attr name=file value=string> +  Inserts the contents of that file. + </attr> +  + <attr name=href value=string> +  Inserts the contents at that URL. + </attr> +  + <attr name=other value=string> +  Inserts a misc variable (id->misc->variables). + </attr> +  + <attr name=quote value=html,none> +  How the inserted data should be quoted. Default is \"html\", except for +  href and file where it's \"none\". + </attr>", +  + "maketag":#"<desc cont> +  This tag creates tags. The contents of the container will be put into +  the contents of the produced container. Requires the name attribute. + </desc> +  + <attr name=name value=string> +  The name of the tag. + </attr> +  + <attr name=noxml> +  Tags should not be terminated with a trailing slash. + </attr> +  + <attr name=type value=tag,container> +  What kind of tag should be produced. Default is tag. + </attr> +  Inside the maketag container the container attrib is defined. It is +  used to add attributes to the produced tag. It has the required +  attribute attrib, which is the name of the attribute. The contents of +  the attribute container will be the attribute value. E.g. +  +  <p>&lt;maketag name=replace type=container&gt; +  &lt;attrib name=from&gt;A&lt;/attrib&gt; +  &lt;attrib name=to&gt;U&lt;/attrib&gt; +  MAD +  &lt;/maketag&gt; +  +  will result in +  +  &lt;replace from=A to=U&gt;MAD&lt;/replace&gt; +  &lt;/pre&gt;</p>", +  + "modified":#"<desc tag> +  Prints when or by whom a page was last modified, by default the current page. + </desc> +  + <attr name=by> +  Print by whom the page was modified. Takes the same attributes as the +  <tag><ref type=tag>user</ref></tag> tag. This attribute requires a +  userdatabase. + </attr> +  + <attr name=date> +  Print the modification date. Takes all the date attributes in the +  <tag><ref type=tag>date</ref></tag> tag. + </attr> +  + <attr name=file value=path> +  Get information from this file rather than the current page. + </attr> +  + <attr name=realfile value=path> +  Get information from this file in the computers filesystem rather +  than Roxen Webserver's virtual filesystem. + </attr>", +  + "random":#"<desc cont> +  Randomly chooses a message from its contents. + </desc> +  + <attr name=separator value=string> +  The separator used to separate the messages, by default newline. + </attr>", +  + "recursive-output":#"<desc cont> +  + </desc> +  + <attr name=limit value=number> +  + </attr> +  + <attr name=inside value=string> +  + </attr> +  + <attr name=outside value=string> +  + </attr> +  + <attr name=separator value=string> +  + </attr>", +  + "redirect":#"<desc tag> +  Redirects the user to another page. Requires the to attribute. + </desc> +  + <attr name=to value=string> +  Where the user should be sent to. + </attr> +  + <attr name=add value=string> +  The prestate or prestates that should be added, in a comma seperated +  list. + </attr> +  + <attr name=drop value=string> +  The prestate or prestates that should be dropped, in a comma seperated +  list. + </attr> +  + <attr name=text value=string> +  Sends a text string to the browser, that hints from where and why the +  page was redirected. Not all browsers will show this string. Only +  special clients like Telnet uses it. + </attr> +  Arguments prefixed with \"add\" or \"drop\" are treated as prestate +  toggles, which are added or removed, respectively, from the current +  set of prestates in the URL in the redirect header (see also <tag +  <ref type=tag>apre</ref></tag>). Note that this only works when the +  to=... URL is absolute, i.e. begins with a \"/\", otherwise these +  state toggles have no effect.", +  + "remove-cookie":#"<desc tag> +  Removes a cookie. + </desc> +  + <attr name=name> +  Name of the cookie to remove. + </attr> +  + <attr name=value value=text> +  Even though the cookie has been marked as expired some browsers +  will not remove the cookie until it is shut down. The text provided +  with this attribute will be the cookies intemediate value. + </attr> +  + Note that removing a cookie won't take effect until the next page + load.", +  + "repeat":#"<desc cont> +  Repeats the contents until a <tag>leave</tag> tag has been found. +  Requires no attributes. + </desc> +  + <attr name=maxloops> +  The maximum number of loops. Default is 10000. + </attr>", +  + "replace":#"<desc cont> +  Replaces strings in the contents with other strings. Requires the +  from attribute. + </desc> +  + <attr name=from value=string> +  String or list of strings that should be replaced. + </attr> +  + <attr name=to value=string> +  String or list of strings with the replacement strings. Default is the +  empty string. + </attr> +  + <attr name=separator value=string> +  Defines what string should seperate the strings in the from and to +  attributes. Default is \",\". + </attr> +  + <attr name=type value=word,words> +  Word means that a single string should be replaced. Words that from +  and to are lists. Default is word. + </attr>", +  + "return":#"<desc tag> +  Changes the HTTP return code for this page. +  +  See the Appendix for a list of HTTP return codes. + </desc> +  + <attr name=code> +  The return code to set. + </attr>", +  + "roxen":#"<desc tag> +  Returns a nice Roxen logo. + </desc> +  + <attr name=size value=small,medium,large> +  Defines the size of the image. Default is small. + </attr> +  + <attr name=color value=blue,green,purple,brown> +  Defines the color of the image. Default is blue. + </attr> +  + <attr name=alt value=string> +  The image description. Default is \"Powered by Roxen\". + </attr> +  + <attr name=border value=number> +  The image border. Default is 0. + </attr> +  + <attr name=class value=string> +  This CSS definition will be applied on the img element. + </attr> +  All other attributes will be inherited by the generated img tag.", +  + "scope":#"<desc cont> +  Creates a different variable scope. Variable changes inside the scope +  container will not affect variables in the rest of the page. +  Variables set outside the scope is not available inside the scope +  unless the extend attribute is used. No attributes are required. + </desc> +  + <attr name=extend> +  If set, all variables will be copied into the scope. + </attr>", +  + "set":#"<desc tag> + Sets a variable. The variable attribute is required. + </desc> +  + <attr name=variable value=string> +  The name of the variable. + </attr> +  + <attr name=value value=string> +  The value the variable should have. + </attr> +  + <attr name=expr value=string> +  An expression whose evaluated value the variable should have. + </attr> +  + <attr name=from value=string> +  The name of another variable that the value should be copied from. + </attr> +  + <attr name=other value=string> +  The name of a id->misc->variables that the value should be copied from. + </attr> +  + <attr name=eval value=string> +  An RXML expression whose evaluated value the variable should have. + </attr> +  +  If none of the above attributes are specified, the variable is unset. +  If debug is currently on, more specific debug information is provided +  if the operation failed. See also: <tag><ref type=tag>append</ref></tag> +  and <tag><ref type=tag>debug</ref></tag>", +  + "set-cookie":#"<desc tag> +  Sets a cookie that will be stored by the user's browser. This is a +  simple and effective way of storing data that is local to the user. +  The cookie will be persistent, the next time the user visits the +  site, she will bring the cookie with her. + </desc> +  + <attr name=name value=string> +  The name of the cookie. + </attr> +  + <attr name=seconds value=number> +  Add this number of seconds to the time the cookie is kept. + </attr> +  + <attr name=minutes value=number> +  Add this number of minutes to the time the cookie is kept. + </attr> +  + <attr name=hours value=number> +  Add this number of hours to the time the cookie is kept. + </attr> +  + <attr name=days value=number> +  Add this number of days to the time the cookie is kept. + </attr> +  + <attr name=weeks value=number> +  Add this number of weeks to the time the cookie is kept. + </attr> +  + <attr name=months value=number> +  Add this number of months to the time the cookie is kept. + </attr> +  + <attr name=years value=number> +  Add this number of years to the time the cookie is kept. + </attr> +  + <attr name=persistent> +  Keep the cookie for two years. + </attr> +  + <attr name=value value=string> +  The value the cookie will be set to. + </attr> +  + <attr name=path value=string> + Adds a cookie named \"name\" with the value \"value\". + </attr> +  +  If persistent is specified; the cookie will be persistent until year +  2038, otherwise, the specified delays are used, just as for +  <tag><ref type=tag>expire-time</ref></tag>. +  +  Note that the change of a cookie will not take effect until the +  next page load.", +  + "set-max-cache":#"<desc tag> +  Set the maximum time this document can be cached in any ram caches. +  +  <p>Default is to get this time from the other tags in the document +  (as an example, <tag>if supports=...</tag> sets the time to 0 seconds since +  the result of the test depends on the client used.</p> +  +  <p>You must do this at the end of the document, since many of the +  normal tags will override this value.</p> + </desc> +  + <attr name=time value=number of seconds> +  Add this number of seconds to the time this page was last loaded. + </attr>", +  + "smallcaps":#"<desc cont> +  This tag prints the contents in smallcaps. If the size attribute is +  given, font tags will be used, otherwise big and small tags will be +  used. + </desc> +  + <attr name=space> +  Put a space between every character. + </attr> +  + <attr name=class value=string> +  Apply this CSS style on all elements. + </attr> +  + <attr name=smallclass value=string> +  Apply this CSS style on all small elements. + </attr> +  + <attr name=bigclass value=string> +  Apply this CSS style on all big elements. + </attr> +  + <attr name=size value=number> +  Use font tags, and this number as big size. + </attr> +  + <attr name=small value=number> +  Size of the small tags. Only applies when size is specified. Default +  is size-1. + </attr>", +  + "sort":#"<desc cont> +  Sorts the contents. No attributes required. + </desc> +  + <attr name=separator value=string> +  Defines what the strings to be sorted are separated with. + </attr> +  + <attr name=reverse> +  Reversed order sort. + </attr>", +  + "throw":#"<desc cont> +  Throws an exception, with the enclosed text as the error message. +  This tag has a close relation to <tag>catch</tag>. The RXML parsing +  will stop at the <tag>throw</tag> tag. + </desc>", +  + "trimlines":#"<desc cont> +  This tag removes all empty lines from the contents. + </desc>", +  + "unset":#" + <desc tag> +  Unsets a variable, i.e. removes it. The variable attribute is required. + </desc> +  + <attr name=variable value=string> +  The name of the variable. + </attr>", +  + "user":#"<desc tag> +  Prints information about the specified user. By default, the full +  name of the user and her e-mail address will be printed, with a +  mailto link and link to the home page of that user. +  +  The <tag>user</tag> tag requires an authentication module to work. + </desc> +  + <attr name=email> +  Only print the e-mail address of the user, with no link. + </attr> +  + <attr name=link> +  Include links. Only meaningful together with the realname or email attribute. + </attr> +  + <attr name=name> +  The login name of the user. + </attr> +  + <attr name=nolink> +  Don't include the links. + </attr> +  + <attr name=realname> +  Only print the full name of the user, with no link. + </attr>", +  ]); + #endif