--- loncom/interface/londocs.pm 2012/12/13 04:15:30 1.484.2.18
+++ loncom/interface/londocs.pm 2012/12/13 04:51:41 1.484.2.19
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.484.2.18 2012/12/13 04:15:30 raeburn Exp $
+# $Id: londocs.pm,v 1.484.2.19 2012/12/13 04:51:41 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -41,6 +41,7 @@ use Apache::lonclonecourse;
use Apache::lonnavmaps;
use Apache::lonnavdisplay();
use Apache::lonuserstate();
+use Apache::lonextresedit();
use HTML::Entities;
use HTML::TokeParser;
use GDBM_File;
@@ -390,18 +391,15 @@ sub docs_change_log {
my %orderhash;
my $container='sequence';
my $pathitem;
- if ($env{'form.pagepath'}) {
+ if ($env{'form.folderpath'} =~ /\:1$/) {
$container='page';
- $pathitem = '';
- } else {
- my $folderpath=$env{'form.folderpath'};
- if ($folderpath eq '') {
- $folderpath = 'default&'.&escape(&mt('Main '.$crstype.' Documents'));
- }
- $pathitem = '';
}
+ my $folderpath=$env{'form.folderpath'};
+ if ($folderpath eq '') {
+ $folderpath = 'default&'.&escape(&mt('Main '.$crstype.' Documents').':::::');
+ }
+ $pathitem = '';
my $readfile="/uploaded/$coursedom/$coursenum/$folder.$container";
my $jumpto = $readfile;
$jumpto =~ s{^/}{};
@@ -409,7 +407,7 @@ sub docs_change_log {
if ($supplementalflag) {
$tid = 2;
}
- my ($breadcrumbtrail) =
+ my ($breadcrumbtrail) =
&Apache::lonhtmlcommon::docs_breadcrumbs($allowed,$crstype,1);
$r->print($breadcrumbtrail.
&generate_edit_table($tid,\%orderhash,undef,$iconpath,$jumpto,
@@ -484,7 +482,7 @@ sub docs_change_log {
':'.$docslog{$id}{'exe_udom'}.''.
$send_msg_link.'
'.
$docslog{$id}{'logentry'}{'folder'}.' | ');
- my $is_supp = 0;
+ my $is_supp = 0;
if ($docslog{$id}{'logentry'}{'currentfolder'} =~ /^supplemental/) {
$is_supp = 1;
}
@@ -507,7 +505,7 @@ sub docs_change_log {
if ($is_supp) {
$shown = &Apache::loncommon::parse_supplemental_title($shown);
}
- $r->print(''.$shown.'');
+ $r->print(''.$shown.'');
}
}
$r->print('');
@@ -658,7 +656,7 @@ sub print_paste_buffer {
$canpaste = &supp_pasteable($env{'docs.markedcopy_url'});
unless ($canpaste) {
$nopaste = &mt('Paste into Supplemental Content unavailable for this type of content.');
- }
+ }
} else {
$canpaste = 1;
}
@@ -672,11 +670,11 @@ sub print_paste_buffer {
$othercourse = 1;
if ($env{"user.priv.cm./$srcdom/$srcnum"} =~ /\Q:mdc&F\E/) {
if ($canpaste) {
- $othercrs = ' '.&mt('(from another course).');
+ $othercrs = ' '.&mt('(from another course).');
}
} else {
$canpaste = 0;
- $nopaste = &mt('Paste from another course unavailable.')
+ $nopaste = &mt('Paste from another course unavailable.')
}
}
if ($rem =~ m{^(default|supplemental)_?(\d*)\.(?:page|sequence)$}) {
@@ -694,18 +692,18 @@ sub print_paste_buffer {
.'');
my ($type,$buffer);
if ($is_external) {
- $type = &mt('External Resource');
- $buffer = $type.': '.
- &LONCAPA::map::qtescape($env{'docs.markedcopy_title'}).' ('.
+ $type = &mt('External Resource');
+ $buffer = $type.': '.
+ &LONCAPA::map::qtescape($env{'docs.markedcopy_title'}).' ('.
&LONCAPA::map::qtescape($env{'docs.markedcopy_url'}).')';
} else {
- my $icon = &Apache::loncommon::icon($extension);
- if ($extension eq 'sequence' &&
- $env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) {
- $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
- $icon .= '/navmap.folder.closed.gif';
- }
- $icon = '';
+ my $icon = &Apache::loncommon::icon($extension);
+ if ($extension eq 'sequence' &&
+ $env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) {
+ $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
+ $icon .= '/navmap.folder.closed.gif';
+ }
+ $icon = '';
$buffer = $icon.$type.': '. &Apache::loncommon::parse_supplemental_title(&LONCAPA::map::qtescape($env{'docs.markedcopy_title'}));
}
if ($canpaste) {
@@ -719,7 +717,7 @@ sub print_paste_buffer {
''.(' ' x2).
- ' |