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

version» Context lines:

Roxen.git/server/modules/tags/awizard.pike:1:   // This is a roxen module. Copyright © 1999 - 2009, Roxen IS.   //      inherit "module";   #include <request_trace.h>   #include <module.h>   #include <config.h>    - constant cvs_version = "$Id: awizard.pike,v 1.30 2009/05/07 14:15:56 mast Exp $"; + constant cvs_version = "$Id$";   constant thread_safe = 1;   constant module_type = MODULE_TAG;   constant module_name = "Tags: Advanced wizards";   constant module_doc =   #"Provides the <tt>&lt;awizard&gt;</tt> tag that is used to   create wizard like user interfaces. Each wizard can contain several pages   with forms. The module handles navigation among the pages, input   validation and keeps track of all the user's choices, no matter which page   they were made on.";   mapping cache = ([]);
Roxen.git/server/modules/tags/awizard.pike:79:    }       mapping make_gbutton_args( mapping from )    {    mapping res = ([]);    foreach( glob( "gbutton-*", indices(from) ), string f )    res[ f[8..] ] = from[ f ];    return res;    }    -  string tag_button(string t, mapping m, RequestID id) +  string tag_wizard_button(string t, mapping m, RequestID id)    {    mapping args = m - (["id": 1, "page": 1, "href": 1, "next": 1, "prev": 1,    "image": 1, "gbutton_title": 1, "title": 1]);    if(m->page)    args->name = "goto_page_"+m->page+"/"+m->id;    else if(m->href)    args->name = "goto_href_["+m->href+"]/"+m->id;    else if(m->next)    {    if(!id->misc->next_possible)
Roxen.git/server/modules/tags/awizard.pike:300:    if(args->define)    return id->misc->defines[args->define]||"";    string q = id->conf->try_get_file(fix_relative(args->file, id), id);    return q;    }       mapping button_code;    string internal_tag_page(string t, mapping args, string c, int l,    RequestID id)    { +  // Replace conflicting tag name "button" in the content to make it local +  // to this element. +  c = replace(c, ({ "<button", "<rxml:button" }), +  ({ "<wizard-button", "<rxml:wizard-button" }) );    args->num = last_page;    if(!args->name) args->name = (string)last_page;    pages += ({ Page( args, c, button_id, button_code ) });    button_id = pages[ -1 ]->button_id;    pages[ -1 ]->line_offset = (int)id->misc->line + l;    pages_by_name[ args->name ] = pages[ -1 ];    last_page++;    }       string lc = "";
Roxen.git/server/modules/tags/awizard.pike:500:    array|string container_ ## name (string t, mapping m, string c, RequestID id) \    { \    if (id->misc->awizard_page) \    return id->misc->awizard_page->container_ ## name (t, m, c, id); \    else \    return ({1}); \    }      PROXY_TAG (goto);   PROXY_TAG (wizard_buttons); - PROXY_TAG (button); + PROXY_TAG (wizard_button);   PROXY_CONTAINER (dbutton);   PROXY_CONTAINER (warn);   PROXY_CONTAINER (notice);   PROXY_CONTAINER (error);      array|string tag_var(string tag, mapping args, RequestID id)   {    if (id->misc->awizard_page)    return id->misc->awizard_page->call_var (tag, args, id);    else
Roxen.git/server/modules/tags/awizard.pike:586: Inside #if defined(manual)
     <attr name='title' value='string'>    Put a name on the button.   </attr>      <attr name='image' value='path'>    Put an image on the button.   </attr>",      "ebutton":#"<desc type='cont'> -  A more advanved button. When pressed the content of this container +  A more advanced button. When pressed the content of this container    will be parsed before the user are allowed to leave the page.   </desc>      <attr name='href' value='URL'>    Send the user to this URL.   </attr>      <attr name='title' value='string'>    Put a name on the button.   </attr>