From: Manni H. <man...@us...> - 2006-07-29 19:44:16
|
Update of /cvsroot/popfile/engine/Services In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29412/Services Modified Files: IMAP.pm Log Message: Make training available from UI. Index: IMAP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** IMAP.pm 29 Jul 2006 17:11:33 -0000 1.25 --- IMAP.pm 29 Jul 2006 19:44:11 -0000 1.26 *************** *** 170,173 **** --- 170,177 ---- 'imap-options.thtml', $self ); + $self->register_configuration_item_( 'configuration', + 'imap_6_training', + 'imap-do-training.thtml', + $self ); # Set the time stamp for the last update to the current time *************** *** 2070,2073 **** --- 2074,2082 ---- $templ->param( IMAP_interval => $self->user_config_( 1, 'update_interval' ) ); } + + # Switch the module to training mode + if ( $name eq 'imap_6_training' ) { + $templ->param( imap_currently_training => $self->user_config_( 1, 'training_mode' ) ); + } } *************** *** 2292,2297 **** } ! $self->SUPER::validate_item( $name, $templ, $language, $form ); } --- 2301,2318 ---- } + if ( $name eq 'imap_6_training' ) { ! if ( defined $$form{do_imap_training} ) { ! $self->user_config_( 1, 'training_mode', 1 ); ! return ( $$language{Imap_DoingTraining}, undef ); ! } ! else { ! return ( undef, undef ); ! } ! } ! ! # If we end up here, we forgot to validate some item. ! $self->log_( 0, "A configuration item has been left unvalidated: $name" ); ! return ( undef, "The item $name is not implemented." ); } *************** *** 2366,2369 **** --- 2387,2392 ---- # And disable training mode so we won't do this again the next time service is called. $self->user_config_( 1, 'training_mode', 0 ); + + $self->log_( 0, "Training finished." ); } |