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.11 1998/07/19 17:16:38 grubba Exp $"; + constant cvs_version = "$Id: wizard_tag.pike,v 1.12 1998/07/22 00:05:30 js Exp $";   constant thread_safe=1;   #include <module.h>   inherit "module";   inherit "wizard";      mixed *register_module()   {    return ({MODULE_PARSER,"Wizard generator",    "Generates wizards<p>See &lt;wizard help&gt; for more information\n",    ({}),1,});   }      string internal_page(string t, mapping args, string contents, int l, int ol,    mapping f)   {    f->pages +=({({contents,ol+l})});   }    -  + string internal_done(string t, mapping args, string contents, int l, int ol, +  mapping f) + { +  f->done=contents; + } +    string fix_relative(string file, object id)   {    if(file != "" && file[0] == '/') return file;    file = combine_path(dirname(id->not_query) + "/", file);    return file;   }      string old_pike = "";   object old_wizard = 0;   
Roxen.git/server/modules/tags/wizard_tag.pike:81:    pike += ("# "+defines->line+" \""+id->not_query+"\"\n");    pike += ("mixed wizard_done(object id)\n"    "{\n"    " id->not_query = \""+    fix_relative(replace(args->ok, ({"\"","\n","\r", "\\"}),    ({"\\\"", "\\n", "\\r", "\\\\"})),id)+"\";\n"    " return roxen->get_file( id );\n"    "}\n\n");   #endif /* __VERSION__ >= 0.6 */    } -  parse_html_lines(contents, ([]), (["page":internal_page]), +  +  parse_html_lines(contents, +  ([]), +  ([ "page":internal_page, +  "done":internal_done ]),    (int)defines->line,f); -  +  if(f->done&&!args->ok); +  pike += ("mixed wizard_done(object id)\n" +  "{\n" +  " return parse_rxml(\""+replace(f->done, +  ({"\"","\n","\r", "\\"}), +  ({"\\\"", "\\n", "\\r", "\\\\"}))+ +  "\",id);\n" +  "}\n");    foreach(f->pages, array q)    {   #if __VERSION__ >= 0.6    pike += sprintf("# "+q[1]+" %O\n", id->not_query);    pike += sprintf("string page_"+p+"(object id) {" +    " return %O;\n"    "}\n", q[0]);   #else    pike += ("# "+q[1]+" \""+id->not_query+"\"\n");    pike += ("string page_"+p+"(object id) {" +
Roxen.git/server/modules/tags/wizard_tag.pike:108:    object w;    if(pike == old_pike)    w = old_wizard;    else    {    old_wizard = w = compile_string(pike)();    old_pike = pike;    }       -  mixed res = w->wizard_for(id,fix_relative(args->cancel||args->done,id)); +  mixed res = w->wizard_for(id,fix_relative(args->cancel||args->done||"",id));       if(mappingp(res))    {    defines[" _error"] = res->error;    defines[" _extra_heads"] = res->extra_heads;    return res->data||(res->file&&res->file->read())||"";    }    return res;   }         mapping query_container_callers()   {    return ([ "wizard" : tag_wizard ]);   }      void start()   {      }