--- loncom/publisher/lonpubdir.pm 2023/12/29 21:36:23 1.160.2.5.2.2
+++ loncom/publisher/lonpubdir.pm 2024/02/28 04:58:02 1.160.2.5.2.3
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Authoring Space Directory Lister
#
-# $Id: lonpubdir.pm,v 1.160.2.5.2.2 2023/12/29 21:36:23 raeburn Exp $
+# $Id: lonpubdir.pm,v 1.160.2.5.2.3 2024/02/28 04:58:02 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -290,6 +290,7 @@ sub handler {
}
# Print the sorted resources
+ my %editors = &Apache::loncommon::permitted_editors();
foreach my $filename (@sorted_files) {
if ($filehash->{$filename}->{"cmode"}&$dirptr) { # Directories
&putdirectory($r, $thisdisfn, $linkdir, $filename,
@@ -302,7 +303,8 @@ sub handler {
$filehash->{$filename}->{"linkfilename"},
$filehash->{$filename}->{"fulltitle"},
$filehash->{$filename}->{"status"},
- $filehash->{$filename}->{"pubstatus"});
+ $filehash->{$filename}->{"pubstatus"},
+ \%editors);
}
}
@@ -868,7 +870,7 @@ sub getStatus {
sub putresource {
my ($r, $udom, $uname, $filename, $thisdisfn, $resdir, $targetdir,
$linkdir, $cmtime, $size, $numres, $linkfilename, $title,
- $status, $pubstatus) = @_;
+ $status, $pubstatus, $editors) = @_;
&Apache::lonnet::devalidate_cache_new('meta',$targetdir.'/'.$filename);
my $editlink='';
@@ -877,8 +879,19 @@ sub putresource {
$editlink='
('.&mt('Edit').')';
}
if ($filename=~/$LONCAPA::assess_re/) {
- $editlink=' ('.&mt('EditXML').')';
- $editlink2='
('.&mt('Edit').')';
+ if ($editors->{'xml'}) {
+ $editlink=' ('.&mt('EditXML').')';
+ }
+ if ($editors->{'edit'}) {
+ $editlink2='
('.&mt('Edit').')';
+ }
+ }
+ if ($filename=~/\.(xml|html|htm|xhtml|xhtm)$/ || $filename=~/$LONCAPA::assess_re/) {
+ if (($editors->{'daxe'}) &&
+ ($env{'browser.type'} ne 'explorer' || $env{'browser.version'} > 9)) {
+ my $daxeurl = '/daxepage'.$linkdir.'/'.$filename;
+ $editlink .= ' (Daxe)';
+ }
}
if ($filename=~/\.(problem|exam|quiz|assess|survey|form|library|xml|html|htm|xhtml|xhtm|sty)$/) {
$editlink.=' ('.&mt('Clean Up').')';