--- loncom/interface/groupboards.pm 2006/07/20 15:51:10 1.8 +++ loncom/interface/groupboards.pm 2012/07/21 21:20:06 1.15 @@ -1,6 +1,8 @@ # The LearningOnline Network # Group Bulletin Boards Manager # +# $Id: groupboards.pm,v 1.15 2012/07/21 21:20:06 raeburn Exp $ +# # Copyright Michigan State University Board of Trustees # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). @@ -28,10 +30,10 @@ package Apache::groupboards; use strict; use Apache::Constants qw(:common :http); -use Apache::loncommon; +use Apache::loncommon(); use Apache::lonnet; -use Apache::lonuserstate; -use Apache::lonratedt; +use Apache::lonuserstate(); +use LONCAPA::map(); use Apache::lonlocal; use LONCAPA; @@ -59,7 +61,7 @@ sub handler { my $gpterm = &Apache::loncommon::group_term(); my $ucgpterm = $gpterm; $ucgpterm =~ s/^(\w)/uc($1)/e; - my $bodytitle = &mt('[_1] Discussion Boards',$crstype); + my $bodytitle = $ucgpterm.' Discussion Boards'; my $group = $env{'form.group'}; $group =~ s/\W//g; my ($description,$earlyout,$refarg); @@ -155,7 +157,12 @@ function makebulboard() { "\n".'
'); } if (@{$groupboards} > 0) { - $r->print('
'); + $r->print('
' + .&Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table_header_row() + .''.&mt('Discussion Boards').'' + .&Apache::loncommon::end_data_table_header_row() + ); foreach my $board (@{$groupboards}) { my $board_url = $$boards{$board}{'url'}; if ($board_url =~ /\?/) { @@ -163,12 +170,20 @@ function makebulboard() { } else { $board_url .= '?group='.$group; } - $r->print(''. - $$boards{$board}{'title'}.'
'); + $r->print(&Apache::loncommon::start_data_table_row() + .'' + .'' + .$$boards{$board}{'title'}.'' + .'' + .&Apache::loncommon::end_data_table_row() + ); } + $r->print(&Apache::loncommon::end_data_table()); } else { - $r->print('
'.&mt('There are currently no discussion boards in this [_1].', - $gpterm)); + $r->print('

' + .&mt('There are currently no discussion boards in this '.$gpterm.'.',) + .'

' + ); } $r->print(&Apache::loncommon::end_page()); return OK; @@ -207,7 +222,7 @@ sub create_board { my $putresult = &Apache::lonnet::put('nohist_groupboards',\%new_board, $cdom,$cnum); if ($putresult ne 'ok') { - $outcome = 'error storing new board: '.$putresult; + $outcome = 'error saving new board: '.$putresult; } else { $newurl = '/adm/'.$cdom.'/'.$cnum.'/'.$boardid. '/bulletinboard'; @@ -230,15 +245,15 @@ sub create_board { # if not - add it as an item in group_folder_$group.sequence my $allbbsmap = &Apache::longroup::get_bbfolder_url($cdom,$cnum,$group); if ($allbbsmap =~ m|^/uploaded|) { - my ($errtext,$fatal)=&Apache::lonratedt::mapread($allbbsmap); + my ($errtext,$fatal)=&LONCAPA::map::mapread($allbbsmap); if (!$fatal) { - my $newidx=&Apache::lonratedt::getresidx($newurl); - $Apache::lonratedt::resources[$newidx]=$bbtitle.':'.$newurl. + my $newidx=&LONCAPA::map::getresidx($newurl); + $LONCAPA::map::resources[$newidx]=$bbtitle.':'.$newurl. ':false:normal:res'; - push(@Apache::lonratedt::order,$newidx); - my ($errtext,$fatal)=&Apache::lonratedt::storemap($allbbsmap,1); + push(@LONCAPA::map::order,$newidx); + my ($errtext,$fatal)=&LONCAPA::map::storemap($allbbsmap,1,1); if ($fatal) { - $outcome = "error: failed to store discussion boards map - $errtext\n"; + $outcome = "error: failed to save discussion boards map - $errtext\n"; } else { my %boardinfo = ( 'group' => $group,