From: Sam S. <ssc...@us...> - 2005-02-25 21:54:05
|
Update of /cvsroot/popfile/engine/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25399/UI Modified Files: HTML.pm XMLRPC.pm Log Message: Continue refactoring HTML UI "status" and "error" messages to use the new status_message__ and error_message__ functions. Progress: All proxy and UI dynamic widgets complete. IMAP _not_ done. Tests forthcoming. Also, these changes make the configuration widgets presentation-language agnostic. That is pretty neat. Perhaps XMLRPC could provide a source-validated configuration API. Index: HTML.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v retrieving revision 1.345 retrieving revision 1.346 diff -C2 -d -r1.345 -r1.346 *** HTML.pm 24 Feb 2005 13:49:24 -0000 1.345 --- HTML.pm 25 Feb 2005 21:53:52 -0000 1.346 *************** *** 1108,1111 **** --- 1108,1112 ---- # Tell the user anything the dynamic UI was interested in sharing + $self->log_( 3, "dynamic security UI $name had status/error $status_message/$error_message") if (defined $status_message || defined $error_message); $self->status_message__($templ,$status_message) if ( defined( $status_message )); $self->error_message__($templ, $error_message) if ( defined( $error_message )); *************** *** 1122,1125 **** --- 1123,1127 ---- # Tell the user anything the dynamic UI was interested in sharing + $self->log_( 3, "dynamic chain UI $name had status/error $status_message/$error_message") if (defined $status_message || defined $error_message); $self->status_message__($templ,$status_message) if ( defined( $status_message )); $self->error_message__($templ, $error_message) if ( defined( $error_message )); *************** *** 1169,1172 **** --- 1171,1175 ---- # Tell the user anything the dynamic UI was interested in sharing + $self->log_( 3, "dynamic config UI $name had status/error $status_message/$error_message") if (defined $status_message || defined $error_message); $self->status_message__($templ,$status_message) if ( defined( $status_message )); $self->error_message__($templ, $error_message) if ( defined( $error_message )); *************** *** 3520,3529 **** # $object Reference to the object calling this method # ! # This seemingly innocent method disguises a lot. It is called by ! # modules that wish to register that they have specific elements of UI ! # that need to be dynamically added to the Configuration and Security ! # screens of POPFile. This is done so that the HTML module does not ! # need to know about the modules that are loaded, their individual ! # configuration elements or how to do validation # # A module calls this method for each separate UI element (normally an --- 3523,3535 ---- # $object Reference to the object calling this method # ! # This seemingly innocent method disguises a lot. The UIREG signal is ! # generated by modules using their inherited register_configuration_item ! # (see POPFile::Module) interface that wish to register that they have ! # specific elements of UI that need to be dynamically added to the ! # Configuration and Security screens of POPFile. The HTML module then ! # 'registers' the modules to receive appropriate callbacks. This is done ! # so that the HTML module does not need to know about the modules that ! # are loaded, their individual configuration elements or how to do ! # validation # # A module calls this method for each separate UI element (normally an Index: XMLRPC.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/XMLRPC.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** XMLRPC.pm 4 Jan 2005 22:51:48 -0000 1.20 --- XMLRPC.pm 25 Feb 2005 21:53:53 -0000 1.21 *************** *** 229,233 **** $self->{server__}->SOAP::Transport::HTTP::Server::handle(); $client->send_response( $self->{server__}->response ); ! } $client->close(); } --- 229,233 ---- $self->{server__}->SOAP::Transport::HTTP::Server::handle(); $client->send_response( $self->{server__}->response ); ! } $client->close(); } *************** *** 284,287 **** --- 284,289 ---- my ( $self, $name, $templ, $language, $form ) = @_; + my ($status, $error); + # Just check to see if the XML rpc port was change and check its value *************** *** 290,298 **** if ( ( $$form{xmlrpc_port} >= 1 ) && ( $$form{xmlrpc_port} < 65536 ) ) { $self->config_( 'port', $$form{xmlrpc_port} ); ! $templ->param( 'XMLRPC_port_if_error' => 0 ); ! $templ->param( 'XMLRPC_port_updated' => sprintf( $$language{Configuration_XMLRPCUpdate}, $self->config_( 'port' ) ) ); ! } ! else { ! $templ->param( 'XMLRPC_port_if_error' => 1 ); } } --- 292,298 ---- if ( ( $$form{xmlrpc_port} >= 1 ) && ( $$form{xmlrpc_port} < 65536 ) ) { $self->config_( 'port', $$form{xmlrpc_port} ); ! $status = sprintf( $$language{Configuration_XMLRPCUpdate}, $self->config_( 'port' ) ); ! } else { ! $error = $$language{Configuration_Error7}; } } *************** *** 303,307 **** } ! return ''; } --- 303,307 ---- } ! return ( $status, $error ); } |