version 1.195, 2006/07/14 16:46:36
|
version 1.207, 2006/12/06 11:34:37
|
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 $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 $helptopic='Student_Intro'; |
|
if ($env{'request.role'}=~/^(ca|au)/) { |
my $helplink=&Apache::loncommon::top_nav_help('Help'); |
$helptopic='Authoring_Intro'; |
|
} elsif ($env{'request.role'}=~/^cc/) { |
|
$helptopic='Course_Coordination_Intro'; |
|
} |
|
my $helplink=&Apache::loncommon::help_open_topic($helptopic,'Help'); |
|
return (<<ENDINLINEMENU); |
return (<<ENDINLINEMENU); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// BEGIN LON-CAPA Internal |
// BEGIN LON-CAPA Internal |
Line 253 $utility
|
Line 251 $utility
|
</script> |
</script> |
<table id="LC_top_nav"> |
<table id="LC_top_nav"> |
<tr> |
<tr> |
<td class="LC_top_nav_logo"> |
$logo |
<a href="/adm/about.html"><img src="$logo" alt="LON-CAPA Logo" align="left" border="0" /></a></td> |
|
<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 262 $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>$helplink</td> |
<td class="LC_top_nav_help">$helplink</td> |
<td class="LC_top_logout"><a href="/adm/logout" target="_top">$lt{'exit'}</a></td> |
<td class="LC_top_nav_exit"><a href="/adm/logout" target="_top">$lt{'exit'}</a></td> |
</tr> |
</tr> |
</table> |
</table> |
$form |
$form |
Line 392 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 410 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 432 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 466 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); |
$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('$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 |
Line 495 s&8&2&fdbk.gif&feedback[_1]&discuss[_1]&
|
Line 493 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 985 sub rawconfig {
|
Line 988 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 1073 sub utilityfunctions {
|
Line 1076 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 1199 function annotate() {
|
Line 1205 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 1221 function set_bookmark() {
|
Line 1227 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(); |
} |
} |
|
|