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

version» Context lines:

Roxen.git/server/etc/modules/Variable.pmod/module.pmod:316:    if( (flags & VAR_EXPERT) && !expert_mode ) return 0;    if( (flags & VAR_MORE) && !more_mode ) return 0;    if( (flags & VAR_DEVELOPER) && !devel_mode ) return 0;    if( (flags & VAR_NOT_CFIF) && variable_in_cfif ) return 0;    if( (cb = get_invisibility_check_callback() ) &&    cb( id, this_object() ) )    return 0;    return 1;    }    -  void set_invisibility_check_callback( function(RequestID,Variable:int) cb ) +  this_program set_invisibility_check_callback( function(RequestID,Variable:int) cb )    //! If the function passed as argument returns 1, the variable    //! will not be visible in the configuration interface.    //!    //! Pass 0 to remove the invisibility callback.    {    if( functionp( cb ) )    invisibility_callbacks[ _id ] = cb;    else    m_delete( invisibility_callbacks, _id ); -  +  return this;    }       function(Variable:void) get_changed_callback( )    //! Return the callback set with set_changed_callback    {    return changed_callbacks[ _id ];    }    -  void set_changed_callback( function(Variable:void) cb ) +  this_program set_changed_callback( function(Variable:void) cb )    //! The function passed as an argument will be called    //! 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 ); -  +  return this;    }    -  void add_changed_callback( function(Variable:void) cb ) +  this_program 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; -  +  return this;    }       function(RequestID,Variable:int) get_invisibility_check_callback()    //! Return the current invisibility check callback    {    return invisibility_callbacks[_id];    }       LocaleString doc( )    //! Return the documentation for this variable (locale dependant).