[LON-CAPA-cvs] cvs: rat / lonpage.pm loncom/html/adm/help/tex Docs_Adding_Pages.tex loncom/interface londocs.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Tue, 14 Sep 2004 01:21:49 -0000


This is a MIME encoded message

--raeburn1095124909
Content-Type: text/plain

raeburn		Mon Sep 13 21:21:49 2004 EDT

  Added files:                 
    /loncom/html/adm/help/tex	Docs_Adding_Pages.tex 

  Modified files:              
    /loncom/interface	londocs.pm 
    /rat	lonpage.pm 
  Log:
  Add/edit/delete composite pages (.page files) via DOCS. Create .sequence and .page files
  immediately when folders or pages are added via DOCS (before items have been added to them) - this 
  allows lonpageflip to work correctly. New help file for Composite Pages. Pages created via
  DOCS stored in /uploaded area may contain uploaded files, resources form RES and simple 
  problems and score upload templates. Other Special documents are not supported.
  
  
--raeburn1095124909
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20040913212149.txt"

Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.141 loncom/interface/londocs.pm:1.142
--- loncom/interface/londocs.pm:1.141	Thu Sep  9 14:56:01 2004
+++ loncom/interface/londocs.pm	Mon Sep 13 21:21:49 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.141 2004/09/09 18:56:01 albertel Exp $
+# $Id: londocs.pm,v 1.142 2004/09/14 01:21:49 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -440,9 +440,31 @@
     my $coursenum = shift;
     my $coursedom = shift;
     my $folder = shift;
+    my $container = shift;
+    my $caller = shift;
     while (@_) {
 	my $name = shift;
 	my $url = shift;
+        if (($url =~ m#^/uploaded/$coursedom/$coursenum/(default_\d+\.)(page|sequence)$#) && ($caller eq 'londocs')) {
+            my $errtext = '';
+            my $fatal = 0;
+            my $newmapstr = '<map>'."\n".
+                            '<resource id="1" src="" type="start"></resource>'."\n".
+                            '<link from="1" to="2" index="1"></link>'."\n".
+                            '<resource id="2" src="" type="finish"></resource>'."\n".
+                            '</map>';
+            $ENV{'form.output'}=$newmapstr;
+            my $home=&Apache::lonnet::homeserver($coursenum,$coursedom);
+            my $result=&Apache::lonnet::finishuserfileupload($coursenum,$coursedom,$home,
+                                                'output',$1.$2);
+            if ($result != m|^/uploaded/|) {
+                $errtext.='Map not saved: A network error occured when trying to save the new map. ';
+                $fatal = 2;
+            }
+            if ($fatal) {
+                return ($errtext,$fatal);
+            }
+        }
 	if ($url) {
 	    my $idx = $#Apache::lonratedt::resources + 1;
 	    $Apache::lonratedt::order[$#Apache::lonratedt::order+1]=$idx;
@@ -454,13 +476,18 @@
 		join ':', ($name, $url, $ext, 'normal', 'res');
 	}
     }
-    return &storemap($coursenum, $coursedom, $folder.'.sequence');
+    return &storemap($coursenum, $coursedom, $folder.'.'.$container);
 }
 
 sub breadcrumbs {
     my ($where)=@_;
     &Apache::lonhtmlcommon::clear_breadcrumbs();
-    my (@folders)=split('&',$ENV{'form.folderpath'});
+    my (@folders);
+    if ($ENV{'form.pagepath'}) {
+        @folders = split('&',$ENV{'form.pagepath'});
+    } else {
+        @folders=split('&',$ENV{'form.folderpath'});
+    }
     my $folderpath;
     while (@folders) {
 	my $folder=shift(@folders);
@@ -488,8 +515,12 @@
     $r->print(&breadcrumbs($folder));
     my $errtext='';
     my $fatal=0;
+    my $container='sequence';
+    if ($ENV{'form.pagepath'}) {
+        $container='page';
+    }
     ($errtext,$fatal)=
-          &mapread($coursenum,$coursedom,$folder.'.sequence');
+              &mapread($coursenum,$coursedom,$folder.'.'.$container);
     if ($#Apache::lonratedt::order<1) {
        	$Apache::lonratedt::order[0]=1;
         $Apache::lonratedt::resources[1]='';
@@ -557,7 +588,7 @@
 		}
 # store the changed version
 
-		($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.sequence');
+		($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container);
 		if ($fatal) {
 		    $r->print('<p><font color="red">'.$errtext.'</font></p>');
 		    return;
@@ -589,7 +620,7 @@
               $Apache::lonratedt::order[$#Apache::lonratedt::order+1]=
                                                               $newidx;       
 
-	      ($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.sequence');
+	      ($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container);
 	      if ($fatal) {
 		  $r->print('<p><font color="red">'.$errtext.'</font></p>');
 		  return;
@@ -623,6 +654,7 @@
                     $Apache::lonratedt::order[$idx]=$i;
 		   }
                 } elsif ($cmd eq 'rename') {
+                    my $ratstr = $Apache::lonratedt::resources[$Apache::lonratedt::order[$idx]];
                     my ($rtitle,@rrest)=split(/\:/,
                        $Apache::lonratedt::resources[
 				       $Apache::lonratedt::order[$idx]]);
@@ -638,7 +670,7 @@
                 }
 # Store the changed version
 		($errtext,$fatal)=&storemap($coursenum,$coursedom,
-					    $folder.'.sequence');
+					    $folder.'.'.$container);
 		if ($fatal) {
 		    $r->print('<p><font color="red">'.$errtext.'</font></p>');
 		    return;
@@ -657,7 +689,7 @@
 		}
 # Store the changed version
 		($errtext,$fatal)=group_import($coursenum, $coursedom, $folder,
-					       @imports);
+					       $container,'londocs',@imports);
 		if ($fatal) {
 		    $r->print('<p><font color="red">'.$errtext.'</font></p>');
 		    return;
@@ -675,7 +707,7 @@
 
 # Store the changed version
 	       ($errtext,$fatal)=&storemap($coursenum,$coursedom,
-					   $folder.'.sequence');
+					   $folder.'.'.$container);
 	       if ($fatal) {
 		   $r->print('<p><font color="red">'.$errtext.'</font></p>');
 		   return;
@@ -709,6 +741,7 @@
      &Apache::lonnet::unescape($title)),'"<>&\'');
     my $renametitle=$title;
     my $foldertitle=$title;
+    my $pagetitle=$title;
     my $orderidx=$Apache::lonratedt::order[$index];
     if ($title=~ /^(\d+)___&amp;&amp;&amp;___(\w+)___&amp;&amp;&amp;___(\w+)___&amp;&amp;&amp;___(.*)$/	) { 
 	$foldertitle=&Apache::lontexconvert::msgtexconverted($4);
@@ -720,11 +753,18 @@
     $renametitle=~s/\&quot\;/\\\"/g;
     my $line='<tr>';
 # Edit commands
+    my $container;
     my $folderpath;
     if ($ENV{'form.folderpath'}) {
+        $container = 'sequence';
 	$folderpath=&Apache::lonnet::escape($ENV{'form.folderpath'});
 	# $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"');
     }
+    my $pagepath;
+    if ($ENV{'form.pagepath'}) {
+        $container = 'page';
+        $pagepath=&Apache::lonnet::escape($ENV{'form.pagepath'});
+    }
     if ($allowed) {
 	my $incindex=$index+1;
 	my $selectbox='';
@@ -746,7 +786,28 @@
 		'dw' => 'Move Down',
 		'rm' => 'Remove',
 		'rn' => 'Rename');
-	$line.=(<<END);
+        if ($ENV{'form.pagepath'}) {
+            $line.=(<<END);
+<form name="entry_$index" action="/adm/coursedocs" method="post">
+<input type="hidden" name="pagepath" value="$ENV{'form.pagepath'}" />
+<input type="hidden" name="setparms" value="$orderidx" />
+<td><table border='0' cellspacing='2' cellpadding='0'>
+<tr><td bgcolor="#DDDDDD">
+<a href='/adm/coursedocs?cmd=up_$index&pagepath=$pagepath'>
+<img src="${iconpath}move_up.gif" alt='$lt{'up'}' border='0' /></a></td></tr>
+<tr><td bgcolor="#DDDDDD">
+<a href='/adm/coursedocs?cmd=down_$index&pagepath=$pagepath'>
+<img src="${iconpath}move_down.gif" alt='$lt{'dw'}' border='0' /></a></td></tr>
+</table></td>
+<td>$selectbox
+</td><td bgcolor="#DDDDDD">
+<a href='javascript:removeres("$pagepath","$index","$renametitle","page");'>
+<font size="-2" color="#990000">$lt{'rm'}</font></a>
+<a href='javascript:changename("$pagepath","$index","$renametitle","page");'>
+<font size="-2" color="#009900">$lt{'rn'}</font></a></td>
+END
+        } else {
+            $line.=(<<END); 
 <form name="entry_$index" action="/adm/coursedocs" method="post">
 <input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
 <input type="hidden" name="setparms" value="$orderidx" />
@@ -760,18 +821,22 @@
 </table></td>
 <td>$selectbox
 </td><td bgcolor="#DDDDDD">
-<a href='javascript:removeres("$folderpath","$index","$renametitle");'>
+<a href='javascript:removeres("$folderpath","$index","$renametitle","sequence");'>
 <font size="-2" color="#990000">$lt{'rm'}</font></a>
-<a href='javascript:changename("$folderpath","$index","$renametitle");'>
+<a href='javascript:changename("$folderpath","$index","$renametitle","sequence");'>
 <font size="-2" color="#009900">$lt{'rn'}</font></a></td>
 END
+        }
     }
 # Figure out what kind of a resource this is
     my ($extension)=($url=~/\.(\w+)$/);
     my $uploaded=($url=~/^\/*uploaded\//);
     my $icon=&Apache::loncommon::icon($url);
     my $isfolder=0;
+    my $ispage=0;
     my $folderarg;
+    my $pagearg;
+    my $pagefile;
     if ($uploaded) {
 	if ($extension eq 'sequence') {
 	    $icon=$iconpath.'/folder_closed.gif';
@@ -779,12 +844,18 @@
 	    $url='/adm/coursedocs?';
 	    $folderarg=$1;
 	    $isfolder=1;
+        } elsif ($extension eq 'page') {
+            $icon=$iconpath.'/page.gif';
+            $url=~/$coursenum\/([\/\w]+)\.page$/;
+            $pagearg=$1;
+            $url='/adm/coursedocs?';
+            $ispage=1;
 	} else {
 	    &Apache::lonnet::allowuploaded('/adm/coursedoc',$url);
 	}
     }
     $url=~s/^http\&colon\;\/\//\/adm\/wrapper\/ext\//;
-    if ((!$isfolder) && ($residx) && ($folder!~/supplemental/)) {
+    if ((!$isfolder) && ($residx) && ($folder!~/supplemental/) && (!$ispage)) {
 	my $symb=&Apache::lonnet::symbclean(
           &Apache::lonnet::declutter('uploaded/'.
            $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}.'/'.
@@ -805,7 +876,9 @@
 		$url='/adm/coursedocs/showdoc'.$url;
 	    }
 	}
-	$url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb);
+        unless ($container eq 'page') {
+	    $url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb);
+        }
     }
     my $parameterset='&nbsp;';
     if ($isfolder) {
@@ -818,6 +891,14 @@
 	    '<input type="text" size="4" name="randpick_'.$orderidx.'" value="'.
 	    (&Apache::lonratedt::getparameter($orderidx,'parameter_randompick'))[0].'" />';
     }
+    if ($ispage) {
+        my $pagename=&Apache::lonnet::escape($pagetitle);
+        my $pagepath;
+        my $folderpath=$ENV{'form.folderpath'};
+        if ($folderpath) { $pagepath = $folderpath.'&' };
+        $pagepath.=$pagearg.'&'.$pagename;
+        $url.='pagepath='.&Apache::lonnet::escape($pagepath);
+    }
     $line.='<td bgcolor="#FFFFBB"><a href="'.$url.'"><img src="'.$icon.
 	'" border="0"></a></td>'.
         "<td bgcolor='#FFFFBB'><a href='$url'>$title</a></td>";
@@ -1271,7 +1352,7 @@
   foreach ('Adding_Course_Doc','Main_Course_Documents',
            'Adding_External_Resource','Navigate_Content',
            'Adding_Folders','Docs_Overview', 'Load_Map',
-           'Supplemental', 'Score_Upload_Form',
+           'Supplemental','Score_Upload_Form','Adding_Pages',
            'Importing_LON-CAPA_Resource','Uploading_From_Harddrive',
 	   'Check_Resource_Versions','Verify_Content') {
       $help{$_}=&Apache::loncommon::help_open_topic('Docs_'.$_);
@@ -1288,7 +1369,7 @@
     $help{'My Personal Info'} = &Apache::loncommon::help_open_topic(
 		  'Docs_About_My_Personal_Info,Docs_Editing_Templated_Pages');
     $help{'Caching'} = &Apache::loncommon::help_open_topic('Caching');
- 
+
   if ($ENV{'form.verify'}) {
       &verifycontent($r);
   } elsif ($ENV{'form.versions'}) {
@@ -1307,13 +1388,22 @@
     my $allowed;
     my $events='';
     my $showdoc=0;
+    my $containertag;
+    my $uploadtag;
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
-					    ['folderpath']);
+					    ['folderpath','pagepath']);
     if ($ENV{'form.folderpath'}) {
 	my (@folderpath)=split('&',$ENV{'form.folderpath'});
 	$ENV{'form.foldername'}=&Apache::lonnet::unescape(pop(@folderpath));
 	$ENV{'form.folder'}=pop(@folderpath);
-    } 
+    }
+    if ($ENV{'form.pagepath'}) {
+        my (@pagepath)=split('&',$ENV{'form.pagepath'});
+        $ENV{'form.pagename'}=&Apache::lonnet::unescape(pop(@pagepath));
+        $ENV{'form.folder'}=pop(@pagepath);
+        $containertag = '<input type="hidden" name="pagepath" value="" />';
+        $uploadtag = '<input type="hidden" name="pagepath" value="'.$ENV{'form.pagepath'}.'" />';
+    }
     if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
        $showdoc='/'.$1;
     }
@@ -1371,6 +1461,14 @@
     }
 }
 
+function makenewpage(targetform,folderseq) {
+    var pagename=prompt('Name of New Page','New Page');
+    if (pagename) {
+        targetform.importdetail.value=pagename+"="+folderseq;
+        targetform.submit();
+    }
+}
+
 function makenewext(targetname) {
     this.document.forms.extimport.useform.value=targetname;
     window.open('/adm/rat/extpickframe.html');
@@ -1444,20 +1542,30 @@
     '";this.document.forms.'+form+'.submit();');
 }
 
-function changename(folderpath,index,oldtitle) {
+function changename(folderpath,index,oldtitle,container) {
     var title=prompt('New Title',oldtitle);
     if (title) {
 	this.document.forms.renameform.title.value=title;
 	this.document.forms.renameform.cmd.value='rename_'+index;
-	this.document.forms.renameform.folderpath.value=folderpath;
+        if (container == 'sequence') {
+	    this.document.forms.renameform.folderpath.value=folderpath;
+        }
+        if (container == 'page') {
+            this.document.forms.renameform.pagepath.value=folderpath;
+        }
         this.document.forms.renameform.submit();
     }
 }
 
-function removeres(folderpath,index,oldtitle) {
+function removeres(folderpath,index,oldtitle,container) {
     if (confirm('Remove "'+oldtitle+'"?')) {
 	this.document.forms.renameform.cmd.value='del_'+index;
-	this.document.forms.renameform.folderpath.value=folderpath;
+        if (container == 'sequence') {
+            this.document.forms.renameform.folderpath.value=folderpath;
+        }
+        if (container == 'page') {
+            this.document.forms.renameform.pagepath.value=folderpath;
+        }
         this.document.forms.renameform.submit();
     }
 }
@@ -1484,6 +1592,7 @@
                 'selm' => 'Select Map',
                 'load' => 'Load Map',
                 'newf' => 'New Folder',
+                'newp' => 'New Composite Page',
                 'extr' => 'External Resource',
                 'syll' => 'Syllabus',
                 'navc' => 'Navigate Contents',
@@ -1515,15 +1624,20 @@
 		   &Apache::lonnet::escape(&mt('Main Course Documents'));
 	   }
        }
+       unless ($ENV{'form.pagepath'}) {
+           $containertag = '<input type="hidden" name="folderpath" value="" />';
+           $uploadtag = '<input type="hidden" name="folderpath" value="'.$folderpath.'" />';
+       }
+
        $r->print(<<ENDCOURSEVERIFY);
 <form name="renameform" method="post" action="/adm/coursedocs">
 <input type="hidden" name="title" />
 <input type="hidden" name="cmd" />
-<input type="hidden" name="folderpath" />
+$containertag
 </form>
 <form name="simpleedit" method="post" action="/adm/coursedocs">
 <input type=hidden name="importdetail" value="">
-<input type="hidden" name="folderpath" value="$folderpath" />
+$uploadtag
 </form>
 <form action="/adm/coursedocs" method="post" name="courseverify">
 <table bgcolor="#AAAAAA" width="100%" cellspacing="4" cellpadding="4">
@@ -1564,6 +1678,9 @@
        &changewarning($r,$postexec);
        my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
                      '.sequence';
+       my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
+                     '.page';
+
        $r->print(<<ENDFORM);
 <table cellspacing=4 cellpadding=4><tr>
 <th bgcolor="#DDDDDD">$lt{'uplm'}</th>
@@ -1577,7 +1694,7 @@
 <br />
 $lt{'title'}:<br />
 <input type="text" size="50" name="comment">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+$uploadtag
 <input type="hidden" name="cmd" value="upload_default">
 <nobr>
 <input type="submit" value="$lt{'upld'}">
@@ -1587,7 +1704,7 @@
 </td>
 <td bgcolor="#DDDDDD">
 <form action="/adm/coursedocs" method="post" name="simpleeditdefault">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+$uploadtag
 <input type=button onClick="javascript:groupsearch()" value="$lt{'srch'}">
 <nobr>
 <input type=button onClick="javascript:groupimport();" value="$lt{'impo'}">
@@ -1602,7 +1719,11 @@
 $help{'Load_Map'}</nobr>
 </p>
 </form>
-</td><td bgcolor="#DDDDDD">
+</td>
+<td bgcolor="#DDDDDD">
+ENDFORM
+       unless ($ENV{'form.pagepath'}) {
+           $r->print(<<ENDFORM);
 <form action="/adm/coursedocs" method="post" name="newfolder">
 <input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
 <input type=hidden name="importdetail" value="">
@@ -1612,16 +1733,25 @@
 value="$lt{'newf'}" />$help{'Adding_Folders'}
 </nobr>
 </form>
-<form action="/adm/coursedocs" method="post" name="newext">
+<form action="/adm/coursedocs" method="post" name="newpage">
 <input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
 <input type=hidden name="importdetail" value="">
 <nobr>
+<input name="newpage" type="button"
+onClick="javascript:makenewpage(this.form,'$pageseq');"
+value="$lt{'newp'}" />$help{'Adding_Pages'}
+</nobr>
+</form>
+<form action="/adm/coursedocs" method="post" name="newext">
+$uploadtag
+<input type=hidden name="importdetail" value="">
+<nobr>
 <input name="newext" type="button" onClick="javascript:makenewext('newext');"
 value="$lt{'extr'}" /> $help{'Adding_External_Resource'}
 </nobr>
 </form>
 <form action="/adm/coursedocs" method="post" name="newsyl">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+$uploadtag
 <input type=hidden name="importdetail" 
 value="Syllabus=/public/$coursedom/$coursenum/syllabus">
 <nobr>
@@ -1630,7 +1760,7 @@
 </nobr>
 </form>
 <form action="/adm/coursedocs" method="post" name="newnav">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+$uploadtag
 <input type=hidden name="importdetail" 
 value="Navigate Content=/adm/navmaps">
 <nobr>
@@ -1639,7 +1769,7 @@
 </nobr>
 </form>
 <form action="/adm/coursedocs" method="post" name="newsmppg">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+$uploadtag
 <input type=hidden name="importdetail" value="">
 <nobr>
 <input name="newsmppg" type="button" value="$lt{'sipa'}"
@@ -1647,7 +1777,7 @@
 </nobr>
 </form>
 <form action="/adm/coursedocs" method="post" name="newsmpproblem">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+$uploadtag
 <input type=hidden name="importdetail" value="">
 <nobr>
 <input name="newsmpproblem" type="button" value="$lt{'sipr'}"
@@ -1655,7 +1785,7 @@
 </nobr>
 </form>
 <form action="/adm/coursedocs" method="post" name="newexamupload">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+$uploadtag
 <input type=hidden name="importdetail" value="">
 <nobr>
 <input name="newexamupload" type="button" value="$lt{'scuf'}"
@@ -1664,7 +1794,7 @@
 </nobr>
 </form>
 <form action="/adm/coursedocs" method="post" name="newbul">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+$uploadtag
 <input type=hidden name="importdetail" value="">
 <nobr>
 <input name="newbulletin" type="button" value="$lt{'bull'}"
@@ -1673,7 +1803,7 @@
 </nobr>
 </form>
 <form action="/adm/coursedocs" method="post" name="newaboutme">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+$uploadtag
 <input type=hidden name="importdetail" 
 value="$plainname=/adm/$udom/$uname/aboutme">
 <nobr>
@@ -1682,21 +1812,46 @@
 </nobr>
 </form>
 <form action="/adm/coursedocs" method="post" name="newaboutsomeone">
-<input type="hidden" name="folderpath" value="$ENV{'form.folderpath'}" />
+$uploadtag
 <input type=hidden name="importdetail" value="">
 <nobr>
 <input name="newaboutsomeone" type="button" value="$lt{'abou'}" 
 onClick="javascript:makeabout();" />
 </nobr>
+ENDFORM
+       }
+       if ($ENV{'form.pagepath'}) {
+           $r->print(<<ENDBLOCK);
+<form action="/adm/coursedocs" method="post" name="newsmpproblem">
+$uploadtag
+<input type=hidden name="importdetail" value="">
+<nobr>
+<input name="newsmpproblem" type="button" value="$lt{'sipr'}"
+onClick="javascript:makesmpproblem();" />$help{'Simple Problem'}
+</nobr>
+</form>
+<form action="/adm/coursedocs" method="post" name="newexamupload">
+$uploadtag
+<input type=hidden name="importdetail" value="">
+<nobr>
+<input name="newexamupload" type="button" value="$lt{'scuf'}"
+onClick="javascript:makeexamupload();" />
+$help{'Score_Upload_Form'}
+</nobr>
+</form>
+ENDBLOCK
+       } else {
+           $r->print(<<ENDFORM);
 </form>
 <form action="/adm/imsimportdocs" method="post" name="ims">
 <input type="hidden" name="folder" value="$folder" />
 <input name="imsimport" type="button" value="$lt{'imsf'}" onClick="javascript:makeims();" />
 </nobr>
 </form>
-</td></tr>
-</table>
 ENDFORM
+       }
+       $r->print('</td></tr>'."\n".
+'</table>');
        $r->print('</td></tr>');
     }
 # ----------------------------------------------------- Supplemental documents
Index: rat/lonpage.pm
diff -u rat/lonpage.pm:1.59 rat/lonpage.pm:1.60
--- rat/lonpage.pm:1.59	Sun Aug 29 15:25:34 2004
+++ rat/lonpage.pm	Mon Sep 13 21:21:49 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Page Handler
 #
-# $Id: lonpage.pm,v 1.59 2004/08/29 19:25:34 raeburn Exp $
+# $Id: lonpage.pm,v 1.60 2004/09/14 01:21:49 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -424,19 +424,24 @@
                           my $avespan=$lcm/($#colcont+1);
                           for ($j=0;$j<=$#colcont;$j++) {
                               my $rid=$colcont[$j];
-                              my $metainfo='<a name="'.
-				  &Apache::lonnet::escape(&Apache::lonnet::declutter($hash{'src_'.$rid})).'" />'.
-				  '<a href="'.
-                                    $metalink{$rid}.'" target="LONcatInfo">'.
-                          '<img src="/adm/lonMisc/cat_button.gif" border=0>'.
-			  '</img></a><a href="/adm/evaluate?postdata='.
-      &Apache::lonnet::escape(&Apache::lonnet::declutter($hash{'src_'.$rid}))
-      .'" target="LONcatInfo">'.
-                          '<img src="/adm/lonMisc/eval_button.gif" border=0>'.
-                          '</img></a>';
+                              my $metainfo = '';
+                              print STDERR "src is $hash{'src_'.$rid}\n";
+                              unless ($hash{'src_'.$rid} =~ m-^/uploaded/-) { 
+                                  $metainfo ='<a name="'.
+	&Apache::lonnet::escape(&Apache::lonnet::declutter($hash{'src_'.$rid})).'" />'.
+                                  '<a href="'.$metalink{$rid}.'" target="LONcatInfo">'.
+                                  '<img src="/adm/lonMisc/cat_button.gif" border=0>'.
+                                  '</img></a>';
+                              }
+                              $metainfo .= '<a href="/adm/evaluate?postdata='.
+	&Apache::lonnet::escape(&Apache::lonnet::declutter($hash{'src_'.$rid})).
+                                  '" target="LONcatInfo">'.
+                                  '<img src="/adm/lonMisc/eval_button.gif" border=0>'.
+                                  '</img></a>';
                               if (
  ($hash{'src_'.$rid}=~/\.(problem|exam|quiz|assess|survey|form)$/) &&
- (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'}))) {
+ (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && 
+ ($hash{'src_'.$rid} !~ m-^/uploaded/-)) {
 				  my ($mapid,$resid)=split(/\./,$rid);
                                  my $symb=
                 &Apache::lonnet::declutter($hash{'map_id_'.$mapid}).
@@ -504,6 +509,10 @@
 			      } elsif ($cellemb{$rid} eq 'emb') {
                                   $r->print('>'.$metainfo.'<embed src="'.
                                     $hash{'src_'.$rid}.'"></embed>');
+                              } elsif (&Apache::lonnet::declutter($hash{'src_'.$rid}) !~/\.(sequence|page)$/) {
+                                  $r->print($metainfo.'<b>'.$hash{'title_'.$rid}.'</b><br />'.
+                                  &mt('It is recommended that you use an up-to-date virus scanner before handling this file.').'</p><p><table>'.
+                                  &Apache::londocs::entryline(0,&mt("Click to download or use your browser's Save Link function"),'/'.&Apache::lonnet::declutter($hash{'src_'.$rid})).'</table></p><br />');
                               }
 			      unless ($target eq 'tex') {
 				  $r->print('</td>');

Index: loncom/html/adm/help/tex/Docs_Adding_Pages.tex
+++ loncom/html/adm/help/tex/Docs_Adding_Pages.tex
\label{Docs_Adding_Pages}
You can add composite pages to your \textbf{Course Document} screen to
combine separate content items together for display in a single web page. 
Composite pages can contain uploaded files, homework problems imported
from the resource repository, and/or simple problems created using the 
problem editor. To add a composite page to your course, do the following:

\begin{itemize}

\item Log in to the course to which you wish to add a page.
\item Click \textbf{DOCS} on the remote control.
\item In the \textbf{Course Documents} screen, click the \textbf{New
Composite Page}  button in the \textbf{Special documents} column. 
\item In the pop up window, type the name of the new page and click OK.

The page will appear at the bottom of the course document area to which you added it.

\item To add resources to the page, click on the page you created.

\end{itemize}

Th course document screen will refresh, and the updated display will 
include the name of the new page appended to the end of the breadcrumb 
trail, that extends to the right of the \textbf{Main Course Documents} label.
The page is currently empty. Add new resources to the page as you would 
add resources to a Folder or to the "top-level" Course Documents area
(\ref{Docs_Adding_Course_Doc}), 
except that only a subset of the "Special documents" that may be  
placed in a folder, can be placed in a composite page. Also, if you use 
"Import" to include a published sequence in a page, then when the page is 
displayed the sequence will be opened and all of its contents will appear as 
elements of the composite page (i.e., no "folder" will appear in the page). 
If you wish to be able to hide selected elements from the sequence, you should 
use "Select Map" and "Load Map" to unpack the sequence prior to import. 

Note: Your new composite page will be active the next time you log in, or 
after clicking the \textbf{re-initializing course} button on the course
document screen, whichever comes first.

--raeburn1095124909--