version 1.547, 2024/04/18 16:42:58
|
version 1.560, 2025/01/07 22:21:56
|
Line 615 sub secondary_menu {
|
Line 615 sub secondary_menu {
|
&& !$env{'request.course.id'}; |
&& !$env{'request.course.id'}; |
next if $$menuitem[4] =~ /^crsedit/ |
next if $$menuitem[4] =~ /^crsedit/ |
&& (!$canedit && !$canvieweditor); |
&& (!$canedit && !$canvieweditor); |
|
next if $$menuitem[4] eq 'crseditCourse' |
|
&& ($crstype eq 'Community'); |
|
next if $$menuitem[4] eq 'crseditCommunity' |
|
&& ($crstype ne 'Community'); |
next if $$menuitem[4] eq 'nvgr' |
next if $$menuitem[4] eq 'nvgr' |
&& ($canvgr || $ltiexc{'grades'}); |
&& ($canvgr || $ltiexc{'grades'}); |
next if $$menuitem[4] eq 'vgr' |
next if $$menuitem[4] eq 'vgr' |
Line 910 sub innerregister {
|
Line 914 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 1235 END
|
Line 1239 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,$crsauthor); |
my ($menuitems,$got_prt,$got_wishlist,$crsauthor,$toplevel_cstr,$crsauthor_cstr); |
if ($const_space) { |
if ($const_space) { |
# |
# |
# We are in construction space |
# We are in construction space |
# |
# |
Line 1244 END
|
Line 1248 END
|
my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
my ($udom,$uname,$thisdisfn) = |
my ($udom,$uname,$thisdisfn) = |
($env{'request.filename'}=~m{^\Q$londocroot/priv/\E([^/]+)/([^/]+)/(.*)$}); |
($env{'request.filename'}=~m{^\Q$londocroot/priv/\E([^/]+)/([^/]+)/(.*)$}); |
my $crsauthor; |
|
if (($env{'request.course.id'}) && |
if (($env{'request.course.id'}) && |
($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) && |
($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) && |
($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) { |
($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) { |
$crsauthor = 1; |
$crsauthor_cstr = 1; |
} |
} |
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 '') && ($crsauthor)) { |
$toplevel_cstr = 1; |
$is_const_dir = 2; |
|
} |
} |
my $esc_currdir = &Apache::loncommon::escape_single($currdir); |
my $esc_currdir = &Apache::loncommon::escape_single($currdir); |
$menuitems=(<<ENDMENUITEMS); |
$menuitems=(<<ENDMENUITEMS); |
Line 1263 s&7&4&docs-22x22.png&Edit Metadata&defau
|
Line 1265 s&7&4&docs-22x22.png&Edit Metadata&defau
|
s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','$esc_currdir')&Print contents of 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 |
s&7&1&del.png&Delete&dir[_3]&gocstr('/adm/cfile?action=delete','$esc_currdir')&Delete this Directory |
ENDMENUITEMS |
ENDMENUITEMS |
|
unless ($crsauthor_cstr) { |
|
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); |
Line 1277 ENDMENUITEMS
|
Line 1287 ENDMENUITEMS
|
# |
# |
# Probably should be in mydesk.tab |
# Probably should be in mydesk.tab |
# |
# |
if (($crsauthor) && ($pubfile eq "/res/$udom/$uname/default.rights")) { |
if (($crsauthor_cstr) && ($pubfile eq "/res/$udom/$uname/default.rights")) { |
$menuitems=(<<ENDMENUITEMS); |
$menuitems=(<<ENDMENUITEMS); |
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&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 |
Line 1307 ENDMENUITEMS
|
Line 1317 ENDMENUITEMS
|
s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','/priv/$udom/$uname/$cleandisfn')&Prepare a printable document |
s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','/priv/$udom/$uname/$cleandisfn')&Prepare a printable document |
ENDMENUITEMS |
ENDMENUITEMS |
} |
} |
|
# |
|
# "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)/) { |
|
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(); |
Line 1517 ENDMENUITEMS
|
Line 1555 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 1526 ENDMENUITEMS
|
Line 1569 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 ($showprogress) { |
if ($showprogress) { |
Line 1536 ENDMENUITEMS
|
Line 1585 ENDMENUITEMS
|
} |
} |
} |
} |
my ($topic_help,$topic_help_text); |
my ($topic_help,$topic_help_text); |
if ($is_const_dir == 2) { |
if ($toplevel_cstr && !$crsauthor_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 1859 sub advtools_crumbs {
|
Line 1908 sub advtools_crumbs {
|
} elsif ($env{'request.noversionuri'} !~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) { |
} elsif ($env{'request.noversionuri'} !~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) { |
if ($env{'request.state'} eq 'construct') { |
if ($env{'request.state'} eq 'construct') { |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
'advtools', @funcs[61,73,74,71,72]); |
'advtools', @funcs[61,73,74,71,72,77]); |
} else { |
} else { |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
'advtools', @funcs[61,71,72,73,74,75,92]); |
'advtools', @funcs[61,71,72,73,74,75,92]); |
Line 2642 sub utilityfunctions {
|
Line 2691 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'); |
my $newname = &mt('New Name'); |
|
&js_escape(\$newname); |
|
|
my $countdown = &countdown_toggle_js(); |
my $countdown = &countdown_toggle_js(); |
|
|
Line 2650 sub utilityfunctions {
|
Line 2700 sub utilityfunctions {
|
($env{'request.symb'} ne '') && |
($env{'request.symb'} ne '') && |
($env{'request.filename'}=~/$LONCAPA::assess_re/)) { |
($env{'request.filename'}=~/$LONCAPA::assess_re/)) { |
my $canview; |
my $canview; |
foreach my $priv ('msg','vgr') { |
foreach my $priv ('mgr','vgr') { |
$canview = &Apache::lonnet::allowed($priv,$env{'request.course.id'}); |
$canview = &Apache::lonnet::allowed($priv,$env{'request.course.id'}); |
if (!$canview && $env{'request.course.sec'} ne '') { |
if (!$canview && $env{'request.course.sec'} ne '') { |
$canview = |
$canview = |
Line 2775 function gocstr(url,filename) {
|
Line 2825 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 2892 sub serverform {
|
Line 2946 sub serverform {
|
if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self')) { |
if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self')) { |
$target = ' target="_self"'; |
$target = ' target="_self"'; |
} |
} |
|
my $submit = &mt('Submit'); |
return(<<ENDSERVERFORM); |
return(<<ENDSERVERFORM); |
<form name="server" action="/adm/logout" method="post"$target> |
<form name="server" action="/adm/logout" method="post"$target aria-hidden="true"> |
<input type="hidden" name="postdata" value="none" /> |
<input type="hidden" name="postdata" value="none" /> |
<input type="hidden" name="command" value="none" /> |
<input type="hidden" name="command" value="none" /> |
<input type="hidden" name="url" value="none" /> |
<input type="hidden" name="url" value="none" /> |
<input type="hidden" name="symb" value="none" /> |
<input type="hidden" name="symb" value="none" /> |
|
<input type="submit" value="$submit" class="LC_visually_hidden" tabindex="-1" disabled="disabled" /> |
</form> |
</form> |
ENDSERVERFORM |
ENDSERVERFORM |
} |
} |
Line 3062 sub roles_selector {
|
Line 3118 sub roles_selector {
|
$js = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles,\%courseprivs, |
$js = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles,\%courseprivs, |
\%roledesc,$privref,$menucoll,$menuref); |
\%roledesc,$privref,$menucoll,$menuref); |
$form = |
$form = |
'<form name="rolechooser" method="post" action="'.$httphost.'/adm/roles"'.$targetattr.'>'."\n". |
'<form name="rolechooser" method="post" action="'.$httphost.'/adm/roles"'.$targetattr.' aria-hidden="true">'."\n". |
' <input type="hidden" name="destinationurl" value="'. |
' <input type="hidden" name="destinationurl" value="'. |
&HTML::Entities::encode($destinationurl).'" />'."\n". |
&HTML::Entities::encode($destinationurl).'" />'."\n". |
' <input type="hidden" name="gotorole" value="1" />'."\n". |
' <input type="hidden" name="gotorole" value="1" />'."\n". |
Line 3072 sub roles_selector {
|
Line 3128 sub roles_selector {
|
$form .= ' <input type="hidden" name="destsymb" value="'. |
$form .= ' <input type="hidden" name="destsymb" value="'. |
&HTML::Entities::encode($destsymb).'" />'."\n"; |
&HTML::Entities::encode($destsymb).'" />'."\n"; |
} |
} |
$form .= '</form>'."\n"; |
$form .= '<input type="submit" value="'.&mt('Submit').'" class="LC_visually_hidden" tabindex="-1" disabled="disabled" />'."\n". |
|
'</form>'."\n"; |
foreach my $role (@roles_order) { |
foreach my $role (@roles_order) { |
my $include; |
my $include; |
if (defined($courseroles{$role})) { |
if (defined($courseroles{$role})) { |
Line 3561 $donebutton
|
Line 3618 $donebutton
|
<span id="ddcountcollapse" class="LC_menubuttons_inline_text"> |
<span id="ddcountcollapse" class="LC_menubuttons_inline_text"> |
$collapse |
$collapse |
</span></a> |
</span></a> |
<span id="duedatecountdown" class="LC_menubuttons_inline_text" style="display: $currdisp;"></span> |
<span id="duedatecountdown" class="LC_menubuttons_inline_text" style="display: $currdisp;" role="timer"></span> |
<a href="javascript:toggleCountdown();" class="LC_menubuttons_link"> |
<a href="javascript:toggleCountdown();" class="LC_menubuttons_link"> |
<span id="ddcountexpand" class="LC_menubuttons_inline_text" >$expand</span> |
<span id="ddcountexpand" class="LC_menubuttons_inline_text" >$expand</span> |
<img src="/res/adm/pages/timer.png" title="$desc" class="LC_icon" alt="$alttxt" /><span class="LC_menubuttons_inline_text">$title</span></a> |
<img src="/res/adm/pages/timer.png" title="$desc" class="LC_icon" alt="$alttxt" /><span class="LC_menubuttons_inline_text">$title</span></a> |