--- loncom/interface/lonpreferences.pm 2007/05/08 18:26:54 1.103 +++ loncom/interface/lonpreferences.pm 2007/07/05 21:37:38 1.107 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.103 2007/05/08 18:26:54 raeburn Exp $ +# $Id: lonpreferences.pm,v 1.107 2007/07/05 21:37:38 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -562,6 +562,46 @@ sub verify_and_change_icons { } ################################################################ +# Clicker Subroutines # +################################################################ + +sub clickerchanger { + my $r = shift; + my $user = $env{'user.name'}; + my $domain = $env{'user.domain'}; + my %userenv = &Apache::lonnet::get + ('environment',['clickers']); + my $clickers=$userenv{'clickers'}; + $clickers=~s/\,/\n/gs; + my $text=&mt('Enter response device ("clicker") numbers'); + my $change=&mt('Register'); + my $helplink=&Apache::loncommon::help_open_topic('Clicker_Registration', 'Locating your clicker ID'); + $r->print(< + + + + +ENDSCREEN +} + +sub verify_and_change_clicker { + my $r = shift; + my $user = $env{'user.name'}; + my $domain = $env{'user.domain'}; + my $newclickers = $env{'form.clickers'}; + $newclickers=~s/\W+/\,/gs; + $newclickers=~tr/a-z/A-Z/; + $newclickers=~s/^\,//; + $newclickers=~s/\,$//; + &Apache::lonnet::put('environment',{'clickers' => $newclickers}); + &Apache::lonnet::appenv('environment.clickers' => $newclickers); + $r->print(&mt('Registering clickers: [_1]',$newclickers)); +} + +################################################################ # Message Forward # ################################################################ @@ -578,7 +618,7 @@ sub msgforwardchanger { foad => 'Forwarding Address(es)', mnot => 'Message Notification Email Address(es)', chg => 'Change', - email => 'The e-mail address you entered', + email => 'The e-mail address entered in row ', notv => 'is not a valid e-mail address', toen => "To enter multiple addresses, enter one address at a time, click 'Change' and then add the next one", prme => 'Back to preferences menu', @@ -595,28 +635,56 @@ sub msgforwardchanger { my $jscript = qq| |; @@ -634,18 +702,28 @@ ENDMSG my @sortforwards = sort (keys(%allnot)); my $output = &Apache::loncommon::start_data_table(). &Apache::loncommon::start_data_table_header_row(). + ' '. ''.&mt('Action').''. ''.&mt('Notification address').''. - &mt('Messages to forward').''. - &mt('Excerpt retains HTML tags included in message').''. + &mt('Types of message to forward to this address').''. + &mt('Excerpt retains HTML tags in message').''. &Apache::loncommon::end_data_table_header_row(); my $num = 0; + my $counter = 1; foreach my $item (@sortforwards) { $output .= &Apache::loncommon::start_data_table_row(). - ''. - &mt('Delete').''. + ''.$counter.''. + '   '. + ''. ''; + $num.'" onFocus="javascript:address_changes('."'$num'". + ')" />'; my %chk; if (defined($allnot{$item}{'crit'})) { if (defined($allnot{$item}{'reg'})) { @@ -659,7 +737,9 @@ ENDMSG foreach my $type ('all','crit','reg') { $output .= ' '; + '" value="'.$type.'" '.$chk{$type}. + ' onchange="javascript:address_changes('."'$num'".')" />'. + $lt{$type}.' '; } my $htmlon = ''; my $htmloff = ''; @@ -669,11 +749,16 @@ ENDMSG $htmloff = 'checked="checked" '; } $output .= ' '. + '" value="1" '.$htmlon. + ' onchange="javascript:address_changes('."'$num'".')" />'. + &mt('Yes').' '. ''. + $htmloff. ' onchange="javascript:address_changes('."'$num'". +')" />'. + &mt('No').''. &Apache::loncommon::end_data_table_row(); $num ++; + $counter ++; } my %defchk = ( all => 'checked="checked" ', @@ -681,10 +766,12 @@ ENDMSG reg => '', ); $output .= &Apache::loncommon::start_data_table_row(). - ''. - &mt('Add').''. + ''.$counter.''. + ''. ''; + '" onFocus="javascript:new_address('."'$num'".')" />'; foreach my $type ('all','crit','reg') { $output .= '