Roxen.git / server / etc / modules / Variable.pmod / module.pmod

version» Context lines:

Roxen.git/server/etc/modules/Variable.pmod/module.pmod:1: - // $Id: module.pmod,v 1.56 2001/06/19 21:30:31 nilsson Exp $ + // $Id: module.pmod,v 1.57 2001/06/27 20:58:35 nilsson Exp $      #include <module.h>   #include <roxen.h>      // Locale macros   //<locale-token project="roxen_config"> LOCALE </locale-token>      #define LOCALE(X,Y) \    ([string](mixed)Locale.translate("roxen_config",roxenp()->locale->get(),X,Y))   
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:296:    //! Return all form variables preficed with path().    {    string p = path();    array names = glob( p+"*", indices(id->variables) );    mapping res = ([ ]);    foreach( sort(names), string n )    res[ n[strlen(p).. ] ] = id->variables[ n ];    return res;    }    -  mixed transform_from_form( string what,mapping|void v ) +  mixed transform_from_form( string what, mapping|void v )    //! Given a form value, return what should be set.    //! Used by the default set_from_form implementation.    {    return what;    }       int(0..1) set_from_form( RequestID id, void|int(0..1) force )    //! Set this variable from the form variable in id->Variables,    //! if any are available. The default implementation simply sets    //! the variable to the string in the form variables. @[force]
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:319:    //! Returns 1 if the variable was changed, otherwise 0.    //!    //! Other side effects: Might create warnings to be shown to the    //! user (see get_warnings)    //!    //! Calls verify_set_from_form and verify_set    {    mixed val;    if( sizeof( val = get_form_vars(id)) && val[""])    { -  val = transform_from_form( val[""] ); +  val = transform_from_form( val[""], val );    if( !force && val == query() )    return 0;    array b;    mixed q = catch( b = verify_set_from_form( val ) );    if( q || sizeof( b ) != 2 )    {    if( q )    add_warning( q );    else    add_warning( "Internal error: Illegal sized array "