[LON-CAPA-cvs] cvs: rat / lonuserstate.pm loncom/interface lonbulletin.pm lonsimplepage.pm loncom/xml lonxml.pm

www lon-capa-cvs@mail.lon-capa.org
Tue, 10 Sep 2002 20:53:37 -0000


This is a MIME encoded message

--www1031691217
Content-Type: text/plain

www		Tue Sep 10 16:53:37 2002 EDT

  Modified files:              
    /loncom/interface	lonbulletin.pm lonsimplepage.pm 
    /loncom/xml	lonxml.pm 
    /rat	lonuserstate.pm 
  Log:
  Continuing work on simple pages and ad hoc bulletin boards.
  
  Simple pages sort of work, bulletin boards not yet.
  
  
--www1031691217
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20020910165337.txt"

Index: loncom/interface/lonbulletin.pm
diff -u loncom/interface/lonbulletin.pm:1.1 loncom/interface/lonbulletin.pm:1.2
--- loncom/interface/lonbulletin.pm:1.1	Tue Sep 10 15:01:53 2002
+++ loncom/interface/lonbulletin.pm	Tue Sep 10 16:53:36 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
-# Bulletin Board
+# Simple Page Editor
 #
-# $Id: lonbulletin.pm,v 1.1 2002/09/10 19:01:53 www Exp $
+# $Id: lonbulletin.pm,v 1.2 2002/09/10 20:53:36 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -47,7 +47,7 @@
 <title>The LearningOnline Network with CAPA</title>
 </head>
 ENDDOCUMENT
-    my (undef,undef,$marker)=split(/\//,$r->uri);
+    my (undef,undef,undef,undef,$marker)=split(/\//,$r->uri);
 # Is this even in a course?
     unless ($ENV{'request.course.id'}) {
 	$r->print('<body>Not in a course</body>');
@@ -66,8 +66,8 @@
 
 # --------------------------------------------------------- The syllabus fields
     my %syllabusfields=(
-       'aaa_title'         => 'Page Title',
-       'bbb_content'       => 'Content',
+       'aaa_title'         => 'Topic',
+       'bbb_content'       => 'Task',
        'ccc_webreferences' => 'Web References');
 
 # --------------------------------------------------------------- Force Student
@@ -81,7 +81,7 @@
 # --------------------------------------- There is such a user, get environment
 
     $r->print(&Apache::loncommon::bodytag
-        ("Bulletin Board ".$syllabus{'aaa_title'},$forcestudent,'','',$dom));
+            ("Bulletin Board/Discussion",$forcestudent,'','',$dom));
 
     my $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'});
 
@@ -134,13 +134,26 @@
               $message
              =~s/(http\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g;
 	      $message=&Apache::lontexconvert::msgtexconverted($message);
-              $r->print('<h3>'.$syllabusfields{$_}.'</h3><blockquote>'.
+            unless ($_ eq 'aaa_title') {
+		if (($_ ne 'bbb_content') || ($allowed)) {
+                    $r->print('<h3>'.$syllabusfields{$_}.'</h3>');
+		}
+                 $r->print('<blockquote>'.
                         $message.'</blockquote>');
-              if ($allowed) {
-                 $r->print('<br /><textarea cols="80" rows="6" name="'.$_.'">'.
+                 if ($allowed) {
+                $r->print('<br /><textarea cols="80" rows="20" name="'.$_.'">'.
 			   $syllabus{$_}.
            '</textarea><input type="submit" name="storesyl" value="Store" />');
-	      }
+	        }
+	    } else {
+		$r->print('<h1>'.$message.'</h1>');
+                if ($allowed) {
+                 $r->print(
+                '<br />Topic<br /><textarea cols="80" rows="2" name="'.$_.'">'.
+			   $syllabus{$_}.
+           '</textarea><input type="submit" name="storesyl" value="Store" />');
+                }
+            }
 	  }
        }
        if ($allowed) {
@@ -150,7 +163,8 @@
     } else {
        $r->print('<p>No page information provided.</p>');
     }
-    $r->print('</body></html>');
+    $r->print(&Apache::lonxml::xmlend(1,'bulletin___'.$marker.'___'.
+             'adm/wrapper'.$r->uri).'</body></html>');
     return OK;
 } 
 
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.1 loncom/interface/lonsimplepage.pm:1.2
--- loncom/interface/lonsimplepage.pm:1.1	Tue Sep 10 15:01:53 2002
+++ loncom/interface/lonsimplepage.pm	Tue Sep 10 16:53:36 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Page Editor
 #
-# $Id: lonsimplepage.pm,v 1.1 2002/09/10 19:01:53 www Exp $
+# $Id: lonsimplepage.pm,v 1.2 2002/09/10 20:53:36 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -47,7 +47,7 @@
 <title>The LearningOnline Network with CAPA</title>
 </head>
 ENDDOCUMENT
-    my (undef,undef,$marker)=split(/\//,$r->uri);
+    my (undef,undef,undef,undef,$marker)=split(/\//,$r->uri);
 # Is this even in a course?
     unless ($ENV{'request.course.id'}) {
 	$r->print('<body>Not in a course</body>');
@@ -81,7 +81,7 @@
 # --------------------------------------- There is such a user, get environment
 
     $r->print(&Apache::loncommon::bodytag
-            ("Course Page ".$syllabus{'aaa_title'},$forcestudent,'','',$dom));
+            ("Course Page",$forcestudent,'','',$dom));
 
     my $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'});
 
@@ -134,13 +134,26 @@
               $message
              =~s/(http\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g;
 	      $message=&Apache::lontexconvert::msgtexconverted($message);
-              $r->print('<h3>'.$syllabusfields{$_}.'</h3><blockquote>'.
+            unless ($_ eq 'aaa_title') {
+		if (($_ ne 'bbb_content') || ($allowed)) {
+                    $r->print('<h3>'.$syllabusfields{$_}.'</h3>');
+		}
+                 $r->print('<blockquote>'.
                         $message.'</blockquote>');
-              if ($allowed) {
-                 $r->print('<br /><textarea cols="80" rows="6" name="'.$_.'">'.
+                 if ($allowed) {
+                $r->print('<br /><textarea cols="80" rows="20" name="'.$_.'">'.
 			   $syllabus{$_}.
            '</textarea><input type="submit" name="storesyl" value="Store" />');
-	      }
+	        }
+	    } else {
+		$r->print('<h1>'.$message.'</h1>');
+                if ($allowed) {
+                 $r->print(
+                '<br />Title<br /><textarea cols="80" rows="2" name="'.$_.'">'.
+			   $syllabus{$_}.
+           '</textarea><input type="submit" name="storesyl" value="Store" />');
+                }
+            }
 	  }
        }
        if ($allowed) {
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.193 loncom/xml/lonxml.pm:1.194
--- loncom/xml/lonxml.pm:1.193	Wed Sep  4 17:01:33 2002
+++ loncom/xml/lonxml.pm	Tue Sep 10 16:53:36 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.193 2002/09/04 21:01:33 albertel Exp $
+# $Id: lonxml.pm,v 1.194 2002/09/10 20:53:36 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -154,6 +154,7 @@
 }
 
 sub xmlend {
+    my ($discussiononly,$symb)=@_;
     my $discussion='';
     if ($ENV{'request.course.id'}) {
        my $crs='/'.$ENV{'request.course.id'};
@@ -162,14 +163,18 @@
        }                 
        $crs=~s/\_/\//g;
        my $seeid=&Apache::lonnet::allowed('rin',$crs);
-       my $symb=&Apache::lonnet::symbread();
+       unless ($symb) {
+           $symb=&Apache::lonnet::symbread();
+       }
        if ($symb) {
           my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},
                      $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
 		     $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
           if ($contrib{'version'}) {
-              $discussion.=
-                  '<address><hr /><h2>Course Discussion of Resource</h2>';
+              unless ($discussiononly) {
+                 $discussion.=
+                  '<address><hr />';
+	     }
               my $idx;
               for ($idx=1;$idx<=$contrib{'version'};$idx++) {
 		my $hidden=($contrib{'hidden'}=~/\.$idx\./);
@@ -183,7 +188,10 @@
                   }
                   my $sender='Anonymous';
                   if ((!$contrib{$idx.':anonymous'}) || ($seeid)) {
-                      $sender=$contrib{$idx.':plainname'}.' ('.
+                      $sender=&Apache::loncommon::aboutmewrapper(
+                               $contrib{$idx.':plainname'},
+                               $contrib{$idx.':sendername'},
+                               $contrib{$idx.':senderdomain'}).' ('.
                               $contrib{$idx.':sendername'}.' at '.
 		      $contrib{$idx.':senderdomain'}.')';
                       if ($contrib{$idx.':anonymous'}) {
@@ -211,11 +219,16 @@
 	        }
                } 
               }
-              $discussion.='</address>';
+              unless ($discussiononly) {
+                 $discussion.='</address>';
+	      }
+          }
+          if ($discussiononly) {
+	      $discussion.='<h1>'.$symb.'</h1>';
           }
        }
     }
-    return $discussion.'</html>';
+    return $discussion.($discussiononly?'':'</html>');
 }
 
 sub tokeninputfield {
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.42 rat/lonuserstate.pm:1.43
--- rat/lonuserstate.pm:1.42	Fri Sep  6 11:18:23 2002
+++ rat/lonuserstate.pm	Tue Sep 10 16:53:37 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construct and maintain state and binary representation of course for user
 #
-# $Id: lonuserstate.pm,v 1.42 2002/09/06 15:18:23 www Exp $
+# $Id: lonuserstate.pm,v 1.43 2002/09/10 20:53:37 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -129,8 +129,7 @@
                             }
                         } else { # normal internal resource
                            if (($embstyle eq 'img') || ($embstyle eq 'emb')
-                          || ($turi=~/\/syllabus$/) || ($turi=~/\/aboutme$/)
-                          || ($turi=~/\/navmaps$/)) {
+             || ($turi=~/\/(syllabus|aboutme|navmaps|smppg|bulletinboard)$/)) {
 			       $turi='/adm/wrapper'.$turi;
                            }
                         }

--www1031691217--