version 1.558, 2024/11/22 22:43:54
|
version 1.561, 2025/02/21 04:29:26
|
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 813 sub create_submenu {
|
Line 817 sub create_submenu {
|
my $menu = '<li class="LC_hoverable '.$addclass.'">'. |
my $menu = '<li class="LC_hoverable '.$addclass.'">'. |
'<a href="'.$link.'"'.$targetattr.'>'. |
'<a href="'.$link.'"'.$targetattr.'>'. |
'<span class="LC_nobreak">'.$title. |
'<span class="LC_nobreak">'.$title. |
'<span class="LC_fontsize_small" style="font-weight:normal;">'. |
'<span class="LC_fontsize_medium" style="font-weight:normal;">'. |
' ▼</span></span></a>'. |
' ▼</span></span></a>'. |
'<ul>'; |
'<ul>'; |
|
|
Line 1106 sub innerregister {
|
Line 1110 sub innerregister {
|
if ($perms{'mgr'}) { |
if ($perms{'mgr'}) { |
&switch('','',7,2,'pgrd.png','Content Grades','grades[_4]', |
&switch('','',7,2,'pgrd.png','Content Grades','grades[_4]', |
"gocmd('/adm/grades','gradingmenu')", |
"gocmd('/adm/grades','gradingmenu')", |
'Content Grades'); |
'Grading for Resource/Folder'); |
} elsif ($perms{'vgr'}) { |
} elsif ($perms{'vgr'}) { |
&switch('','',7,2,'subm.png','Content Submissions','missions[_1]', |
&switch('','',7,2,'subm.png','Content Submissions','missions[_1]', |
"gocmd('/adm/grades','submission')", |
"gocmd('/adm/grades','submission')", |
'Content Submissions'); |
'Submissions for Resource/Folder'); |
} |
} |
} |
} |
if (($env{'request.symb'} ne '') && (($perms{'opa'}) || ($perms{'vpa'}))) { |
if (($env{'request.symb'} ne '') && (($perms{'opa'}) || ($perms{'vpa'}))) { |
&switch('','',7,3,'pparm.png','Content Settings','parms[_2]', |
&switch('','',7,3,'pparm.png','Content Settings','parms[_2]', |
"gocmd('/adm/parmset','set')", |
"gocmd('/adm/parmset','set')", |
'Content Settings'); |
'Content Settings for Resource/Folder'); |
} |
} |
# End grades/submissions check |
# End grades/submissions check |
|
|
Line 1143 sub innerregister {
|
Line 1147 sub innerregister {
|
if (($env{'request.symb'} ne '') && |
if (($env{'request.symb'} ne '') && |
($env{'request.filename'}=~/$LONCAPA::assess_re/) && |
($env{'request.filename'}=~/$LONCAPA::assess_re/) && |
(($perms{'mgr'}) || ($perms{'vgr'}))) { |
(($perms{'mgr'}) || ($perms{'vgr'}))) { |
my ($viewas,$text,$change,$visibility,$vuname,$vudom,$vid,$leftvis,$defdom, |
my ($viewas,$text,$change,$visibility,$vuname,$vudom,$vid,$leftvis,$rightvis, |
$domselector,$righticon); |
$defdom,$domselector,$righticon); |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
view => 'View', |
view => 'View', |
upda => 'Update', |
upda => 'Update', |
|
user => 'View as user', |
|
choo => 'Choose user', |
); |
); |
my $possdomstr = $env{'course.'.$env{'request.course.id'}.'.internal.userdomains'}; |
my $possdomstr = $env{'course.'.$env{'request.course.id'}.'.internal.userdomains'}; |
if ($possdomstr =~ /,/) { |
if ($possdomstr =~ /,/) { |
Line 1159 sub innerregister {
|
Line 1165 sub innerregister {
|
} elsif (&Apache::lonnet::domain($possdoms[0]) ne '') { |
} elsif (&Apache::lonnet::domain($possdoms[0]) ne '') { |
$defdom = $possdoms[0]; |
$defdom = $possdoms[0]; |
} |
} |
$domselector = &Apache::loncommon::select_dom_form($defdom,'vudom','','','',\@possdoms); |
$domselector = &Apache::loncommon::select_dom_form($defdom,'vudom','','','', |
|
\@possdoms,'','','vudom'). |
|
'<span class="LC_visually_hidden"><label for="vudom">'. |
|
&mt("user's domain").'</label></span>'; |
} elsif (($possdomstr ne '') && (&Apache::lonnet::domain($possdomstr) ne '')) { |
} elsif (($possdomstr ne '') && (&Apache::lonnet::domain($possdomstr) ne '')) { |
if ($env{'request.user_in_effect'} =~ /^$match_username:($match_domain)$/) { |
if ($env{'request.user_in_effect'} =~ /^$match_username:($match_domain)$/) { |
$defdom = $1; |
$defdom = $1; |
Line 1177 sub innerregister {
|
Line 1186 sub innerregister {
|
$change = 'off'; |
$change = 'off'; |
$visibility = 'inline'; |
$visibility = 'inline'; |
$leftvis = 'none'; |
$leftvis = 'none'; |
|
$rightvis = 'inline'; |
$defdom = $vudom; |
$defdom = $vudom; |
$righticon = '✖'; |
$righticon = '✖'; |
} else { |
} else { |
Line 1184 sub innerregister {
|
Line 1194 sub innerregister {
|
$change = 'on'; |
$change = 'on'; |
$visibility = 'none'; |
$visibility = 'none'; |
$leftvis = 'inline'; |
$leftvis = 'inline'; |
|
$rightvis = 'none'; |
|
$righticon = '◄'; |
if ($defdom eq '') { |
if ($defdom eq '') { |
$defdom = $cdom; |
$defdom = $cdom; |
} |
} |
Line 1208 sub innerregister {
|
Line 1220 sub innerregister {
|
$input .= '<input name="LC_viewas" type="hidden" value="'.$viewas.'" />', |
$input .= '<input name="LC_viewas" type="hidden" value="'.$viewas.'" />', |
'<input name="symb" type="hidden" value="'.$shownsymb.'" />'; |
'<input name="symb" type="hidden" value="'.$shownsymb.'" />'; |
my $chooser = <<END; |
my $chooser = <<END; |
|
<span class="LC_visually_hidden"> |
|
<label for="LC_vuname" id="LC_vuidentifier">$lt{'user'}</label> |
|
</span> |
$selscript |
$selscript |
<a href="javascript:toggleViewAsUser('$change');" class="LC_menubuttons_link"> |
<a href="javascript:toggleViewAsUser('$change');" class="LC_menubuttons_link" id="usexpand" style="display:$leftvis;"> |
<span id="usexpand" class="LC_menubuttons_inline_text" style="display:$leftvis">► </span> |
<span class="LC_menubuttons_inline_text">► </span> |
</a> |
</a> |
<fieldset id="LC_selectuser" style="display:$visibility"> |
<fieldset id="LC_selectuser" style="display:$visibility;"><legend class="LC_visually_hidden">$lt{'choo'}</legend> |
<form name="userview" action="" method="post" onsubmit="event.preventDefault(); return validCourseUser(this,'$change');"> |
<form name="userview" action="" method="post" onsubmit="event.preventDefault(); return validCourseUser(this,'$change');"> |
<span class="LC_menubuttons_inline_text LC_nobreak"> |
<span class="LC_menubuttons_inline_text LC_nobreak"> |
$input |
$input |
Line 1221 $sellink
|
Line 1236 $sellink
|
<input type="submit" value="$text" /> |
<input type="submit" value="$text" /> |
</form> |
</form> |
</fieldset> |
</fieldset> |
<a href="javascript:toggleViewAsUser('$change');" class="LC_menubuttons_link"> |
<a href="javascript:toggleViewAsUser('$change');" class="LC_menubuttons_link" id="uscollapse" style="display:$rightvis"> |
<span id="uscollapse" class="LC_menubuttons_inline_text">$righticon</span> |
<span class="LC_menubuttons_inline_text">$righticon</span> |
</a> |
</a> |
END |
END |
&switch('','',7,5,'viewuser.png','View As','user[_1]', |
&switch('','',7,5,'viewuser.png','View As','user[_1]', |
'toggleViewAsUser('."'$change'".')', |
'toggleViewAsUser('."'$change'".')', |
'View As','','',$chooser); |
'View resource as user','','',$chooser); |
} |
} |
# End view as user check |
# End view as user check |
|
|
Line 1921 sub advtools_crumbs {
|
Line 1936 sub advtools_crumbs {
|
sub clear { |
sub clear { |
my ($row,$col)=@_; |
my ($row,$col)=@_; |
$inlineremote[10*$row+$col]=''; |
$inlineremote[10*$row+$col]=''; |
return ''; |
return ''; |
} |
} |
|
|
# ============================================ Switch a button or create a link |
# ============================================ Switch a button or create a link |
Line 1932 sub switch {
|
Line 1947 sub switch {
|
my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat,$nobreak,$form)=@_; |
my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat,$nobreak,$form)=@_; |
$act=~s/\$uname/$uname/g; |
$act=~s/\$uname/$uname/g; |
$act=~s/\$udom/$udom/g; |
$act=~s/\$udom/$udom/g; |
$top=&mt($top); |
|
$bot=&mt($bot); |
|
$desc=&mt($desc); |
$desc=&mt($desc); |
my $idx=10*$row+$col; |
my $idx=10*$row+$col; |
$category_members{$cat}.=':'.$idx; |
$category_members{$cat}.=':'.$idx; |
|
|
# Inline Menu |
# Inline Menu |
if ($nobreak==2) { return ''; } |
if ($nobreak==2) { return ''; } |
my $text=$top.' '.$bot; |
my ($text,$alttext); |
|
$text=&mt($top).' '.&mt($bot); |
$text=~s/\s*\-\s*//gs; |
$text=~s/\s*\-\s*//gs; |
|
if ($top) { |
|
$alttext = &mt("$top icon"); |
|
} elsif ($bot) { |
|
$alttext = &mt("$bot icon"); |
|
} elsif ($nobreak == 3) { |
|
$alttext = &mt('Go forward icon'); |
|
} elsif ($nobreak) { |
|
$alttext = &mt('Go back icon'); |
|
} else { |
|
$alttext = &mt('icon'); |
|
} |
|
|
my $pic= |
my $pic= |
'<img alt="'.$text.'" src="'. |
'<img alt="'.$alttext.'" src="'. |
&Apache::loncommon::lonhttpdurl('/res/adm/pages/'.$img). |
&Apache::loncommon::lonhttpdurl('/res/adm/pages/'.$img). |
'" align="'.($nobreak==3?'right':'left').'" class="LC_icon" />'; |
'" align="'.($nobreak==3?'right':'left').'" class="LC_icon" />'; |
if ($env{'browser.interface'} eq 'faketextual') { |
if ($env{'browser.interface'} eq 'faketextual') { |
# Main Menu |
# Main Menu |
if ($nobreak==3) { |
if ($nobreak==3) { |
$inlineremote[$idx]="\n". |
$inlineremote[$idx]="\n". |
'<td class="LC_menubuttons_text" align="right">'.$text. |
'<th class="LC_menubuttons_text" align="right">'.$text. |
'</td><td align="left">'. |
'</th><td align="left">'. |
'<a href="javascript:'.$act.';">'.$pic.'</a></td></tr>'; |
'<a href="javascript:'.$act.';">'.$pic.'</a></td></tr>'; |
} elsif ($nobreak) { |
} elsif ($nobreak) { |
$inlineremote[$idx]="\n<tr>". |
$inlineremote[$idx]="\n<tr>". |
'<td align="left">'. |
'<th align="left">'. |
'<a href="javascript:'.$act.';">'.$pic.'</a></td> |
'<a href="javascript:'.$act.';">'.$pic.'</a></th> |
<td class="LC_menubuttons_text" align="left"><a class="LC_menubuttons_link" href="javascript:'.$act.';"><span class="LC_menubuttons_inline_text">'.$text.'</span></a></td>'; |
<td class="LC_menubuttons_text" align="left"><a class="LC_menubuttons_link" href="javascript:'.$act.';"><span class="LC_menubuttons_inline_text">'.$text.'</span></a></td>'; |
} else { |
} else { |
$inlineremote[$idx]="\n<tr>". |
$inlineremote[$idx]="\n<tr>". |
'<td align="left">'. |
'<th align="left">'. |
'<a href="javascript:'.$act.';">'.$pic. |
'<a href="javascript:'.$act.';">'.$pic. |
'</a></td><td class="LC_menubuttons_text" colspan="3">'. |
'</a></th><td class="LC_menubuttons_text" colspan="3">'. |
'<a class="LC_menubuttons_link" href="javascript:'.$act.';"><span class="LC_menubuttons_inline_text">'.$desc.'</span></a></td></tr>'; |
'<a class="LC_menubuttons_link" href="javascript:'.$act.';"><span class="LC_menubuttons_inline_text">'.$desc.'</span></a></td></tr>'; |
} |
} |
} else { |
} else { |
Line 1978 sub switch {
|
Line 2003 sub switch {
|
$inlineremote[$idx] = |
$inlineremote[$idx] = |
'<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.'</a>'; |
'<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.'</a>'; |
} else { |
} else { |
|
my $linktext = &mt($top); |
$inlineremote[$idx] = |
$inlineremote[$idx] = |
'<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic. |
'<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic. |
'<span class="LC_menubuttons_inline_text">'.$top.' </span></a>'.$form; |
'<span class="LC_menubuttons_inline_text">'.$linktext.' </span></a>'.$form; |
} |
} |
} |
} |
return ''; |
return ''; |
Line 2005 sub inlinemenu {
|
Line 2031 sub inlinemenu {
|
undef(%category_members); |
undef(%category_members); |
# calling rawconfig with "1" will evaluate mydesk.tab, even if there is no active remote control |
# calling rawconfig with "1" will evaluate mydesk.tab, even if there is no active remote control |
&rawconfig(1); |
&rawconfig(1); |
my $output='<table><tr>'; |
my $output='<div class="LC_landmark" role="main">'."\n"; |
for (my $col=1; $col<=2; $col++) { |
for (my $col=1; $col<=2; $col++) { |
$output.='<td class="LC_mainmenu_col_fieldset">'; |
$output .= '<div class="LC_mainmenu">'."\n"; |
for (my $row=1; $row<=8; $row++) { |
for (my $row=1; $row<=8; $row++) { |
foreach my $cat (keys(%category_members)) { |
foreach my $cat (keys(%category_members)) { |
if ($category_positions{$cat} ne "$col,$row") { next; } |
if ($category_positions{$cat} ne "$col,$row") { next; } |
#$output.='<table><tr><td colspan="4" class="LC_menubuttons_category">'.&mt($category_names{$cat}).'</td></tr>'; |
#$output.='<table><tr><td colspan="4" class="LC_menubuttons_category">'.&mt($category_names{$cat}).'</td></tr>'; |
$output.='<div class="LC_Box LC_400Box">'; |
$output.='<div class="LC_Box LC_400Box">'; |
$output.='<h3 class="LC_hcell">'.&mt($category_names{$cat}).'</h3>'; |
$output.='<h2 class="LC_hcell LC_heading_2">'.&mt($category_names{$cat}).'</h2>'; |
$output.='<table>'; |
$output.='<table>'; |
my %active=(); |
my %active=(); |
foreach my $menu_item (split(/\:/,$category_members{$cat})) { |
foreach my $menu_item (split(/\:/,$category_members{$cat})) { |
Line 2028 sub inlinemenu {
|
Line 2054 sub inlinemenu {
|
$output.='</div>'; |
$output.='</div>'; |
} |
} |
} |
} |
$output.="</td>"; |
$output.="</div>"; |
} |
} |
$output.="</tr></table>"; |
$output .= '<div style="clear:both"></div></div>'."\n"; |
return $output; |
return $output; |
} |
} |
|
|
Line 2564 function toggleViewAsUser(change) {
|
Line 2590 function toggleViewAsUser(change) {
|
if ((document.getElementById('usexpand')) && (document.getElementById('uscollapse'))) { |
if ((document.getElementById('usexpand')) && (document.getElementById('uscollapse'))) { |
if (currstyle == 'inline') { |
if (currstyle == 'inline') { |
seluserid.style.display = 'none'; |
seluserid.style.display = 'none'; |
document.getElementById('usexpand').innerHTML='► '; |
document.getElementById('usexpand').style.display= 'inline'; |
document.getElementById('uscollapse').innerHTML=''; |
document.getElementById('uscollapse').style.display = 'none'; |
} else { |
} else { |
seluserid.style.display = 'inline'; |
seluserid.style.display = 'inline'; |
document.getElementById('usexpand').innerHTML=''; |
|
document.getElementById('uscollapse').innerHTML='◄ '; |
|
toggleIdentifier(document.userview); |
toggleIdentifier(document.userview); |
|
document.getElementById('usexpand').style.display = 'none'; |
|
document.getElementById('uscollapse').style.display = 'inline'; |
} |
} |
} |
} |
} |
} |
Line 2624 function validCourseUser(form,change) {
|
Line 2650 function validCourseUser(form,change) {
|
|
|
function toggleIdentifier(form) { |
function toggleIdentifier(form) { |
if ((document.getElementById('LC_vuname')) && (document.getElementById('LC_vid'))) { |
if ((document.getElementById('LC_vuname')) && (document.getElementById('LC_vid'))) { |
|
var identifylabel = document.getElementById('LC_vuidentifier'); |
|
var identifier; |
|
var userbyuname; |
var radioelem = form.elements['vuidentifier']; |
var radioelem = form.elements['vuidentifier']; |
if (radioelem.length > 0) { |
if (radioelem.length > 0) { |
var i; |
var i; |
for (i=0; i<radioelem.length; i++) { |
for (i=0; i<radioelem.length; i++) { |
if (radioelem[i].checked == true) { |
if (radioelem[i].checked == true) { |
if (radioelem[i].value == 'uname') { |
if (radioelem[i].value == 'uname') { |
|
userbyuname = 1; |
document.getElementById('LC_vuname').type = 'text'; |
document.getElementById('LC_vuname').type = 'text'; |
document.getElementById('LC_vid').type = 'hidden'; |
document.getElementById('LC_vid').type = 'hidden'; |
document.getElementById('LC_vid').value = ''; |
document.getElementById('LC_vid').value = ''; |
} else { |
} else { |
|
userbyuname = 0; |
document.getElementById('LC_vuname').type = 'hidden'; |
document.getElementById('LC_vuname').type = 'hidden'; |
document.getElementById('LC_vuname').value = ''; |
document.getElementById('LC_vuname').value = ''; |
document.getElementById('LC_vid').type = 'text'; |
document.getElementById('LC_vid').type = 'text'; |
Line 2641 function toggleIdentifier(form) {
|
Line 2672 function toggleIdentifier(form) {
|
break; |
break; |
} |
} |
} |
} |
|
if (identifylabel) { |
|
if (userbyuname) { |
|
identifylabel.setAttribute("for","LC_vuname"); |
|
} else { |
|
identifylabel.setAttribute("for","LC_vid"); |
|
} |
|
} |
} |
} |
} |
} |
return; |
return; |