[LON-CAPA-cvs] cvs: loncom /interface groupboards.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 30 Jun 2006 14:08:35 -0000


albertel		Fri Jun 30 10:08:35 2006 EDT

  Modified files:              
    /loncom/interface	groupboards.pm 
  Log:
  - style
  
  
Index: loncom/interface/groupboards.pm
diff -u loncom/interface/groupboards.pm:1.1 loncom/interface/groupboards.pm:1.2
--- loncom/interface/groupboards.pm:1.1	Fri Jun 30 04:14:31 2006
+++ loncom/interface/groupboards.pm	Fri Jun 30 10:08:35 2006
@@ -25,7 +25,7 @@
 #
 
 package Apache::groupboards;
-                                                                                
+
 use strict;
 use Apache::Constants qw(:common :http);
 use Apache::loncommon;
@@ -73,9 +73,8 @@
     if (defined($env{'form.newbul'})) {
         if (($can_create) || (&Apache::lonnet::allowed('mdg',$env{'request.course.id'}))) {
             $r->print(&Apache::loncommon::start_page($bodytitle));
-            my ($outcome,$symb,$newurl,$bbtitle) = &create_board($cdom,$cnum,
-                                                                 $group,
-                                                          $env{'form.newbul'});
+            my ($outcome,$symb,$newurl,$bbtitle) = 
+		&create_board($cdom,$cnum,$group,$env{'form.newbul'});
             if ($outcome eq 'ok') {
                 my ($furl,$ferr)= &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
                 $r->print(&mt('The new discussion board was added successfully.<br />'));
@@ -88,7 +87,7 @@
                           &mt('View all group discussion boards').
                           '</a></td></tr></table>');
             } else {
-                $r->print(&mt('There was a problem creating the new discussion board - [_1]',$outcome).'<br /><a href="/adm/groupboards?group='.$group.'">'.
+                $r->print(&mt('There was a problem creating the new discussion board - [_1]','<span class="LC_error">'.$outcome.'</span>').'<br /><a href="/adm/groupboards?group='.$group.'">'.
                          &mt('Return to discussion boards').'</a>');
             }
             $r->print(&Apache::loncommon::end_page());
@@ -125,14 +124,12 @@
             my @boards = $navmap->retrieveResources($bbfolderres,undef,0,0);
             foreach my $res (@boards) {
                 my $url = $res->src();
-                my $title = $res->title();
-                my $symb = $res->symb();
                 if ($url =~ m|^/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard|) {
-                    push(@groupboards,$symb);
-                    %{$boards{$symb}} = (
-                                        title => $title,
-                                        url => $url,
-                                     );
+                    push(@groupboards,$res->symb());
+                    $boards{$res->symb()} = {
+                                        title => $res->title(),
+                                        url   => $res->src(),
+				    };
                 }
             }
         }
@@ -148,7 +145,7 @@
     }
     if (@groupboards) {
         foreach my $board (@groupboards) {
-            $r->print('<a href="'.$boards{$board}{'url'}.'?register=1&symb='.$board.'&group='.$group.'">'.$boards{$board}{'title'}.'</a><br />');
+            $r->print('<a href="'.$boards{$board}{'url'}.'?register=1&amp;symb='.$board.'&amp;group='.$group.'">'.$boards{$board}{'title'}.'</a><br />');
         }
     } else {
         $r->print(&mt('There are currently no discussion boards in this [_1].',
@@ -171,19 +168,19 @@
             my $newidx=&Apache::lonratedt::getresidx($newurl);
             $Apache::lonratedt::resources[$newidx]=$bbtitle.':'.$newurl.
                                                    ':false:normal:res';
-            $Apache::lonratedt::order[1+$#Apache::lonratedt::order]=$newidx;
+            push(@Apache::lonratedt::order,$newidx);
             my ($errtext,$fatal)=&Apache::lonratedt::storemap($allbbsmap,1);
             if ($fatal) {
-                $outcome = "Error: failed to store discussion boards map - $errtext\n";
+                $outcome = "error: failed to store discussion boards map - $errtext\n";
             } else {
                 $outcome = 'ok';
                 $symb = &Apache::lonnet::encode_symb($allbbsmap,$newidx,$newurl);
             }
         } else {
-            $outcome = "Error: failed to read all discussion boards map - $errtext\n";
+            $outcome = "error: failed to read all discussion boards map - $errtext\n";
         }
     } else {
-        $outcome = 'Error: discussion boards folder absent, '.
+        $outcome = 'error: discussion boards folder absent, '.
                    'or in unexpected location - '.$allbbsmap."\n";
     }
     return ($outcome,$symb,$newurl,$bbtitle);