--- loncom/interface/londocs.pm 2012/11/14 01:09:32 1.507
+++ loncom/interface/londocs.pm 2012/11/14 02:49:19 1.508
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.507 2012/11/14 01:09:32 raeburn Exp $
+# $Id: londocs.pm,v 1.508 2012/11/14 02:49:19 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -454,7 +454,8 @@ sub docs_change_log {
if ($folderpath eq '') {
$folderpath = 'default&'.&escape(&mt('Main '.$crstype.' Documents'));
}
- $pathitem = '';
+ $pathitem = '';
}
my $readfile="/uploaded/$coursedom/$coursenum/$folder.$container";
my $jumpto = $readfile;
@@ -1743,7 +1744,7 @@ sub handle_edit_cmd {
sub editor {
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$crstype,
- $supplementalflag,$orderhash,$iconpath,$uploadtag)=@_;
+ $supplementalflag,$orderhash,$iconpath,$pathitem)=@_;
my $container= ($env{'form.pagepath'}) ? 'page'
: 'sequence';
@@ -1912,7 +1913,7 @@ sub editor {
unless ($name) { $idx++; next; }
$output .= &entryline($idx,$name,$url,$folder,$allowed,$res,
$coursenum,$coursedom,$crstype,
- $uploadtag,$supplementalflag);
+ $pathitem,$supplementalflag);
$idx++;
$shown++;
}
@@ -2130,7 +2131,7 @@ sub is_supplemental_title {
sub entryline {
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom,
- $crstype,$uploadtag,$supplementalflag)=@_;
+ $crstype,$pathitem,$supplementalflag)=@_;
my ($foldertitle,$pagetitle,$renametitle);
if (&is_supplemental_title($title)) {
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title);
@@ -2287,7 +2288,7 @@ sub entryline {
$skip_confirm = 1;
}
- if ($nocopy) {
+ if ($nocopy) {
$copylink=(<$lt{'cp'}
ENDCOPY
@@ -2296,7 +2297,7 @@ ENDCOPY
$lt{'cp'}
ENDCOPY
}
- if ($nocut) {
+ if ($nocut) {
$cutlink=(<$lt{'ct'}
ENDCUT
@@ -2488,17 +2489,25 @@ $form_common.'
$lt{'ti'}
- $uploadtag
+ $pathitem
EXTLNK
- } else {
+ } else {
my ($cfile,$home,$switchserver,$forceedit,$forceview) =
&Apache::lonnet::can_edit_resource($fileloc,$coursenum,$coursedom,$orig_url);
- if (($cfile ne '') && ($symb ne '')) {
+ 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) {
my $jscall =
&Apache::lonhtmlcommon::jump_to_editres($cfile,$home,
$switchserver,
@@ -3286,7 +3295,7 @@ sub handler {
my $addentries = {};
my $container;
my $containertag;
- my $uploadtag;
+ my $pathitem;
# Do we directly jump somewhere?
@@ -3419,7 +3428,7 @@ sub handler {
$container='page';
$containertag = ''.
'';
- $uploadtag =
+ $pathitem =
''.
''.
'';
@@ -3433,7 +3442,7 @@ sub handler {
}
}
$containertag = '';
- $uploadtag = '';
+ $pathitem = '';
}
if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
$showdoc='/'.$1;
@@ -3678,7 +3687,7 @@ IMSFORM
$lt{'title'}:
- $uploadtag
+ $pathitem
@@ -3708,7 +3717,7 @@ FUFORM
SEDFFORM
my @importpubforma = (
- { '' => "$uploadtag" },
+ { '' => $pathitem."" },
{ '' => "$help{'Importing_LON-CAPA_Resource'}" },
{ '' => "" },
{ '' => $importpubform }
@@ -3726,7 +3735,7 @@ SEDFFORM
$lt{'title'}:
- $uploadtag
+ $pathitem
@@ -3751,8 +3760,8 @@ ERFORM
HIDDENFORM
- $r->print(&makesimpleeditform($uploadtag)."\n".
- &makedocslogform($uploadtag."\n".
+ $r->print(&makesimpleeditform($pathitem)."\n".
+ &makedocslogform($pathitem."\n".
''."\n"));
}
@@ -3775,7 +3784,7 @@ HIDDENFORM
$folder='default';
$savefolderpath = $env{'form.folderpath'};
$env{'form.folderpath'}='default&'.&escape(&mt('Content'));
- $uploadtag = '';
}
my $postexec='';
@@ -3800,7 +3809,7 @@ HIDDENFORM
my $newnavform=(<
- $uploadtag
+ $pathitem
@@ -3810,7 +3819,7 @@ NNFORM
my $newsmppageform=(<
- $uploadtag
+ $pathitem
$help{'Simple Page'}
@@ -3820,7 +3829,7 @@ NSPFORM
my $newsmpproblemform=(<
- $uploadtag
+ $pathitem
$help{'Simple Problem'}
@@ -3831,7 +3840,7 @@ NSPROBFORM
my $newdropboxform=(<
- $uploadtag
+ $pathitem
@@ -3840,7 +3849,7 @@ NDBFORM
my $newexuploadform=(<
- $uploadtag
+ $pathitem
$help{'Score_Upload_Form'}
@@ -3850,7 +3859,7 @@ NEXUFORM
my $newbulform=(<
- $uploadtag
+ $pathitem
$help{'Bulletin Board'}
@@ -3860,7 +3869,7 @@ NBFORM
my $newaboutmeform=(<
- $uploadtag
+ $pathitem
@@ -3871,7 +3880,7 @@ NAMFORM
my $newaboutsomeoneform=(<
- $uploadtag
+ $pathitem
@@ -3881,7 +3890,7 @@ NASOFORM
my $newrosterform=(<
- $uploadtag
+ $pathitem
@@ -3913,7 +3922,7 @@ NPFORM
$newfolderform=(<
-
+ $pathitem
$lt{'newf'}$help{'Adding_Folders'}
@@ -3923,7 +3932,7 @@ NFFORM
my $newsylform=(<
- $uploadtag
+ $pathitem
@@ -3935,7 +3944,7 @@ NSYLFORM
my $newgroupfileform=(<
- $uploadtag
+ $pathitem
@@ -3989,7 +3998,7 @@ unless ($env{'form.pagepath'}) {
$hadchanges=0;
unless (($supplementalflag || $toolsflag)) {
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype,
- $supplementalflag,\%orderhash,$iconpath,$uploadtag);
+ $supplementalflag,\%orderhash,$iconpath,$pathitem);
if ($error) {
$r->print(''.$error.'
');
}
@@ -4014,12 +4023,12 @@ unless ($env{'form.pagepath'}) {
$env{'form.folderpath'} = $savefolderpath;
}
$env{'form.pagepath'} = '';
+ $pathitem = '';
if ($allowed) {
my $folderseq=
'/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_new.sequence';
- my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
-
my $supupdocform=(<