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

raeburn raeburn@source.lon-capa.org
Fri, 23 Oct 2009 17:12:34 -0000


raeburn		Fri Oct 23 17:12:34 2009 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - Bug 6106 - Uploaded docs need inline menu. 
  - Coding style: Replace "unless .. else" with "if ... else"
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.401 loncom/interface/londocs.pm:1.402
--- loncom/interface/londocs.pm:1.401	Thu Oct 22 22:25:36 2009
+++ loncom/interface/londocs.pm	Fri Oct 23 17:12:34 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.401 2009/10/22 22:25:36 raeburn Exp $
+# $Id: londocs.pm,v 1.402 2009/10/23 17:12:34 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2698,7 +2698,9 @@
     if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
        $showdoc='/'.$1;
     }
-    unless ($showdoc) { # got called from remote
+    if ($showdoc) { # got called in sequence from course
+	$allowed=0; 
+    } else {
        if (($env{'form.folder'}=~/^(?:group|default)_/) ||
           ($env{'form.folder'} =~ m:^\d+/(pages|sequences)/:)) {
            $forcestandard = 1;
@@ -2709,8 +2711,6 @@
          &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']);
          $script=&Apache::lonratedt::editscript('simple');
        }
-    } else { # got called in sequence from course
-       $allowed=0;
     }
 
 # subroutine to list form elements
@@ -2769,6 +2769,9 @@
                      'Editing the Table of Contents for your '.$type,
                      'Docs_Adding_Course_Doc')
         );
+    } elsif ($showdoc) {
+        $r->print(&Apache::loncommon::start_page("$type documents",undef,
+                                                {'force_register' => $showdoc,}));
     } else {
         my $folder=$env{'form.folder'};
         if ($folder eq '' || $folder eq 'supplemental') {
@@ -2900,7 +2903,7 @@
                 'file' =>  'File',
                 'title' => 'Title',
                 'comment' => 'Comment',
-                'parse' => 'Upload embedded images/multimedia files if HTML file',
+                'parse' => 'Upload embedded images/multimedia files if HTML file.',
 		'nd' => 'Upload Document',
 		'pm' => 'Published Map',
 		'sd' => 'Special Document',