--- loncom/interface/londocs.pm 2012/11/27 23:34:41 1.510
+++ loncom/interface/londocs.pm 2012/12/02 18:54:40 1.517
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.510 2012/11/27 23:34:41 raeburn Exp $
+# $Id: londocs.pm,v 1.517 2012/12/02 18:54:40 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2142,7 +2142,7 @@ sub entryline {
&Apache::lonnet::declutter($currurl));
}
}
- my %lt;
+ my ($renamelink,%lt);
if ($allowed) {
my $incindex=$index+1;
my $selectbox='';
@@ -2239,7 +2239,7 @@ sub entryline {
$nocopy=1;
}
}
- my ($copylink,$cutlink,$removelink,$renamelink);
+ my ($copylink,$cutlink,$removelink);
my $skip_confirm = 0;
if ( $folder =~ /^supplemental/
|| ($url =~ m{( /smppg$
@@ -2313,7 +2313,6 @@ END
$removelink
-$renamelink
$cutlink
$copylink
@@ -2434,7 +2433,7 @@ $form_common.'
if ($title) {
$url .= '&title='.&HTML::Entities::encode($renametitle,'<>&"');
}
- if ($orderidx) {
+ if ($isexternal && $orderidx) {
$url .= '&idx='.$orderidx;
}
}
@@ -2451,28 +2450,22 @@ $form_common.'
my $fileloc =
&Apache::lonnet::declutter(&Apache::lonnet::filelocation('',$orig_url));
if ($isexternal) {
- $editlink =
+ $editlink =
&Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem);
- } else {
+ } elsif (!$isfolder && !$ispage) {
my ($cfile,$home,$switchserver,$forceedit,$forceview) =
&Apache::lonnet::can_edit_resource($fileloc,$coursenum,$coursedom,$orig_url);
- my $geteditlink;
- if ($supplementalflag) {
- if ($orig_url eq "/adm/$env{'user.domain'}/$env{'user.name'}/aboutme") {
- $geteditlink = 1;
- }
- } elsif (($cfile ne '') && ($symb ne '')) {
- $geteditlink = 1;
- }
- if ($geteditlink) {
+ if (($cfile ne '') && ($symb ne '' || $supplementalflag)) {
my $jscall =
&Apache::lonhtmlcommon::jump_to_editres($cfile,$home,
$switchserver,
$forceedit,
- undef,$symb);
+ undef,$symb,
+ &escape($env{'form.folderpath'}),
+ $renametitle);
if ($jscall) {
$editlink = ' '.&mt('Edit').'';
+ $jscall.'" >'.&mt('Edit').' ';
}
}
}
@@ -2483,7 +2476,7 @@ $form_common.'
} else {
$reinit = &mt('(re-initialize course to access)');
}
- $line.=' | ';
+ $line.=' | '.$editlink.$renamelink;
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) {
$line.=' ';
} elsif ($url) {
@@ -2492,7 +2485,7 @@ $form_common.'
} else {
$line.=' ';
}
- $line.=' | ';
+ $line.=' | ';
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) {
$line.=''.$title.'';
} elsif ($url) {
@@ -2501,7 +2494,7 @@ $form_common.'
} else {
$line.=$title.' '.$reinit.'';
}
- $line.=$editlink." | ";
+ $line.='';
$rand_pick_text = ' ' if ($rand_pick_text eq '');
$rand_order_text = ' ' if ($rand_order_text eq '');
if (($allowed) && ($folder!~/^supplemental/)) {
@@ -3298,7 +3291,7 @@ sub handler {
if ($mapurl eq 'default') {
$maptitle = 'Main Course Documents';
}
- $path .= ($path ne '')? '&' : ''.
+ $path .= (($path ne '')? '&' : '').
&Apache::lonhtmlcommon::entity_encode($mapurl).'&'.
&Apache::lonhtmlcommon::entity_encode($maptitle).
':'.$mapresobj->randompick().
@@ -3602,10 +3595,6 @@ sub handler {
'prev' => 'Preview',
'lnk' => 'Add Link',
'parse' => 'Upload embedded images/multimedia files if HTML file',
- 'nd' => 'Upload Document',
- 'pm' => 'Published Map',
- 'sd' => 'Special Document',
- 'mo' => 'More Options',
);
# -----------------------------------------------------------------------------
my $fileupload=(<