--- loncom/interface/londocs.pm 2013/01/14 23:14:59 1.484.2.25
+++ loncom/interface/londocs.pm 2012/12/01 16:06:42 1.514
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.484.2.25 2013/01/14 23:14:59 raeburn Exp $
+# $Id: londocs.pm,v 1.514 2012/12/01 16:06:42 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -40,6 +40,7 @@ use Apache::lonxml;
use Apache::lonclonecourse;
use Apache::lonnavmaps;
use Apache::lonnavdisplay();
+use Apache::lonuserstate();
use Apache::lonextresedit();
use HTML::Entities;
use HTML::TokeParser;
@@ -152,7 +153,7 @@ sub dumpcourse {
$r->print(&endContentScreen());
return '';
}
- my ($ca,$cd)=split(/\:/,$env{'form.authorspace'});
+ my ($ca,$cd)=split(/\@/,$env{'form.authorspace'});
$r->print('
'."\n".
- &mt('The following files are either dependencies of a web page or references within a folder and/or composite page for which errors occurred during import:')."\n".
- '
'
.&mt('Currently no documents.')
@@ -2037,7 +1948,7 @@ sub process_file_upload {
my $errtext='';
my $fatal=0;
my $container='sequence';
- if ($env{'form.folderpath'} =~ /:1$/) {
+ if ($env{'form.pagepath'}) {
$container='page';
}
($errtext,$fatal)=
@@ -2127,6 +2038,7 @@ sub process_file_upload {
my $archiveurl = &HTML::Entities::encode($url,'<>&"');
my %archiveitems = (
folderpath => $env{'form.folderpath'},
+ pagepath => $env{'form.pagepath'},
cmd => $nextphase,
newidx => $newidx,
position => $position,
@@ -2181,14 +2093,16 @@ sub is_supplemental_title {
sub entryline {
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom,
- $crstype,$pathitem,$supplementalflag,$container)=@_;
- my ($foldertitle,$renametitle);
+ $crstype,$pathitem,$supplementalflag)=@_;
+ my ($foldertitle,$pagetitle,$renametitle);
if (&is_supplemental_title($title)) {
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title);
+ $pagetitle = $foldertitle;
} else {
$title=&HTML::Entities::encode($title,'"<>&\'');
$renametitle=$title;
$foldertitle=$title;
+ $pagetitle=$title;
}
my $orderidx=$LONCAPA::map::order[$index];
@@ -2199,17 +2113,19 @@ sub entryline {
my $line=&Apache::loncommon::start_data_table_row();
my ($form_start,$form_end,$form_common);
# Edit commands
- my ($type, $esc_path, $path, $symb);
- if ($container eq 'page') {
- $type = 'page';
- } else {
- $type = 'folder';
- }
+ my ($container, $type, $esc_path, $path, $symb);
if ($env{'form.folderpath'}) {
+ $type = 'folder';
+ $container = 'sequence';
$esc_path=&escape($env{'form.folderpath'});
$path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
# $htmlfoldername=&HTML::Entities::encode($env{'form.foldername'},'<>&"');
}
+ if ($env{'form.pagepath'}) {
+ $type = $container = 'page';
+ $esc_path=&escape($env{'form.pagepath'});
+ $path = &HTML::Entities::encode($env{'form.pagepath'},'<>&"');
+ }
my $isexternal;
if ($residx) {
my $currurl = $url;
@@ -2226,7 +2142,7 @@ sub entryline {
&Apache::lonnet::declutter($currurl));
}
}
- my ($renamelink,%lt);
+ my %lt;
if ($allowed) {
my $incindex=$index+1;
my $selectbox='';
@@ -2323,7 +2239,7 @@ sub entryline {
$nocopy=1;
}
}
- my ($copylink,$cutlink,$removelink);
+ my ($copylink,$cutlink,$removelink,$renamelink);
my $skip_confirm = 0;
if ( $folder =~ /^supplemental/
|| ($url =~ m{( /smppg$
@@ -2342,7 +2258,7 @@ sub entryline {
ENDCOPY
} else {
$copylink=(<
$lt{'cp'}
+$lt{'cp'}
ENDCOPY
}
if ($nocut) {
@@ -2351,7 +2267,7 @@ ENDCOPY
ENDCUT
} else {
$cutlink=(<$lt{'ct'}
+$lt{'ct'}
ENDCUT
}
if ($noremove) {
@@ -2360,14 +2276,12 @@ ENDCUT
ENDREM
} else {
$removelink=(<$lt{'rm'}
+$lt{'rm'}
ENDREM
}
- unless ($isexternal) {
- $renamelink=(<$lt{'rn'}
+ $renamelink=(<$lt{'rn'}
ENDREN
- }
$form_start = '