version 1.194, 2006/07/10 22:34:36
|
version 1.214, 2007/04/13 20:22:15
|
Line 44 use Apache::lonhtmlcommon();
|
Line 44 use Apache::lonhtmlcommon();
|
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonenc(); |
use Apache::lonenc(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use lib '/home/httpd/lib/perl/'; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA; |
|
|
|
use vars qw(@desklines $readdesk); |
use vars qw(@desklines %category_names %category_members %category_positions $readdesk); |
|
|
|
|
my @inlineremote; |
my @inlineremote; |
|
|
|
|
|
|
# ================================================================ Little texts |
# ================================================================ Little texts |
|
|
sub initlittle { |
sub initlittle { |
Line 62 sub initlittle {
|
Line 63 sub initlittle {
|
'Roles':'Courses'), |
'Roles':'Courses'), |
'docs' => 'Course Documents', |
'docs' => 'Course Documents', |
'exit' => 'Exit', |
'exit' => 'Exit', |
|
'login' => 'Log In', |
'launch' => 'Launch Remote Control', |
'launch' => 'Launch Remote Control', |
'groups' => 'Groups', |
'groups' => 'Groups', |
'gdoc' => 'Group Documents', |
'gdoc' => 'Group Documents', |
'teams' => 'Teams', |
|
); |
); |
} |
} |
|
|
Line 91 sub menubuttons {
|
Line 92 sub menubuttons {
|
my $escurl=&escape(&Apache::lonenc::check_encrypt($env{'request.noversionuri'})); |
my $escurl=&escape(&Apache::lonenc::check_encrypt($env{'request.noversionuri'})); |
my $escsymb=&escape(&Apache::lonenc::check_encrypt($env{'request.symb'})); |
my $escsymb=&escape(&Apache::lonenc::check_encrypt($env{'request.symb'})); |
|
|
|
my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif"); |
|
$logo = '<td class="LC_top_nav_logo"><a href="/adm/about.html"><img src="'. |
|
$logo.'" alt="LON-CAPA Logo" /></a></td>'; |
|
|
if ($env{'request.state'} eq 'construct') { |
if ($env{'request.state'} eq 'construct') { |
if (($env{'request.noversionuri'} eq '') || (!defined($env{'request.noversionuri'}))) { |
if (($env{'request.noversionuri'} eq '') || (!defined($env{'request.noversionuri'}))) { |
my $returnurl = $env{'request.filename'}; |
my $returnurl = $env{'request.filename'}; |
Line 101 sub menubuttons {
|
Line 106 sub menubuttons {
|
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
my %coursegroups; |
my %coursegroups; |
my $viewgrps_permission = |
my $viewgrps_permission = |
&Apache::lonnet::allowed('vcg',$env{'request.course.id'}); |
&Apache::lonnet::allowed('vcg',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')); |
if (!$viewgrps_permission) { |
if (!$viewgrps_permission) { |
%coursegroups = &Apache::lonnet::get_active_groups($env{'user.domain'},$env{'user.name'},$env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'}); |
%coursegroups = &Apache::lonnet::get_active_groups($env{'user.domain'},$env{'user.name'},$env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'}); |
} |
} |
Line 129 ENDRELOAD
|
Line 134 ENDRELOAD
|
<a href="/adm/coursedocs" target="_top">$lt{'docs'}</a> |
<a href="/adm/coursedocs" target="_top">$lt{'docs'}</a> |
ENDDOCS |
ENDDOCS |
} |
} |
# if ($showgroups) { |
if ($showgroups) { |
# $groups =(<<ENDGROUPS); |
$groups =(<<ENDGROUPS); |
#<a href="/adm/coursegroups" target="_top">$lt{'groups'}</a> |
<a href="/adm/coursegroups" target="_top">$lt{'groups'}</a> |
#ENDGROUPS |
ENDGROUPS |
# } |
} |
} |
} |
my $form=&serverform(); |
my $form=&serverform(); |
my $utility=&utilityfunctions(); |
my $utility=&utilityfunctions(); |
Line 168 ENDMAINMENU
|
Line 173 ENDMAINMENU
|
my $vlink=&Apache::loncommon::designparm($function.'.vlink',$domain); |
my $vlink=&Apache::loncommon::designparm($function.'.vlink',$domain); |
my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain); |
my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain); |
if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') { |
if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') { |
my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif"); |
|
return (<<ENDINLINEMENU); |
return (<<ENDINLINEMENU); |
<table id="LC_top_nav"> |
<table id="LC_top_nav"> |
<tr> |
<tr> |
<td> |
$logo |
<a href="/adm/logout" target="_top">$lt{'exit'}</a> |
<td></td> |
|
<td class="LC_top_nav_login"> |
|
<a href="/adm/roles" target="_top">$lt{'login'}</a> |
</td> |
</td> |
<td class="LC_top_nav_logo">LON-CAPA<img src="$logo" alt="Logo" /></td> |
|
</tr> |
</tr> |
</table> |
</table> |
</font> |
</font> |
Line 198 my $is_group = (&Apache::loncommon::cour
|
Line 203 my $is_group = (&Apache::loncommon::cour
|
<td><a href="/adm/coursedocs" target="_top">$text</a></td> |
<td><a href="/adm/coursedocs" target="_top">$text</a></td> |
ENDDOCS |
ENDDOCS |
} |
} |
# if ($showgroups) { |
if ($showgroups) { |
# my $text = ($is_group) ? $lt{'teams'} : $lt{'groups'}; |
$groups =(<<ENDGROUPS); |
# $groups =(<<ENDGROUPS); |
<td><a href="/adm/coursegroups" target="_top">$lt{'groups'}</a></td> |
#<td><a href="/adm/coursegroups" target="_top">$text</a></td> |
ENDGROUPS |
#ENDGROUPS |
} |
# } |
|
if ( |
if ( |
($env{'request.noversionuri'}=~m[^/(res|public)/] && |
($env{'request.noversionuri'}=~m[^/(res|public)/] && |
$env{'request.symb'} eq '') |
$env{'request.symb'} eq '') |
Line 232 ENDCRELOAD
|
Line 236 ENDCRELOAD
|
} |
} |
my $form=&serverform(); |
my $form=&serverform(); |
my $utility=&utilityfunctions(); |
my $utility=&utilityfunctions(); |
my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif"); |
|
my $remote; |
my $remote; |
if ($env{'user.adv'}) { |
if ($env{'user.adv'}) { |
$remote = '<td><a href="/adm/remote?action=launch&url='.$escurl.'" target="_top">'.$lt{'launch'}.'</a></td>' |
$remote = '<td><a href="/adm/remote?action=launch&url='.$escurl.'" target="_top">'.$lt{'launch'}.'</a></td>' |
} |
} |
|
|
|
my $helplink=&Apache::loncommon::top_nav_help('Help'); |
return (<<ENDINLINEMENU); |
return (<<ENDINLINEMENU); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// BEGIN LON-CAPA Internal |
// BEGIN LON-CAPA Internal |
Line 246 $utility
|
Line 251 $utility
|
</script> |
</script> |
<table id="LC_top_nav"> |
<table id="LC_top_nav"> |
<tr> |
<tr> |
|
$logo |
<td><a href="/adm/menu" target="_top">$lt{'main'}</a></td> |
<td><a href="/adm/menu" target="_top">$lt{'main'}</a></td> |
$reloadlink |
$reloadlink |
$navmaps |
$navmaps |
Line 253 $docs
|
Line 259 $docs
|
$groups |
$groups |
$remote |
$remote |
<td><a href="/adm/roles" target="_top">$lt{'roles'}</a></td> |
<td><a href="/adm/roles" target="_top">$lt{'roles'}</a></td> |
<td><a href="/adm/logout" target="_top">$lt{'exit'}</a></td> |
<td class="LC_top_nav_help">$helplink</td> |
<td class="LC_top_nav_logo">LON-CAPA<img src="$logo" alt="Logo" /></td> |
<td class="LC_top_nav_exit"><a href="/adm/logout" target="_top">$lt{'exit'}</a></td> |
</tr> |
</tr> |
</table> |
</table> |
$form |
$form |
Line 383 sub innerregister {
|
Line 389 sub innerregister {
|
&Apache::lonnet::allowed('opa',$crs)) { |
&Apache::lonnet::allowed('opa',$crs)) { |
$hwkadd.=&switch('','',7,3,'pparm.gif','problem[_2]','parms[_2]', |
$hwkadd.=&switch('','',7,3,'pparm.gif','problem[_2]','parms[_2]', |
"gocmd('/adm/parmset','set')", |
"gocmd('/adm/parmset','set')", |
'Modify deadlines, etc, for this resource'); |
'Modify parameter settings for this resource'); |
} |
} |
# -- End Homework |
# -- End Homework |
### |
### |
Line 401 sub innerregister {
|
Line 407 sub innerregister {
|
my $desc = "Enter my resource construction space"; |
my $desc = "Enter my resource construction space"; |
# Set defaults for co-authors |
# Set defaults for co-authors |
if ($env{'request.role'} =~ /^ca/) { |
if ($env{'request.role'} =~ /^ca/) { |
($cadom,$caname)=($env{'request.role'}=~/(\w+)\/(\w+)$/); |
($cadom,$caname)=($env{'request.role'}=~/($match_domain)\/($match_username)$/); |
($top,$bottom) = ('co con-','struct'); |
($top,$bottom) = ('co con-','struct'); |
$action = "go('/priv/".$caname."');"; |
$action = "go('/priv/".$caname."');"; |
$desc = "Enter construction space as co-author"; |
$desc = "Enter construction space as co-author"; |
Line 423 sub innerregister {
|
Line 429 sub innerregister {
|
my $cfudom=''; |
my $cfudom=''; |
if ($env{'request.filename'}) { |
if ($env{'request.filename'}) { |
my $file=&Apache::lonnet::declutter($env{'request.filename'}); |
my $file=&Apache::lonnet::declutter($env{'request.filename'}); |
$file=~s/^(\w+)\/(\w+)/\/priv\/$2/; |
$file=~s/^($match_domain)\/($match_username)/\/priv\/$2/; |
# Check that the user has permission to edit this resource |
# Check that the user has permission to edit this resource |
($cfuname,$cfudom)=&Apache::loncacc::constructaccess($file,$1); |
($cfuname,$cfudom)=&Apache::loncacc::constructaccess($file,$1); |
if (defined($cfudom)) { |
if (defined($cfudom)) { |
Line 439 sub innerregister {
|
Line 445 sub innerregister {
|
# Finally, turn the button on or off |
# Finally, turn the button on or off |
if ($cfile && !$const_space) { |
if ($cfile && !$const_space) { |
$editbutton=&switch |
$editbutton=&switch |
('','',6,1,'cstr.gif','edit[_1]','resource[_2]', |
('','',6,1,'pcstr.gif','edit[_1]','resource[_2]', |
"go('".$cfile."');","Edit this resource"); |
"go('".$cfile."');","Edit this resource"); |
} elsif ($editbutton eq '') { |
} elsif ($editbutton eq '') { |
$editbutton=&clear(6,1); |
$editbutton=&clear(6,1); |
Line 457 sub innerregister {
|
Line 463 sub innerregister {
|
$is_const_dir = 1; |
$is_const_dir = 1; |
} else { |
} else { |
$currdir =~ s#[^/]+$##; |
$currdir =~ s#[^/]+$##; |
|
my $cleandisfn = &Apache::loncommon::escape_single($thisdisfn); |
|
my $esc_currdir = &Apache::loncommon::escape_single($currdir); |
$menuitems=(<<ENDMENUITEMS); |
$menuitems=(<<ENDMENUITEMS); |
s&6&1&list.gif&list[_1]&dir[_1]&golist('$currdir')&List current directory |
s&6&1&list.gif&list[_1]&dir[_1]&golist('$esc_currdir')&List current directory |
s&6&2&rtrv.gif&retrieve[_1]&version[_1]&gocstr('/adm/retrieve','/~$uname/$thisdisfn')&Retrieve old version |
s&6&2&rtrv.gif&retrieve[_1]&version[_1]&gocstr('/adm/retrieve','/~$uname/$cleandisfn')&Retrieve old version |
s&6&3&pub.gif&publish[_1]&resource[_1]&gocstr('/adm/publish','/~$uname/$thisdisfn')&Publish this resource |
s&6&3&pub.gif&publish[_1]&resource[_1]&gocstr('/adm/publish','/~$uname/$cleandisfn')&Publish this resource |
s&7&1&del.gif&delete[_1]&resource[_2]&gocstr('/adm/cfile?action=delete','/~$uname/$thisdisfn')&Delete this resource |
s&7&1&del.gif&delete[_1]&resource[_2]&gocstr('/adm/cfile?action=delete','/~$uname/$cleandisfn')&Delete this resource |
s&7&2&prt.gif&prepare[_1]&printout[_1]&gocstr('/adm/printout','/~$uname/$thisdisfn')&Prepare a printable document |
s&7&2&prt.gif&prepare[_1]&printout[_1]&gocstr('/adm/printout','/~$uname/$cleandisfn')&Prepare a printable document |
ENDMENUITEMS |
ENDMENUITEMS |
} |
} |
} elsif (defined($env{'request.course.id'}) && |
} elsif ( defined($env{'request.course.id'}) && |
$env{'request.symb'} ne '') { |
$env{'request.symb'} ne '' ) { |
$menuitems=(<<ENDMENUITEMS); |
$menuitems=(<<ENDMENUITEMS); |
c&3&1 |
c&3&1 |
s&2&1&back.gif&backward[_1]&&gopost('/adm/flip','back:'+currentURL)&Go to the previous resource in the course sequence&1 |
s&2&1&back.gif&backward[_1]&&gopost('/adm/flip','back:'+currentURL)&Go to the previous resource in the course sequence&&1 |
s&2&3&forw.gif&forward[_1]&&gopost('/adm/flip','forward:'+currentURL)&Go to the next resource in the course sequence&3 |
s&2&3&forw.gif&forward[_1]&&gopost('/adm/flip','forward:'+currentURL)&Go to the next resource in the course sequence&&3 |
c&6&3 |
c&6&3 |
c&8&1 |
c&8&1 |
c&8&2 |
c&8&2 |
s&8&3&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document |
s&8&3&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document |
s&9&1&sbkm.gif&set[_1]&bookmark[_2]&set_bookmark()&Set a bookmark for this resource&1 |
s&9&1&sbkm.gif&set[_1]&bookmark[_2]&set_bookmark()&Set a bookmark for this resource&&1 |
s&9&3&anot.gif&anno-[_1]&tations[_1]&annotate()&Make notes and annotations about this resource&1 |
s&9&3&anot.gif&anno-[_1]&tations[_1]&annotate()&Make notes and annotations about this resource&&1 |
ENDMENUITEMS |
ENDMENUITEMS |
unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) { |
unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) { |
$menuitems.=(<<ENDREALRES); |
$menuitems.=(<<ENDREALRES); |
Line 486 s&8&2&fdbk.gif&feedback[_1]&discuss[_1]&
|
Line 494 s&8&2&fdbk.gif&feedback[_1]&discuss[_1]&
|
ENDREALRES |
ENDREALRES |
} |
} |
} |
} |
|
if ($env{'request.uri'} =~ /^\/res/) { |
|
$menuitems .= (<<ENDMENUITEMS); |
|
s&8&3&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document |
|
ENDMENUITEMS |
|
} |
my $buttons=''; |
my $buttons=''; |
foreach (split(/\n/,$menuitems)) { |
foreach (split(/\n/,$menuitems)) { |
my ($command,@rest)=split(/\&/,$_); |
my ($command,@rest)=split(/\&/,$_); |
Line 799 sub clear {
|
Line 812 sub clear {
|
# The javascript is usually similar to "go('/adm/roles')" or "cstrgo(..)". |
# The javascript is usually similar to "go('/adm/roles')" or "cstrgo(..)". |
|
|
sub switch { |
sub switch { |
my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$nobreak)=@_; |
my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat,$nobreak)=@_; |
$act=~s/\$uname/$uname/g; |
$act=~s/\$uname/$uname/g; |
$act=~s/\$udom/$udom/g; |
$act=~s/\$udom/$udom/g; |
$top=&mt($top); |
$top=&mt($top); |
Line 807 sub switch {
|
Line 820 sub switch {
|
$desc=&mt($desc); |
$desc=&mt($desc); |
$img=&mt($img); |
$img=&mt($img); |
|
|
|
my $idx=10*$row+$col; |
|
$category_members{$cat}.=':'.$idx; |
|
|
unless (($env{'browser.interface'} eq 'textual') || |
unless (($env{'browser.interface'} eq 'textual') || |
($env{'environment.remote'} eq 'off')) { |
($env{'environment.remote'} eq 'off')) { |
# Remote |
# Remote |
Line 818 sub switch {
|
Line 834 sub switch {
|
my $text=$top.' '.$bot; |
my $text=$top.' '.$bot; |
$text=~s/\s*\-\s*//gs; |
$text=~s/\s*\-\s*//gs; |
if ($nobreak) { |
if ($nobreak) { |
$inlineremote[10*$row+$col]= |
$inlineremote[$idx]= |
'<a href="javascript:'.$act.';">'.$text.'</a>'; |
'<a href="javascript:'.$act.';">'.$text.'</a>'; |
} else { |
} else { |
$inlineremote[10*$row+$col]="\n<br />". |
$inlineremote[$idx]="\n<br />". |
$desc.' <a href="javascript:'.$act.';">'.$text.'</a>'; |
$desc.' <a href="javascript:'.$act.';">'.$text.'</a>'; |
} |
} |
} else { |
} else { |
# Inline Remote |
# Inline Remote |
|
if ($env{'environment.icons'} ne 'classic') { |
|
$img=~s/\.gif$/\.png/; |
|
} |
if ($nobreak==2) { return ''; } |
if ($nobreak==2) { return ''; } |
my $text=$top.' '.$bot; |
my $text=$top.' '.$bot; |
$text=~s/\s*\-\s*//gs; |
$text=~s/\s*\-\s*//gs; |
Line 839 sub switch {
|
Line 858 sub switch {
|
if ($env{'browser.interface'} eq 'faketextual') { |
if ($env{'browser.interface'} eq 'faketextual') { |
# Accessibility |
# Accessibility |
if ($nobreak==3) { |
if ($nobreak==3) { |
$inlineremote[10*$row+$col]="\n". |
$inlineremote[$idx]="\n". |
'<td class="LC_menubuttons_text" align="right">'.$text. |
'<td class="LC_menubuttons_text" align="right">'.$text. |
'</td><td class="LC_menubuttons_img" align="left">'. |
'</td><td class="LC_menubuttons_img" align="left">'. |
'<a href="javascript:'.$act.';">'.$pic.'</a></td></tr>'; |
'<a href="javascript:'.$act.';">'.$pic.'</a></td></tr>'; |
} elsif ($nobreak) { |
} elsif ($nobreak) { |
$inlineremote[10*$row+$col]="\n<tr>". |
$inlineremote[$idx]="\n<tr>". |
'<td class="LC_menubuttons_img" align="left">'. |
'<td class="LC_menubuttons_img" align="left">'. |
'<a href="javascript:'.$act.';">'.$pic.'</a></td> |
'<a href="javascript:'.$act.';">'.$pic.'</a></td> |
<td class="LC_menubuttons_text" align="left">'.$text.'</td>'; |
<td class="LC_menubuttons_text" align="left">'.$text.'</td>'; |
} else { |
} else { |
$inlineremote[10*$row+$col]="\n<tr>". |
$inlineremote[$idx]="\n<tr>". |
'<td class="LC_menubuttons_img" align="left">'. |
'<td class="LC_menubuttons_img" align="left">'. |
'<a href="javascript:'.$act.';">'.$pic. |
'<a href="javascript:'.$act.';">'.$pic. |
'</a></td><td class="LC_menubuttons_text" colspan="3">'. |
'</a></td><td class="LC_menubuttons_text" colspan="3">'. |
Line 857 sub switch {
|
Line 876 sub switch {
|
} |
} |
} else { |
} else { |
# Inline Menu |
# Inline Menu |
$inlineremote[10*$row+$col]= |
$inlineremote[$idx]= |
'<a href="javascript:'.$act.';">'.$pic. |
'<a href="javascript:'.$act.';">'.$pic. |
'</a><span class="LC_menubuttons_inline_text">'.$desc.'</span>'; |
'</a><span class="LC_menubuttons_inline_text">'.$desc.'</span>'; |
} |
} |
Line 868 sub switch {
|
Line 887 sub switch {
|
sub secondlevel { |
sub secondlevel { |
my $output=''; |
my $output=''; |
my |
my |
($uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc)=@_; |
($uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc,$cat)=@_; |
if ($prt eq 'any') { |
if ($prt eq 'any') { |
$output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc); |
$output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat); |
} elsif ($prt=~/^r(\w+)/) { |
} elsif ($prt=~/^r(\w+)/) { |
if ($rol eq $1) { |
if ($rol eq $1) { |
$output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc); |
$output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat); |
} |
} |
} |
} |
return $output; |
return $output; |
Line 888 sub openmenu {
|
Line 907 sub openmenu {
|
} |
} |
|
|
sub inlinemenu { |
sub inlinemenu { |
@inlineremote=(); |
undef(@inlineremote); |
undef @inlineremote; |
undef(%category_members); |
&rawconfig(1); |
&rawconfig(1); |
return join('',map { (defined($_)?$_:'') } @inlineremote); |
my $output='<table id="LC_mainmenu"><tr>'; |
|
for (my $col=1; $col<=2; $col++) { |
|
$output.='<td class="LC_mainmenu_column">'; |
|
for (my $row=1; $row<=8; $row++) { |
|
foreach my $cat (keys(%category_members)) { |
|
if ($category_positions{$cat} ne "$col,$row") { next; } |
|
$output.='<table id="LC_menubuttons_mainmenu"><tr><td colspan="4" class="LC_menubuttons_category">'.&mt($category_names{$cat}).'</td></tr>'; |
|
my %active=(); |
|
foreach my $menu_item (split(/\:/,$category_members{$cat})) { |
|
if ($inlineremote[$menu_item]) { |
|
$active{$menu_item}=1; |
|
} |
|
} |
|
foreach my $item (sort(keys(%active))) { |
|
$output.=$inlineremote[$item]; |
|
} |
|
$output.='</table>'; |
|
} |
|
} |
|
$output.="</td>"; |
|
} |
|
$output.="</tr></table>"; |
|
return $output; |
} |
} |
|
|
sub rawconfig { |
sub rawconfig { |
Line 922 sub rawconfig {
|
Line 963 sub rawconfig {
|
my $rol=$env{'request.role'}; |
my $rol=$env{'request.role'}; |
my $requested_domain = $env{'request.role.domain'}; |
my $requested_domain = $env{'request.role.domain'}; |
foreach my $line (@desklines) { |
foreach my $line (@desklines) { |
my ($row,$col,$pro,$prt,$img,$top,$bot,$act,$desc)=split(/\:/,$line); |
my ($row,$col,$pro,$prt,$img,$top,$bot,$act,$desc,$cat)=split(/\:/,$line); |
$prt=~s/\$uname/$uname/g; |
$prt=~s/\$uname/$uname/g; |
$prt=~s/\$udom/$udom/g; |
$prt=~s/\$udom/$udom/g; |
$prt=~s/\$crs/$crs/g; |
$prt=~s/\$crs/$crs/g; |
$prt=~s/\$requested_domain/$requested_domain/g; |
$prt=~s/\$requested_domain/$requested_domain/g; |
|
if ($category_names{$cat}!~/\w/) { $cat='oth'; } |
my $type = &Apache::loncommon::course_type(); |
my $type = &Apache::loncommon::course_type(); |
if ($type eq 'Group') { |
if ($type eq 'Group') { |
$desc = &convert_menu_function($desc,$type); |
$desc = &convert_menu_function($desc,$type); |
Line 935 sub rawconfig {
|
Line 977 sub rawconfig {
|
$output.=&clear($row,$col); |
$output.=&clear($row,$col); |
} elsif ($pro eq 'any') { |
} elsif ($pro eq 'any') { |
$output.=&secondlevel( |
$output.=&secondlevel( |
$uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc); |
$uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc,$cat); |
} elsif ($pro eq 'smp') { |
} elsif ($pro eq 'smp') { |
unless ($adv) { |
unless ($adv) { |
$output.=&secondlevel( |
$output.=&secondlevel( |
$uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc); |
$uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc,$cat); |
} |
} |
} elsif ($pro eq 'adv') { |
} elsif ($pro eq 'adv') { |
if ($adv) { |
if ($adv) { |
$output.=&secondlevel( |
$output.=&secondlevel( |
$uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc); |
$uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc,$cat); |
} |
} |
} elsif (($pro=~/^p(\w+)/) && ($prt)) { |
} elsif (($pro=~/^p(\w+)/) && ($prt)) { |
if (&Apache::lonnet::allowed($1,$prt)) { |
if (&Apache::lonnet::allowed($1,$prt)) { |
$output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc); |
$output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat); |
} |
} |
} elsif ($pro eq 'course') { |
} elsif ($pro eq 'course') { |
if ($env{'request.course.fn'}) { |
if ($env{'request.course.fn'}) { |
$output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc); |
$output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat); |
} |
} |
} elsif ($pro =~ /^courseenv_(.*)$/) { |
} elsif ($pro =~ /^courseenv_(.*)$/) { |
my $key = $1; |
my $key = $1; |
if ($env{'course.'.$env{'request.course.id'}.'.'.$key}) { |
if ($env{'course.'.$env{'request.course.id'}.'.'.$key}) { |
$output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc); |
$output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat); |
} |
} |
} elsif ($pro =~ /^course_(.*)$/) { |
} elsif ($pro =~ /^course_(.*)$/) { |
# Check for permissions inside of a course |
# Check for permissions inside of a course |
Line 965 sub rawconfig {
|
Line 1007 sub rawconfig {
|
(&Apache::lonnet::allowed($1,$env{'request.course.id'}. |
(&Apache::lonnet::allowed($1,$env{'request.course.id'}. |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) |
)) { |
)) { |
$output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc); |
$output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat); |
} |
} |
} elsif ($pro eq 'author') { |
} elsif ($pro eq 'author') { |
if ($author) { |
if ($author) { |
Line 976 sub rawconfig {
|
Line 1018 sub rawconfig {
|
my $caname=$env{'user.name'}; |
my $caname=$env{'user.name'}; |
if ($prt eq 'rca') { |
if ($prt eq 'rca') { |
($cadom,$caname)= |
($cadom,$caname)= |
($env{'request.role'}=~/(\w+)\/(\w+)$/); |
($env{'request.role'}=~/($match_domain)\/($match_username)$/); |
} |
} |
$act =~ s/\$caname/$caname/g; |
$act =~ s/\$caname/$caname/g; |
my $home = &Apache::lonnet::homeserver($caname,$cadom); |
my $home = &Apache::lonnet::homeserver($caname,$cadom); |
Line 984 sub rawconfig {
|
Line 1026 sub rawconfig {
|
my @ids=&Apache::lonnet::current_machine_ids(); |
my @ids=&Apache::lonnet::current_machine_ids(); |
foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } } |
foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } } |
if ($allowed) { |
if ($allowed) { |
$output.=switch($caname,$cadom, |
$output.=&switch($caname,$cadom, |
$row,$col,$img,$top,$bot,$act,$desc); |
$row,$col,$img,$top,$bot,$act,$desc,$cat); |
} |
} |
} |
} |
} |
} |
Line 1064 sub utilityfunctions {
|
Line 1106 sub utilityfunctions {
|
'add_entries' => { |
'add_entries' => { |
'onload' => 'javascript:document.goannotate.submit();'}}); |
'onload' => 'javascript:document.goannotate.submit();'}}); |
|
|
|
my $end_page_annotate = |
|
&Apache::loncommon::end_page({'js_ready' => 1}); |
|
|
my $start_page_bookmark = |
my $start_page_bookmark = |
&Apache::loncommon::start_page('Bookmarks',undef, |
&Apache::loncommon::start_page('Bookmarks',undef, |
{'only_body' => 1, |
{'only_body' => 1, |
'js_ready' => 1, |
'js_ready' => 1, |
'bgcolor' => '#BBBBBB',}); |
'bgcolor' => '#BBBBBB',}); |
|
|
my $end_page = |
my $end_page_bookmark = |
&Apache::loncommon::end_page({'js_ready' => 1}); |
&Apache::loncommon::end_page({'js_ready' => 1}); |
|
|
return (<<ENDUTILITY) |
return (<<ENDUTILITY) |
Line 1190 function annotate() {
|
Line 1235 function annotate() {
|
+"action='/adm/annotations'>" |
+"action='/adm/annotations'>" |
+"<input type='hidden' name='urlnew' value='"+currentURL+"' />" |
+"<input type='hidden' name='urlnew' value='"+currentURL+"' />" |
+"<\\/form>" |
+"<\\/form>" |
+'$end_page'); |
+'$end_page_annotate'); |
annotator.document.close(); |
annotator.document.close(); |
} |
} |
|
|
Line 1212 function set_bookmark() {
|
Line 1257 function set_bookmark() {
|
+"value='Save' /> <input type='button' value='Close (no save)' " |
+"value='Save' /> <input type='button' value='Close (no save)' " |
+"onclick='javascript:window.close();' /><\\/center><\\/td>" |
+"onclick='javascript:window.close();' /><\\/center><\\/td>" |
+"<\\/tr><\\/table><\\/form><\\/center>" |
+"<\\/tr><\\/table><\\/form><\\/center>" |
+'$end_page' ); |
+'$end_page_bookmark' ); |
bmquery.document.close(); |
bmquery.document.close(); |
} |
} |
|
|
Line 1284 BEGIN {
|
Line 1329 BEGIN {
|
$configline=(split(/\#/,$configline))[0]; |
$configline=(split(/\#/,$configline))[0]; |
$configline=~s/^\s+//; |
$configline=~s/^\s+//; |
chomp($configline); |
chomp($configline); |
if ($configline) { |
if ($configline=~/^cat\:/) { |
|
my @entries=split(/\:/,$configline); |
|
$category_positions{$entries[2]}=$entries[1]; |
|
$category_names{$entries[2]}=$entries[3]; |
|
} elsif ($configline) { |
push(@desklines,$configline); |
push(@desklines,$configline); |
} |
} |
} |
} |