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.11 2000/09/01 01:15:21 mast Exp $ + // $Id: module.pmod,v 1.12 2000/09/03 02:33:00 per Exp $      #include <module.h>   #include <roxen.h>      // Locale macros   static inline string getloclang() {    return roxenp()->locale->get();   }      //<locale-token project="roxen_config"> LOCALE </locale-token>
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:135:    //! when the variable value is changed.    //!    //! Pass 0 to remove the callback.    {    if( functionp( cb ) )    changed_callbacks[ _id ] = cb;    else    m_delete( changed_callbacks, _id );    }    +  void add_changed_callback( function(Variable:void) cb ) +  //! Add a new callback to be called when the variable is changed. +  //! If set_changed_callback is called, callbacks added with this function +  //! are overridden. +  { +  mixed oc = get_changed_callback( ); +  if( arrayp( oc ) ) +  oc += ({ cb }); +  else +  oc = ({ oc, cb }) - ({ 0 }); +  changed_callbacks[ _id ] = oc; +  } +     function(RequestID,Variable:int) get_invisibility_check_callback()    //! Return the current invisibility check callback    {    return invisibility_callbacks[_id];    }       string doc( )    //! Return the documentation for this variable (locale dependant).    //!    //! The default implementation queries the locale object in roxen
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:710:    if( equal( m->value, current ) ) {    m->selected="selected";    selected = 1;    }    res += " "+Roxen.make_container( "option", m, _title( elem ) )+"\n";    }    if (!selected)    // Make an entry for the current value if it's not in the list,    // so no other value appears to be selected, and to ensure that    // the value doesn't change as a side-effect by another change. -  res = " " + Roxen.make_container ( +  res += " " + Roxen.make_container (    "option", (["value": current, "selected": "selected"]),    "(keep stale value " + current + ")");    return res + "</select>";    }    static void create( mixed default_value, array|mapping choices,    int _flags, string std_name, string std_doc )    //! Constructor.    //!    //! Choices is the list of possible choices, can be set with    //! set_choice_list at any time.