version 1.369.2.83.2.18, 2024/02/28 19:08:32
|
version 1.369.2.83.2.21, 2024/10/06 20:19:57
|
Line 456 sub primary_menu {
|
Line 456 sub primary_menu {
|
# |
# |
#TODO this should probably be moved somewhere more central |
#TODO this should probably be moved somewhere more central |
#since it can be used by different parts of the system |
#since it can be used by different parts of the system |
sub getauthor{ |
sub getauthor { |
return unless $env{'request.role'}=~/^(ca|aa|au)/; #nothing to do if user isn't some kind of author |
return unless $env{'request.role'}=~/^(ca|aa|au)/; #nothing to do if user isn't some kind of author |
|
|
#co- or assistent author? |
#co- or assistant author? |
my ($dom, $user) = ($env{'request.role'} =~ /^(?:ca|aa)\.\/($match_domain)\/($match_username)$/) |
my ($dom, $user) = ($env{'request.role'} =~ /^(?:ca|aa)\.\/($match_domain)\/($match_username)$/) |
? ($1, $2) #domain, username of the parent author |
? ($1, $2) #domain, username of the parent author |
: @env{ ('request.role.domain', 'user.name') }; #own domain, username |
: @env{ ('request.role.domain', 'user.name') }; #own domain, username |
Line 500 sub secondary_menu {
|
Line 500 sub secondary_menu {
|
my $canplc = &Apache::lonnet::allowed('plc', $crs_sec); |
my $canplc = &Apache::lonnet::allowed('plc', $crs_sec); |
my $author = &getauthor(); |
my $author = &getauthor(); |
|
|
|
my ($is_author,$is_coauthor); |
|
if ($author) { |
|
if ($env{'request.role'} =~ /^au\./) { |
|
$is_author = 1; |
|
} elsif ($env{'request.role'} =~ /^ca\./) { |
|
$is_coauthor = 1; |
|
} |
|
} |
|
|
my ($cdom,$cnum,$showsyllabus,$showfeeds,$showresv,$grouptools, |
my ($cdom,$cnum,$showsyllabus,$showfeeds,$showresv,$grouptools, |
$lti,$ltimapres,%ltiexc,%menuopts); |
$lti,$ltimapres,%ltiexc,%menuopts); |
$grouptools = 0; |
$grouptools = 0; |
Line 559 sub secondary_menu {
|
Line 568 sub secondary_menu {
|
$linkattr = 'aria-disabled="true"'; |
$linkattr = 'aria-disabled="true"'; |
} |
} |
|
|
my ($canmodifycoauthor); |
my ($canlistcoauthors,$canmodifycoauthor); |
if ($env{'request.role'} eq "au./$env{'user.domain'}/") { |
if ($env{'request.role'} eq "au./$env{'user.domain'}/") { |
my $extent = "$env{'user.domain'}/$env{'user.name'}"; |
my $extent = "$env{'user.domain'}/$env{'user.name'}"; |
if ((&Apache::lonnet::allowed('cca',$extent)) || |
if ((&Apache::lonnet::allowed('cca',$extent)) || |
(&Apache::lonnet::allowed('caa',$extent))) { |
(&Apache::lonnet::allowed('caa',$extent))) { |
$canmodifycoauthor = 1; |
$canmodifycoauthor = 1; |
} |
} |
|
} elsif ($env{'request.role'} =~ m{^(aa|ca)\./($match_domain/$match_username)$}) { |
|
my ($role,$extent) = ($1,$2); |
|
if (&Apache::lonnet::allowed('vca',$extent)) { |
|
if ($env{"environment.internal.manager./$extent"}) { |
|
$canmodifycoauthor = 1; |
|
} else { |
|
$canlistcoauthors = 1; |
|
} |
|
} elsif (&Apache::lonnet::allowed('vaa',$extent)) { |
|
$canlistcoauthors = 1; |
|
} |
} |
} |
|
|
my ($roleswitcher_js,$roleswitcher_form); |
my ($roleswitcher_js,$roleswitcher_form); |
Line 590 sub secondary_menu {
|
Line 610 sub secondary_menu {
|
# evaluate conditions |
# evaluate conditions |
next if ref($menuitem) ne 'ARRAY'; |
next if ref($menuitem) ne 'ARRAY'; |
next if $$menuitem[4] ne 'always' |
next if $$menuitem[4] ne 'always' |
&& ($$menuitem[4] ne 'author' && $$menuitem[4] ne 'cca') |
&& $$menuitem[4] ne 'coauthor' |
|
&& $$menuitem[4] ne 'author' |
|
&& $$menuitem[4] ne 'authorspace' |
|
&& $$menuitem[4] ne 'vca' |
|
&& $$menuitem[4] ne 'mca' |
&& !$env{'request.course.id'}; |
&& !$env{'request.course.id'}; |
next if $$menuitem[4] =~ /^crsedit/ |
next if $$menuitem[4] =~ /^crsedit/ |
&& (!$canedit && !$canvieweditor); |
&& (!$canedit && !$canvieweditor); |
Line 622 sub secondary_menu {
|
Line 646 sub secondary_menu {
|
&& !$showfeeds; |
&& !$showfeeds; |
next if $$menuitem[4] eq 'plc' |
next if $$menuitem[4] eq 'plc' |
&& !$canplc; |
&& !$canplc; |
next if $$menuitem[4] eq 'author' |
next if $$menuitem[4] eq 'authorspace' |
&& !$author; |
&& !$author; |
next if $$menuitem[4] eq 'cca' |
next if $$menuitem[4] eq 'author' |
|
&& !$is_author; |
|
next if $$menuitem[4] eq 'coauthor' |
|
&& !$is_coauthor; |
|
next if $$menuitem[4] eq 'vca' |
|
&& (!$canlistcoauthors || $canmodifycoauthor); |
|
next if $$menuitem[4] eq 'vaa' |
|
&& (!$canlistcoauthors || $canmodifycoauthor); |
|
next if $$menuitem[4] eq 'mca' |
&& !$canmodifycoauthor; |
&& !$canmodifycoauthor; |
next if $$menuitem[4] eq 'notltimapres' |
next if $$menuitem[4] eq 'notltimapres' |
&& $ltimapres; |
&& $ltimapres; |
Line 662 sub secondary_menu {
|
Line 694 sub secondary_menu {
|
next if ($item->[2] eq 'vcg' && !$canviewgrps); |
next if ($item->[2] eq 'vcg' && !$canviewgrps); |
next if ($item->[2] eq 'crsedit' && !$canedit && !$canvieweditor); |
next if ($item->[2] eq 'crsedit' && !$canedit && !$canvieweditor); |
next if ($item->[2] eq 'params' && !$canmodpara && !$canviewpara); |
next if ($item->[2] eq 'params' && !$canmodpara && !$canviewpara); |
next if ($item->[2] eq 'author' && !$author); |
next if ($item->[2] eq 'author' && !$is_author); |
next if ($item->[2] eq 'cca' && !$canmodifycoauthor); |
next if ($item->[2] eq 'vca' && !$canlistcoauthors); |
next if ($item->[2] eq 'lti' && !$lti); |
next if ($item->[2] eq 'lti' && !$lti); |
if ($item->[2] =~ /^lti(portfolio|wishlist|blog)$/) { |
if ($item->[2] =~ /^lti(portfolio|wishlist|blog)$/) { |
my $tool = $1; |
my $tool = $1; |
Line 746 sub secondary_menu {
|
Line 778 sub secondary_menu {
|
} |
} |
$menu =~ s/\[url\]/$escurl/g; |
$menu =~ s/\[url\]/$escurl/g; |
$menu =~ s/\[symb\]/$escsymb/g; |
$menu =~ s/\[symb\]/$escsymb/g; |
|
} elsif (($menu =~ m{/adm/preferences\?}) && ($menu =~ /\[returnurl\]/)) { |
|
my $returnurl = $ENV{'REQUEST_URI'}; |
|
if ($ENV{'REQUEST_URI'} =~ m{/adm/preferences\?action=authorsettings\&returnurl=([^\&]+)$}) { |
|
$returnurl = $1; |
|
} |
|
if (($returnurl =~ m{^/adm/createuser($|\?action=)}) || |
|
($returnurl =~ m{^/priv/$match_domain/$match_username}) || |
|
($returnurl =~ m{^/res(/?$|/$match_domain/$match_username)})) { |
|
$returnurl =~ s{\?.*$}{}; |
|
$returnurl = '&returnurl='.&HTML::Entities::encode($returnurl,'"<>&\''); |
|
} else { |
|
undef($returnurl); |
|
} |
|
$menu =~ s/\[returnurl\]/$returnurl/; |
} |
} |
$menu =~ s/\[uname\]/$$author{user}/g; |
$menu =~ s/\[uname\]/$$author{user}/g; |
$menu =~ s/\[udom\]/$$author{dom}/g; |
$menu =~ s/\[udom\]/$$author{dom}/g; |
Line 898 sub innerregister {
|
Line 944 sub innerregister {
|
my ($forcereg,$bread_crumbs,$group,$pagebuttonshide,$hostname, |
my ($forcereg,$bread_crumbs,$group,$pagebuttonshide,$hostname, |
$ltiscope,$ltiuri,$showncrumbsref) = @_; |
$ltiscope,$ltiuri,$showncrumbsref) = @_; |
my $const_space = ($env{'request.state'} eq 'construct'); |
my $const_space = ($env{'request.state'} eq 'construct'); |
my $is_const_dir = 0; |
my $in_daxe = 0; |
|
|
if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { return ''; } |
if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { return ''; } |
|
|
Line 1246 END
|
Line 1292 END
|
# End course context |
# End course context |
|
|
# Prepare the rest of the buttons |
# Prepare the rest of the buttons |
my ($menuitems,$got_prt,$got_wishlist,$cstritems); |
my ($menuitems,$got_prt,$got_wishlist,$cstritems,$toplevel_cstr); |
if ($const_space) { |
if ($const_space) { |
# |
# |
# We are in construction space |
# We are in construction space |
Line 1257 END
|
Line 1303 END
|
($env{'request.filename'}=~m{^\Q$londocroot/priv/\E([^/]+)/([^/]+)/(.*)$}); |
($env{'request.filename'}=~m{^\Q$londocroot/priv/\E([^/]+)/([^/]+)/(.*)$}); |
my $currdir = '/priv/'.$udom.'/'.$uname.'/'.$thisdisfn; |
my $currdir = '/priv/'.$udom.'/'.$uname.'/'.$thisdisfn; |
if ($currdir =~ m-/$-) { |
if ($currdir =~ m-/$-) { |
$is_const_dir = 1; |
|
if ($thisdisfn eq '') { |
if ($thisdisfn eq '') { |
$is_const_dir = 2; |
$toplevel_cstr = 1; |
|
} |
|
my $esc_currdir = &Apache::loncommon::escape_single($currdir); |
|
$menuitems=(<<ENDMENUITEMS); |
|
s&6&3&pub.png&Publish&dir[_2]&gocstr('/adm/publish','$esc_currdir')&Publish this Directory |
|
s&7&4&docs-22x22.png&Edit Metadata&defaults[_1]&gopost('${esc_currdir}default.meta','')&Edit metadata for this Directory |
|
s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','$esc_currdir')&Print contents of directory |
|
s&7&1&del.png&Delete&dir[_3]&gocstr('/adm/cfile?action=delete','$esc_currdir')&Delete this Directory |
|
ENDMENUITEMS |
|
if (($env{'environment.canarchive'}) && |
|
($uname eq $env{'user.name'}) && ($udom eq $env{'user.domain'})) { |
|
$menuitems .= (<<ENDMENUITEMS); |
|
s&7&7&archive.png&Export&dir[_1]&gocstr('/adm/cfile?action=archive','$esc_currdir')&Export Authoring Space Archive |
|
ENDMENUITEMS |
} |
} |
} else { |
} else { |
$currdir =~ s|[^/]+$||; |
$currdir =~ s|[^/]+$||; |
my $cleandisfn = &Apache::loncommon::escape_single($thisdisfn); |
my $cleandisfn = &Apache::loncommon::escape_single($thisdisfn); |
my $esc_currdir = &Apache::loncommon::escape_single($currdir); |
my $esc_currdir = &Apache::loncommon::escape_single($currdir); |
|
my $pubfile = "/res/$udom/$uname/$thisdisfn"; |
|
my $candelete = 1; |
|
if (-e $londocroot.$pubfile) { |
|
unless (&Apache::lonnet::metadata($pubfile,'obsolete')) { |
|
undef($candelete); |
|
} |
|
} |
# |
# |
# Probably should be in mydesk.tab |
# Probably should be in mydesk.tab |
# |
# |
Line 1272 END
|
Line 1337 END
|
s&6&1&list.png&Directory&dir[_1]&golist('$esc_currdir')&List current directory |
s&6&1&list.png&Directory&dir[_1]&golist('$esc_currdir')&List current directory |
s&6&2&rtrv.png&Retrieve&version[_1]&gocstr('/adm/retrieve','/priv/$udom/$uname/$cleandisfn')&Retrieve old version |
s&6&2&rtrv.png&Retrieve&version[_1]&gocstr('/adm/retrieve','/priv/$udom/$uname/$cleandisfn')&Retrieve old version |
s&6&3&pub.png&Publish&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource |
s&6&3&pub.png&Publish&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource |
|
s&7&3©.png&Copy&resource[_4]&gocstr('/adm/cfile?action=copy','/priv/$udom/$uname/$cleandisfn')&Copy this resource |
|
ENDMENUITEMS |
|
# |
|
# Rename and Delete only available if obsolete or unpublished |
|
# |
|
if ($candelete) { |
|
$menuitems .= (<<ENDMENUITEMS); |
|
s&7&4&rename.png&Rename&resource[_5]&gocstr('/adm/cfile?action=rename','/priv/$udom/$uname/$cleandisfn')&Rename this resource |
s&7&1&del.png&Delete&resource[_2]&gocstr('/adm/cfile?action=delete','/priv/$udom/$uname/$cleandisfn')&Delete this resource |
s&7&1&del.png&Delete&resource[_2]&gocstr('/adm/cfile?action=delete','/priv/$udom/$uname/$cleandisfn')&Delete this resource |
ENDMENUITEMS |
ENDMENUITEMS |
|
} |
|
|
# |
# |
# Print only makes sense for certain mime types |
# Print only makes sense for certain mime types |
Line 1287 ENDMENUITEMS
|
Line 1361 ENDMENUITEMS
|
$cstritems = $menuitems; |
$cstritems = $menuitems; |
undef($menuitems); |
undef($menuitems); |
} |
} |
|
# |
|
# "Exit Daxe" in Functions menu when using Daxe |
|
# |
|
if ((($env{'form.editmode'} eq 'daxe') && |
|
($thisdisfn=~/\.(xml|html|htm|xhtml|xhtm)$/)) || |
|
(($env{'form.problemmode'} eq 'daxe') && |
|
($thisdisfn=~/$LONCAPA::assess_re/))) { |
|
my %editors = &Apache::loncommon::permitted_editors(); |
|
if ($editors{'daxe'}) { |
|
my $privfile = &Apache::loncommon::escape_single("/priv/$udom/$uname/$thisdisfn"); |
|
$in_daxe = 1; |
|
$menuitems .= (<<ENDMENUITEMS); |
|
my $privfile = &Apache::loncommon::escape_single("/priv/$udom/$uname/$thisdisfn"); |
|
s&7&6&tolastloc.png&Exit Daxe&resource[_1]&go('$privfile')&Exit editing this resource |
|
ENDMENUITEMS |
|
} |
|
} |
|
} |
|
# |
|
# Editing options usually accessed via "Settings" in inline menu need to be |
|
# accessed in a different way, when Authoring Space is accessed in course |
|
# context |
|
# |
|
if (($env{'request.role'} !~/^(aa|ca|au)/) || (!$noremote)) { |
|
my $privfile = &Apache::loncommon::escape_single("/priv/$udom/$uname/$thisdisfn"); |
|
$menuitems .= (<<ENDMENUITEMS); |
|
s&7&5&editops.png&Options&edit[_1]&gocstr('/adm/preferences?action=authorsettings','$privfile')&Authoring Space Options |
|
ENDMENUITEMS |
} |
} |
|
|
if (ref($bread_crumbs) eq 'ARRAY') { |
if (ref($bread_crumbs) eq 'ARRAY') { |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
foreach my $crumb (@{$bread_crumbs}){ |
foreach my $crumb (@{$bread_crumbs}){ |
Line 1477 ENDMENUITEMS
|
Line 1580 ENDMENUITEMS
|
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
'tools',@tools); |
'tools',@tools); |
|
|
|
#exit editing link/icon when using daxe in construction space |
#publish button in construction space |
#publish button in construction space |
if ($env{'request.state'} eq 'construct'){ |
if ($env{'request.state'} eq 'construct'){ |
|
if ($in_daxe) { |
|
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
|
'advtools', $inlineremote[76]); |
|
} |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
'advtools', $inlineremote[63]); |
'advtools', $inlineremote[63]); |
} else { |
} else { |
Line 1486 ENDMENUITEMS
|
Line 1594 ENDMENUITEMS
|
'tools', $inlineremote[63]); |
'tools', $inlineremote[63]); |
} |
} |
&advtools_crumbs(@inlineremote); |
&advtools_crumbs(@inlineremote); |
|
#options link/icon in constructions space viewed with course role |
|
if (($env{'request.state'} eq 'construct') && |
|
($env{'request.role'} !~/^(aa|ca|au)/)) { |
|
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
|
'advtools', $inlineremote[75]); |
|
} |
} |
} |
} else { |
} else { |
if ($linkprotout) { |
if ($linkprotout) { |
Line 1493 ENDMENUITEMS
|
Line 1607 ENDMENUITEMS
|
} |
} |
} |
} |
my ($topic_help,$topic_help_text); |
my ($topic_help,$topic_help_text); |
if ($is_const_dir == 2) { |
if ($toplevel_cstr) { |
if ((($ENV{'SERVER_PORT'} == 443) || |
if ((($ENV{'SERVER_PORT'} == 443) || |
($Apache::lonnet::protocol{$Apache::lonnet::perlvar{'lonHostID'}} eq 'https')) && |
($Apache::lonnet::protocol{$Apache::lonnet::perlvar{'lonHostID'}} eq 'https')) && |
(&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},'webdav'))) { |
(&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},'webdav'))) { |
Line 1518 ENDMENUITEMS
|
Line 1632 ENDMENUITEMS
|
&switch('','',@rest); |
&switch('','',@rest); |
} |
} |
&Apache::lonhtmlcommon::add_breadcrumb_tool('advtools', |
&Apache::lonhtmlcommon::add_breadcrumb_tool('advtools', |
@inlineremote[63,61,71,72]); |
@inlineremote[76,63,74,61,71,72,77,75]); |
|
|
$cstrcrumbs = &Apache::lonhtmlcommon::scripttag('', 'start') |
$cstrcrumbs = &Apache::lonhtmlcommon::scripttag('', 'start') |
.&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0) |
.&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0) |
Line 1910 sub prepare_functions {
|
Line 2024 sub prepare_functions {
|
$editbutton = &get_editbutton($cfile,$home,$switchserver, |
$editbutton = &get_editbutton($cfile,$home,$switchserver, |
$forceedit,$forceview,$forcereg); |
$forceedit,$forceview,$forcereg); |
} |
} |
} elsif ((!$env{'request.course.id'}) && |
} elsif (!$env{'request.course.id'}) { |
($env{'user.author'}) && ($env{'request.filename'}) && |
if (($env{'user.author'}) && ($resurl eq '/adm/viewcoauthors')) { |
($env{'request.role'} !~/^(aa|ca|au)/)) { |
if ($env{'request.role'} =~/^(ca|au)/) { |
|
my ($audom,$auname); |
|
if ($env{'request.role'} eq "au./$env{'user.domain'}/") { |
|
($audom,$auname) = ($env{'user.domain'},$env{'user.name'}); |
|
} elsif ($env{'request.role'} =~ m{^ca\./($match_domain)/($match_username)}) { |
|
($audom,$auname) = ($1,$2); |
|
} |
|
if (($audom ne '') && ($auname ne '')) { |
|
my $file=&Apache::lonnet::declutter($env{'request.filename'}); |
|
($cfile,$home,$switchserver,$forceedit,$forceview) = |
|
&Apache::lonnet::can_edit_resource($file,$auname,$audom, |
|
$resurl); |
|
if ($cfile) { |
|
$editbutton = &get_editbutton($resurl,'','',$forceedit, |
|
$forceview); |
|
} |
|
} |
|
} |
|
} elsif (($env{'user.author'}) && ($env{'request.filename'}) && |
|
($env{'request.role'} !~/^(aa|ca|au)/)) { |
# |
# |
# Currently do not have the role of author or co-author. |
# Currently do not have the role of author or co-author. |
# Do we have authoring privileges for the resource? |
# Do we have authoring privileges for the resource? |
# |
# |
my $file=&Apache::lonnet::declutter($env{'request.filename'}); |
my $file=&Apache::lonnet::declutter($env{'request.filename'}); |
($cfile,$home,$switchserver,$forceedit,$forceview) = |
($cfile,$home,$switchserver,$forceedit,$forceview) = |
&Apache::lonnet::can_edit_resource($file,$cnum,$cdom, |
&Apache::lonnet::can_edit_resource($file,$cnum,$cdom, |
&Apache::lonnet::clutter($resurl),$env{'request.symb'},$group); |
&Apache::lonnet::clutter($resurl),$env{'request.symb'},$group); |
if (($cfile) && ($home ne '') && ($home ne 'no_host')) { |
if (($cfile) && ($home ne '') && ($home ne 'no_host')) { |
$editbutton = &get_editbutton($cfile,$home,$switchserver, |
$editbutton = &get_editbutton($cfile,$home,$switchserver, |
$forceedit,$forceview,$forcereg); |
$forceedit,$forceview,$forcereg); |
|
} |
} |
} |
} elsif ($env{'request.course.id'}) { |
} elsif ($env{'request.course.id'}) { |
# |
# |
Line 1975 sub prepare_functions {
|
Line 2109 sub prepare_functions {
|
} elsif (($resurl !~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) && |
} elsif (($resurl !~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) && |
($resurl ne '/cgi-bin/printout.pl')) { |
($resurl ne '/cgi-bin/printout.pl')) { |
if ($env{'request.filename'}) { |
if ($env{'request.filename'}) { |
my $file=&Apache::lonnet::declutter($env{'request.filename'}); |
my $file; |
|
my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
|
if ($env{'request.filename'} =~ m{^\Q$londocroot\E/priv/}) { |
|
$file = $env{'request.filename'}; |
|
$file =~ s{^\Q$londocroot\E/}{}; |
|
} else { |
|
$file=&Apache::lonnet::declutter($env{'request.filename'}); |
|
} |
($cfile,$home,$switchserver,$forceedit,$forceview) = |
($cfile,$home,$switchserver,$forceedit,$forceview) = |
&Apache::lonnet::can_edit_resource($file,$cnum,$cdom, |
&Apache::lonnet::can_edit_resource($file,$cnum,$cdom, |
&Apache::lonnet::clutter($resurl),$env{'request.symb'},$group); |
&Apache::lonnet::clutter($resurl),$env{'request.symb'},$group); |
Line 2118 sub advtools_crumbs {
|
Line 2259 sub advtools_crumbs {
|
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
'advtools', @funcs[61,64,65,66,67,74]); |
'advtools', @funcs[61,64,65,66,67,74]); |
} elsif ($env{'request.noversionuri'} !~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) { |
} elsif ($env{'request.noversionuri'} !~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) { |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
if ($env{'request.state'} eq 'construct') { |
'advtools', @funcs[61,71,72,73,74,75,92]); |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
|
'advtools', @funcs[61,73,74,71,72,77]); |
|
} else { |
|
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
|
'advtools', @funcs[61,71,72,73,74,75,92]); |
|
} |
} elsif ($env{'request.noversionuri'} eq '/adm/viewclasslist') { |
} elsif ($env{'request.noversionuri'} eq '/adm/viewclasslist') { |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
'advtools', $funcs[61]); |
'advtools', $funcs[61]); |
Line 2365 sub rawconfig {
|
Line 2511 sub rawconfig {
|
} else { |
} else { |
next; |
next; |
} |
} |
|
} elsif ($priv eq 'cca') { |
|
next if ($rol eq 'cm'); |
} |
} |
if ((($priv eq 'bre') && (&Apache::lonnet::allowed($priv,$prt) eq 'F')) || |
if ((($priv eq 'bre') && (&Apache::lonnet::allowed($priv,$prt) eq 'F')) || |
(($priv ne 'bre') && (&Apache::lonnet::allowed($priv,$prt)))) { |
(($priv ne 'bre') && (&Apache::lonnet::allowed($priv,$prt)))) { |
Line 2446 sub rawconfig {
|
Line 2594 sub rawconfig {
|
} |
} |
} |
} |
} |
} |
|
} elsif ($pro eq 'coauthor') { |
|
if ($env{'request.role'}=~ m{^(ca|aa)\./($match_domain)/($match_username)$}) { |
|
my ($role,$audom,$auname) = ($1,$2,$3); |
|
if ((($prt eq 'raa') && ($role eq 'aa')) || |
|
(($prt eq 'rca') && ($role eq 'ca') && |
|
(!$env{"environment.internal.manager./$audom/$auname"}))) { |
|
$output.=&switch($auname,$audom, |
|
$row,$col,$img,$top,$bot,$act,$desc,$cat); |
|
} |
|
} |
|
} elsif ($pro eq 'coauthorenv_manager') { |
|
if ($env{'request.role'}=~ m{^ca\./($match_domain)/($match_username)$}) { |
|
my ($audom,$auname) = ($1,$2); |
|
if ($env{"environment.internal.manager./$audom/$auname"}) { |
|
$output.=&switch($auname,$audom, |
|
$row,$col,$img,$top,$bot,$act,$desc,$cat); |
|
} |
|
} |
} elsif ($pro eq 'tools') { |
} elsif ($pro eq 'tools') { |
my @tools = ('aboutme','blog','portfolio'); |
my @tools = ('aboutme','blog','portfolio'); |
if (grep(/^\Q$prt\E$/,@tools)) { |
if (grep(/^\Q$prt\E$/,@tools)) { |
Line 2931 sub utilityfunctions {
|
Line 3097 sub utilityfunctions {
|
|
|
my $esc_url=&escape($currenturl); |
my $esc_url=&escape($currenturl); |
my $esc_symb=&escape($currentsymb); |
my $esc_symb=&escape($currentsymb); |
|
my $newname = &mt('New Name'); |
|
&js_escape(\$newname); |
|
|
my $countdown = &countdown_toggle_js(); |
my $countdown = &countdown_toggle_js(); |
|
|
Line 3022 function gocstr(url,filename) {
|
Line 3190 function gocstr(url,filename) {
|
this.document.cstrdelete.submit(); |
this.document.cstrdelete.submit(); |
return; |
return; |
} |
} |
|
if ((url == '/adm/cfile?action=copy') || (url == '/adm/cfile?action=rename')) { |
|
this.document.cstrcopy.filename.value = filename; |
|
var oldname = filename.substring(filename.lastIndexOf("/") + 1); |
|
var newname=prompt('$newname',oldname); |
|
if (newname == "" || !newname || newname == oldname) { |
|
return; |
|
} |
|
if (url == '/adm/cfile?action=rename') { |
|
this.document.cstrcopy.action.value = 'rename'; |
|
} else { |
|
this.document.cstrcopy.action.value = 'copy'; |
|
} |
|
this.document.cstrcopy.newfilename.value = newname; |
|
this.document.cstrcopy.submit(); |
|
return; |
|
} |
if (url == '/adm/printout') { |
if (url == '/adm/printout') { |
this.document.cstrprint.postdata.value = filename |
this.document.cstrprint.postdata.value = filename |
this.document.cstrprint.curseed.value = 0; |
this.document.cstrprint.curseed.value = 0; |
Line 3048 function gocstr(url,filename) {
|
Line 3232 function gocstr(url,filename) {
|
this.document.cstrprint.submit(); |
this.document.cstrprint.submit(); |
return; |
return; |
} |
} |
|
if (url == '/adm/preferences?action=authorsettings') { |
|
document.location.href=url+'&returnurl='+filename; |
|
return; |
|
} |
if (url !='') { |
if (url !='') { |
this.document.constspace.filename.value = filename; |
this.document.constspace.filename.value = filename; |
this.document.constspace.action = url; |
this.document.constspace.action = url; |
Line 3199 sub constspaceform {
|
Line 3387 sub constspaceform {
|
<input type="hidden" name="curseed" value="" /> |
<input type="hidden" name="curseed" value="" /> |
<input type="hidden" name="problemtype" value="" /> |
<input type="hidden" name="problemtype" value="" /> |
</form> |
</form> |
|
<form name="cstrcopy" action="/adm/cfile" method="post"$target> |
|
<input type="hidden" name="action" value="copy" /> |
|
<input type="hidden" name="filename" value="" /> |
|
<input type="hidden" name="newfilename" value="" /> |
|
</form> |
|
|
ENDCONSTSPACEFORM |
ENDCONSTSPACEFORM |
} |
} |