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

raeburn raeburn at source.lon-capa.org
Wed Dec 12 23:15:30 EST 2012


raeburn		Thu Dec 13 04:15:30 2012 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	londocs.pm 
  Log:
  - For 2.11
    - Backport 1.509
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.484.2.17 loncom/interface/londocs.pm:1.484.2.18
--- loncom/interface/londocs.pm:1.484.2.17	Thu Dec 13 04:11:51 2012
+++ loncom/interface/londocs.pm	Thu Dec 13 04:15:30 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.484.2.17 2012/12/13 04:11:51 raeburn Exp $
+# $Id: londocs.pm,v 1.484.2.18 2012/12/13 04:15:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -312,61 +312,6 @@
     return &storemap($coursenum, $coursedom, $folder.'.'.$container,1);
 }
 
-sub breadcrumbs {
-    my ($allowed,$crstype)=@_;
-    &Apache::lonhtmlcommon::clear_breadcrumbs();
-    my (@folders);
-    if ($env{'form.pagepath'}) {
-        @folders = split('&',$env{'form.pagepath'});
-    } else {
-        @folders=split('&',$env{'form.folderpath'});
-    }
-    my $folderpath;
-    my $plain='';
-    my $randompick=-1;
-    my $isencrypted=0;
-    my $ishidden=0;
-    my $is_random_order=0;
-    while (@folders) {
-	my $folder=shift(@folders);
-    	my $foldername=shift(@folders);
-	if ($folderpath) {$folderpath.='&';}
-	$folderpath.=$folder.'&'.$foldername;
-        my $url;
-        if ($allowed) {
-            $url = '/adm/coursedocs?folderpath=';
-        } else {
-            $url = '/adm/supplemental?folderpath=';
-        }
-	$url .= &escape($folderpath);
-	my $name=&unescape($foldername);
-# randompick number, hidden, encrypted, random order, is appended with ":"s to the foldername
- 	$name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)$//;
-	if ($1 ne '') {
-           $randompick=$1;
-        } else {
-           $randompick=-1;
-        }
-        if ($2) { $ishidden=1; }
-        if ($3) { $isencrypted=1; }
-	if ($4 ne '') { $is_random_order = 1; }
-        if ($folder eq 'supplemental') {
-            $name = &mt('Supplemental '.$crstype.' Content');
-        }
-	&Apache::lonhtmlcommon::add_breadcrumb(
-		      {'href'=>$url,
-		       'title'=>$name,
-		       'text'=>$name,
-		       'no_mt'=>1,
-		       });
-	$plain.=$name.' > ';
-    }
-    $plain=~s/\&gt\;\s*$//;
-    return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp',
-					       undef, undef, 1 ),$randompick,$ishidden,
-                                               $isencrypted,$plain,$is_random_order);
-}
-
 sub log_docs {
     return &Apache::lonnet::write_log('course','docslog', at _);
 }
@@ -464,7 +409,8 @@
     if ($supplementalflag) {
         $tid = 2;
     }
-    my ($breadcrumbtrail) = &breadcrumbs($allowed,$crstype);
+    my ($breadcrumbtrail) =
+        &Apache::lonhtmlcommon::docs_breadcrumbs($allowed,$crstype,1);
     $r->print($breadcrumbtrail.
               &generate_edit_table($tid,\%orderhash,undef,$iconpath,$jumpto,
               $readfile));
@@ -1749,7 +1695,7 @@
 		                           : 'sequence';
 
     my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) =
-        &breadcrumbs($allowed,$crstype);
+        &Apache::lonhtmlcommon::docs_breadcrumbs($allowed,$crstype,1);
     $r->print($breadcrumbtrail);
 
     my $jumpto = "uploaded/$coursedom/$coursenum/$folder.$container";
@@ -2459,6 +2405,9 @@
 $form_start.
 $form_common.'
 <span class="LC_nobreak"><label><input type="checkbox" name="randomorder_'.$orderidx.'" onclick="'."this.form.changeparms.value='randomorder';this.form.submit()".'" '.$ro_set.' /> '.&mt('Random Order').' </label></span></form>';
+    } elsif ($supplementalflag && !$allowed) {
+        $url .= ($url =~ /\?/) ? 'amp;':'?';
+        $url .= 'folderpath='.&HTML::Entities::encode($esc_path,'<>&"');
     }
     if ($ispage) {
         my $pagename=&escape($pagetitle);




More information about the LON-CAPA-cvs mailing list