Roxen.git / server / modules / tags / wizard_tag.pike

version» Context lines:

Roxen.git/server/modules/tags/wizard_tag.pike:1:   /* This is a Roxen Challenger(r) module. Copyright (c) Idonex 1997.    * Released under GPL    * made by Per Hedbor    */    - constant cvs_version = "$Id: wizard_tag.pike,v 1.3 1998/02/03 22:51:08 per Exp $"; + constant cvs_version = "$Id: wizard_tag.pike,v 1.4 1998/02/20 11:16:41 per Exp $";   constant thread_safe=1;   #include <module.h>   inherit "module";   inherit "wizard";      mixed *register_module()   {    return ({MODULE_PARSER,"Wizard generator",    ("Generates wizards<p>\n"    "Syntax:<br>\n"   "<br>" - "&lt;wizard name=\"A Name\" done=\"url to go to when ok or cancel is pressed\"&gt;<br>" + "&lt;wizard [next-label=...] [previous-label=...] [ok-label=...] [cancel-label=...] [page-label=...] name=\"A Name\" done=\"url to go to when ok or cancel is pressed\"&gt;<br>"   "&nbsp;&nbsp;&lt;page&gt;<br>"   "&nbsp;&nbsp;&nbsp;&nbsp;A page (RXML code, with two extra tags, &lt;var&gt; and &lt;cvar&gt;, see below)<br>"   "&nbsp;&nbsp;&lt;/page&gt;<br>"   "&nbsp;&nbsp;&lt;page&gt;<br>"   "&nbsp;&nbsp;&nbsp;&nbsp;Another page...<br>"   "&nbsp;&nbsp;&lt;/page&gt;<br>"   "&lt;/wizard&gt;<br>"   "<br>"   "&lt;var <br>"   "&nbsp;&nbsp; <nobr>type=\"string|password|list|text|radio|checkbox|int|float|color|font|toggle|select|select_multiple\"</nobr><br>"
Roxen.git/server/modules/tags/wizard_tag.pike:39:   {    f->pages += ({contents});   }      string tag_wizard(string t, mapping args, string contents, object id)   {    mapping f = ([ "pages":({}) ]);    string pike = ("inherit \"wizard\";\n"    "string name=\""+(args->name||"unnamed")+"\";\n");    int p; +  foreach(glob("*-label", indices(args)), string a) +  { +  pike += " string "+replace(replace(a,"-","_"),({"(",")","+",">"}), +  ({"","","",""}))+ +  " = \""+replace(args[a], ({"\"","\n","\r", "\\"}), +  ({"\\\"", "\\n", "\\r", "\\\\"}))+"\";\n"; +  } +     parse_html(contents, ([]), (["page":internal_page]),f);    foreach(f->pages, string d)    {    pike += ("string page_"+p+"(object id) {" +    "return \""+replace(d, ({"\"","\n","\r", "\\"}),    ({"\\\"", "\\n", "\\r", "\\\\"}))+"\";}\n");    p++;    } -  + // werror("compiling:\n"+pike+"\n");    mixed res = compile_string(pike)()->wizard_for(id,args->done);    if(mappingp(res))    {    id->misc->defines[" _error"] = res->error;    id->misc->defines[" _extra_heads"] = res->extra_heads;    return "";    }    return res;   }         mapping query_container_callers()   {    return ([ "wizard" : tag_wizard ]);   }      void start()   {      }