From: Chris W. <la...@us...> - 2004-12-02 03:19:05
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21484/lib/OpenInteract2 Modified Files: Action.pm Log Message: add a couple more error/status message shortcuts Index: Action.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action.pm,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Action.pm 1 Dec 2004 05:27:07 -0000 1.63 --- Action.pm 2 Dec 2004 03:18:54 -0000 1.64 *************** *** 933,944 **** # shortcuts... sub add_error_key { my ( $self, $key, @params ) = @_; ! $self->param_add( error_msg => $self->_msg( $key, @params ) ); } sub add_status_key { my ( $self, $key, @params ) = @_; ! $self->param_add( status_msg => $self->_msg( $key, @params ) ); } --- 933,968 ---- # shortcuts... + sub add_error { + my ( $self, @msg ) = @_; + my $err = join( '', @msg ); + $self->param_add( error_msg => $err ); + return $err; + } + + sub add_status { + my ( $self, @msg ) = @_; + my $status = join( '', @msg ); + $self->param_add( status_msg => $status ); + return $status; + } + sub add_error_key { my ( $self, $key, @params ) = @_; ! return $self->add_error( $self->_msg( $key, @params ) ); } sub add_status_key { my ( $self, $key, @params ) = @_; ! return $self->add_status( $self->_msg( $key, @params ) ); ! } ! ! sub clear_error { ! my ( $self ) = @_; ! $self->param_clear( 'error_msg' ); ! } ! ! sub clear_status { ! my ( $self ) = @_; ! $self->param_clear( 'status_msg' ); } *************** *** 2564,2567 **** --- 2588,2603 ---- Returns: nothing + B<add_error( @msg )> + + Adds message (C<join>ed C<msg>) to action parameter 'error_msg'). + + Returns: added message + + B<add_status( @msg )> + + Adds message (C<join>ed C<msg>) to action parameter 'status_msg'). + + Returns: added message + B<add_error_key( $key, [ @msg_params ] )> *************** *** 2578,2581 **** --- 2614,2625 ---- Returns: added message + B<clear_error()> + + Removes all error messages. + + B<clear_status()> + + Removes all status messages. + B<message_from_key_or_param( $param_name, $message_key, @key_arguments )> |