version 1.134, 2004/12/03 06:51:50
|
version 1.149, 2005/02/21 00:32:04
|
Line 60 sub initlittle {
|
Line 60 sub initlittle {
|
return &Apache::lonlocal::texthash('ret' => 'Return to Last Location', |
return &Apache::lonlocal::texthash('ret' => 'Return to Last Location', |
'nav' => 'Navigate Contents', |
'nav' => 'Navigate Contents', |
'main' => 'Main Menu', |
'main' => 'Main Menu', |
|
'roles' => ($ENV{'user.adv'}? |
|
'Roles':'Courses'), |
|
'exit' => 'Exit', |
'launch' => 'Launch Remote Control'); |
'launch' => 'Launch Remote Control'); |
} |
} |
|
|
Line 72 sub menubuttons {
|
Line 75 sub menubuttons {
|
my $titletable=shift; |
my $titletable=shift; |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['inhibitmenu']); |
['inhibitmenu']); |
if ($ENV{'form.inhibitmenu'} eq 'yes') { return ''; } |
if (($ENV{'form.inhibitmenu'} eq 'yes') || |
|
($ENV{'REQUEST_URI'} eq '/adm/logout')) { return ''; } |
|
|
my $navmaps=''; |
my $navmaps=''; |
my $reloadlink=''; |
my $reloadlink=''; |
Line 103 ENDNAV
|
Line 107 ENDNAV
|
<a href="/adm/flip?postdata=$escreload" target="_top"><font color="$font">$lt{'ret'}</font></a> |
<a href="/adm/flip?postdata=$escreload" target="_top"><font color="$font">$lt{'ret'}</font></a> |
ENDRELOAD |
ENDRELOAD |
} |
} |
} |
} |
my $form=&serverform(); |
my $form=&serverform(); |
my $utility=&utilityfunctions(); |
my $utility=&utilityfunctions(); |
my $output=(<<ENDMAINMENU); |
my $output=(<<ENDMAINMENU); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// BEGIN LON-CAPA Internal |
<!-- // BEGIN LON-CAPA Internal |
$utility |
$utility |
|
--> |
</script> |
</script> |
<a href="/adm/menu" target="_top">$lt{'main'}</a> |
<a href="/adm/menu" target="_top">$lt{'main'}</a> |
$reloadlink $navmaps<br /> |
$reloadlink $navmaps |
|
<a href="/adm/roles" target="_top"><font color="$font">$lt{'roles'}</font></a> |
|
<a href="/adm/logout" target="_top"><font color="$font">$lt{'exit'}</font></a> |
|
<br /> |
<script type="text/javascript"> |
<script type="text/javascript"> |
// END LON-CAPA Internal |
// END LON-CAPA Internal |
</script> |
</script> |
Line 145 ENDMAINMENU
|
Line 153 ENDMAINMENU
|
my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain); |
my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain); |
# Do we have a NAV link? |
# Do we have a NAV link? |
if ($ENV{'request.course.id'}) { |
if ($ENV{'request.course.id'}) { |
$navmaps=(<<ENDNAV); |
my $link='/adm/navmaps?postdata='.$escurl.'&postsymb='. |
|
$escsymb; |
|
if ($ENV{'environment.remotenavmap'} eq 'on') { |
|
$link="javascript:gonav('".$link."')"; |
|
} |
|
$navmaps=(<<ENDNAV); |
<td bgcolor="$tabbg"> |
<td bgcolor="$tabbg"> |
<a href="javascript:gonav('/adm/navmaps?postdata=$escurl&postsymb=$escsymb')"><font color="$font">$lt{'nav'}</font></a></td> |
<a href="$link"><font color="$font">$lt{'nav'}</font></a></td> |
ENDNAV |
ENDNAV |
if (($ENV{'request.noversionuri'}=~/^\/adm\//) && |
if ( |
($ENV{'request.noversionuri'}!~/^\/adm\/wrapper\//) && |
($ENV{'request.noversionuri'}=~m[^/(res|public)/] && |
($ENV{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) { |
$ENV{'request.symb'} eq '') |
|
|| |
|
(($ENV{'request.noversionuri'}=~/^\/adm\//) && |
|
($ENV{'request.noversionuri'}!~/^\/adm\/wrapper\//) && |
|
($ENV{'request.noversionuri'}!~ |
|
m[^/adm/.*/(smppg|bulletinboard|aboutme)($|\?)]) |
|
) |
|
) { |
my $escreload=&Apache::lonnet::escape('return:'); |
my $escreload=&Apache::lonnet::escape('return:'); |
$reloadlink=(<<ENDRELOAD); |
$reloadlink=(<<ENDRELOAD); |
<td bgcolor="$tabbg"> |
<td bgcolor="$tabbg"> |
Line 165 ENDRELOAD
|
Line 185 ENDRELOAD
|
} |
} |
my $form=&serverform(); |
my $form=&serverform(); |
my $utility=&utilityfunctions(); |
my $utility=&utilityfunctions(); |
|
my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif"); |
return (<<ENDINLINEMENU); |
return (<<ENDINLINEMENU); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// BEGIN LON-CAPA Internal |
<!-- // BEGIN LON-CAPA Internal |
$utility |
$utility |
|
--> |
</script> |
</script> |
<font face="Arial,Helvetica,sans-serif"><table bgcolor="$pgbg" width="100%" border="0" cellpadding="1" cellspacing="1"> |
<font face="Arial,Helvetica,sans-serif"><table bgcolor="$pgbg" width="100%" border="0" cellpadding="1" cellspacing="1"> |
<tr> |
<tr> |
Line 181 $navmaps
|
Line 203 $navmaps
|
<a href="/adm/remote?action=launch&url=$escurl" target="_top"> |
<a href="/adm/remote?action=launch&url=$escurl" target="_top"> |
<font color="$font">$lt{'launch'}</font></a></td> |
<font color="$font">$lt{'launch'}</font></a></td> |
<td bgcolor="$tabbg"> |
<td bgcolor="$tabbg"> |
<img align="right" src="/adm/lonIcons/minilogo.gif" /> |
<a href="/adm/roles" target="_top"><font color="$font">$lt{'roles'}</font></a> |
|
</td> |
|
<td bgcolor="$tabbg"> |
|
<a href="/adm/logout" target="_top"><font color="$font">$lt{'exit'}</font></a> |
|
</td> |
|
<td bgcolor="$tabbg"> |
|
<img align="right" src="$logo" /> |
<b>LON-CAPA</b></td> |
<b>LON-CAPA</b></td> |
$form |
$form |
</tr> |
</tr> |
Line 290 sub innerregister {
|
Line 318 sub innerregister {
|
my $tableend=($noremote?'</table></font>':'').($textinter?'<a name="content" />':''); |
my $tableend=($noremote?'</table></font>':'').($textinter?'<a name="content" />':''); |
# ============================================================================= |
# ============================================================================= |
# ============================ This is for URLs that actually can be registered |
# ============================ This is for URLs that actually can be registered |
if (($ENV{'request.noversionuri'}!~/^\/(res\/)*adm\//) || ($forcereg)) { |
if (($ENV{'request.noversionuri'}!~m|^/(res/)*adm/|) || ($forcereg)) { |
# -- This applies to homework problems for users with grading privileges |
# -- This applies to homework problems for users with grading privileges |
my $crs='/'.$ENV{'request.course.id'}; |
my $crs='/'.$ENV{'request.course.id'}; |
if ($ENV{'request.course.sec'}) { |
if ($ENV{'request.course.sec'}) { |
Line 299 sub innerregister {
|
Line 327 sub innerregister {
|
$crs=~s/\_/\//g; |
$crs=~s/\_/\//g; |
|
|
my $hwkadd=''; |
my $hwkadd=''; |
if ($ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) { |
if ($ENV{'request.symb'} ne '' && |
|
$ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) { |
if (&Apache::lonnet::allowed('vgr',$crs)) { |
if (&Apache::lonnet::allowed('vgr',$crs)) { |
$hwkadd.=&switch('','',7,1,'subm.gif','view sub-[_1]','missions[_1]', |
$hwkadd.=&switch('','',7,1,'subm.gif','view sub-[_1]','missions[_1]', |
"gocmd('/adm/grades','submission')", |
"gocmd('/adm/grades','submission')", |
Line 311 sub innerregister {
|
Line 340 sub innerregister {
|
'Modify user grades for this assessment resource'); |
'Modify user grades for this assessment resource'); |
} |
} |
} |
} |
if (&Apache::lonnet::allowed('opa',$crs)) { |
if ($ENV{'request.symb'} ne '' && |
|
&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 deadlines, etc, for this resource'); |
Line 393 s&6&1&list.gif&list[_1]&dir[_1]&golist('
|
Line 423 s&6&1&list.gif&list[_1]&dir[_1]&golist('
|
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/$thisdisfn')&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/$thisdisfn')&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/$thisdisfn')&Delete this resource |
s&7&2&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout','/~$uname/$thisdisfn')&Prepare a printable document |
s&7&2&prt.gif&prepare[_1]&printout[_1]&gocstr('/adm/printout','/~$uname/$thisdisfn')&Prepare a printable document |
ENDMENUITEMS |
ENDMENUITEMS |
} |
} |
} else { |
} elsif (defined($ENV{'request.course.id'}) && |
|
$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 425 ENDREALRES
|
Line 456 ENDREALRES
|
$buttons.=&clear(@rest); |
$buttons.=&clear(@rest); |
} |
} |
} |
} |
|
|
if ($textual) { |
if ($textual) { |
# Registered, textual output |
my $addremote=0; |
|
foreach (@inlineremote) { if ($_ ne '') { $addremote=1; } } |
my $inlinebuttons=''; |
my $inlinebuttons=''; |
|
if ($addremote) { |
|
# Registered, textual output |
|
|
if ($ENV{'browser.interface'} eq 'textual') { |
if ($ENV{'browser.interface'} eq 'textual') { |
$inlinebuttons= |
$inlinebuttons= |
join('',map { (defined($_)?$_:'') } @inlineremote); |
join('',map { (defined($_)?$_:'') } @inlineremote); |
} else { |
} else { |
$inlinebuttons=(<<ENDINLINE); |
$inlinebuttons=(<<ENDINLINE); |
<tr><td>$inlineremote[21]</td><td> </td><td>$inlineremote[23]</td></tr> |
<tr><td>$inlineremote[21]</td><td> </td><td>$inlineremote[23]</td></tr> |
<tr><td>$inlineremote[61]</td><td>$inlineremote[62]</td><td>$inlineremote[63]</td></tr> |
<tr><td>$inlineremote[61]</td><td>$inlineremote[62]</td><td>$inlineremote[63]</td></tr> |
<tr><td>$inlineremote[71]</td><td>$inlineremote[72]</td><td>$inlineremote[73]</td></tr> |
<tr><td>$inlineremote[71]</td><td>$inlineremote[72]</td><td>$inlineremote[73]</td></tr> |
<tr><td>$inlineremote[81]</td><td>$inlineremote[82]</td><td>$inlineremote[83]</td></tr> |
<tr><td>$inlineremote[81]</td><td>$inlineremote[82]</td><td>$inlineremote[83]</td></tr> |
<tr><td>$inlineremote[91]</td><td>$inlineremote[92]</td><td>$inlineremote[93]</td></tr> |
<tr><td>$inlineremote[91]</td><td>$inlineremote[92]</td><td>$inlineremote[93]</td></tr> |
ENDINLINE |
ENDINLINE |
|
} |
} |
} |
if ($const_space && $is_const_dir) { |
|
$inlinebuttons = ''; |
|
} |
|
$result =(<<ENDREGTEXT); |
$result =(<<ENDREGTEXT); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// BEGIN LON-CAPA Internal |
// BEGIN LON-CAPA Internal |
Line 460 $tableend
|
Line 493 $tableend
|
ENDREGTEXT |
ENDREGTEXT |
# Registered, graphical output |
# Registered, graphical output |
} else { |
} else { |
my $requri=(split(/\?/,$ENV{'request.noversionuri'}))[0]; |
my $requri=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$ENV{'request.noversionuri'}))[0])); |
$requri=&Apache::lonenc::check_encrypt(&Apache::lonnet::unescape($requri)); |
$requri=&Apache::lonenc::check_encrypt(&Apache::lonnet::unescape($requri)); |
my $cursymb=&Apache::lonenc::check_encrypt($ENV{'request.symb'}); |
my $cursymb=&Apache::lonenc::check_encrypt($ENV{'request.symb'}); |
my $navstatus=&get_nav_status(); |
my $navstatus=&get_nav_status(); |
|
my $clearcstr; |
|
|
|
if ($ENV{'user.adv'}) { $clearcstr='clearbut(6,1)'; } |
$result = (<<ENDREGTHIS); |
$result = (<<ENDREGTHIS); |
|
|
<script type="text/javascript"> |
<script type="text/javascript"> |
// BEGIN LON-CAPA Internal |
// <!-- BEGIN LON-CAPA Internal |
var swmenu=null; |
var swmenu=null; |
|
|
function LONCAPAreg() { |
function LONCAPAreg() { |
Line 498 var swmenu=null;
|
Line 534 var swmenu=null;
|
swmenu.clearbut(7,3); |
swmenu.clearbut(7,3); |
swmenu.menucltim=swmenu.setTimeout( |
swmenu.menucltim=swmenu.setTimeout( |
'clearbut(2,1);clearbut(2,3);clearbut(8,1);clearbut(8,2);clearbut(8,3);'+ |
'clearbut(2,1);clearbut(2,3);clearbut(8,1);clearbut(8,2);clearbut(8,3);'+ |
'clearbut(9,1);clearbut(9,3);clearbut(6,3);clearbut(6,1)', |
'clearbut(9,1);clearbut(9,3);clearbut(6,3);$clearcstr', |
2000); |
2000); |
} |
} |
|
|
// END LON-CAPA Internal |
// END LON-CAPA Internal --> |
</script> |
</script> |
ENDREGTHIS |
ENDREGTHIS |
} |
} |
Line 551 ENDDONOTREGTHIS
|
Line 587 ENDDONOTREGTHIS
|
} |
} |
|
|
sub loadevents() { |
sub loadevents() { |
if ($ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; } |
if ($ENV{'request.state'} eq 'construct' || |
|
$ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; } |
return 'LONCAPAreg();'; |
return 'LONCAPAreg();'; |
} |
} |
|
|
sub unloadevents() { |
sub unloadevents() { |
if ($ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; } |
if ($ENV{'request.state'} eq 'construct' || |
|
$ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; } |
return 'LONCAPAstale();'; |
return 'LONCAPAstale();'; |
} |
} |
|
|
Line 970 sub utilityfunctions {
|
Line 1008 sub utilityfunctions {
|
my $caller = shift; |
my $caller = shift; |
unless (($ENV{'browser.interface'} eq 'textual') || |
unless (($ENV{'browser.interface'} eq 'textual') || |
($ENV{'environment.remote'} eq 'off') || ($caller eq '/adm/menu')) { return ''; } |
($ENV{'environment.remote'} eq 'off') || ($caller eq '/adm/menu')) { return ''; } |
my $currenturl=&Apache::lonenc::check_encrypt($ENV{'request.noversionuri'}); |
my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$ENV{'request.noversionuri'}))[0])); |
|
$currenturl=&Apache::lonenc::check_encrypt(&Apache::lonnet::unescape($currenturl)); |
|
|
my $currentsymb=&Apache::lonenc::check_encrypt($ENV{'request.symb'}); |
my $currentsymb=&Apache::lonenc::check_encrypt($ENV{'request.symb'}); |
my $nav_control=&nav_control_js(); |
my $nav_control=&nav_control_js(); |
Line 1018 function gocstr(url,filename) {
|
Line 1057 function gocstr(url,filename) {
|
this.document.cstrdelete.submit(); |
this.document.cstrdelete.submit(); |
return; |
return; |
} |
} |
|
if (url == '/adm/printout') { |
|
this.document.cstrprint.postdata.value = filename |
|
this.document.cstrprint.curseed.value = 0; |
|
this.document.cstrprint.problemtype.value = 0; |
|
if (this.document.lonhomework) { |
|
if ((this.document.lonhomework.rndseed) && (this.document.lonhomework.rndseed.value != null) && (this.document.lonhomework.rndseed.value != '')) { |
|
this.document.cstrprint.curseed.value = this.document.lonhomework.rndseed.value |
|
} |
|
if (this.document.lonhomework.problemtype) { |
|
for (var i=0; i<this.document.lonhomework.problemtype.options.length; i++) { |
|
if (this.document.lonhomework.problemtype.options[i].selected) { |
|
if (this.document.lonhomework.problemtype.options[i].value != null && this.document.lonhomework.problemtype.options[i].value != '') { |
|
this.document.cstrprint.problemtype.value = this.document.lonhomework.problemtype.options[i].value |
|
} |
|
} |
|
} |
|
} |
|
} |
|
this.document.cstrprint.submit(); |
|
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 1066 sub constspaceform {
|
Line 1126 sub constspaceform {
|
<input type="hidden" name="action" value="delete" /> |
<input type="hidden" name="action" value="delete" /> |
<input type="hidden" name="filename" value="" /> |
<input type="hidden" name="filename" value="" /> |
</form> |
</form> |
|
<form name="cstrprint" action="/adm/printout" target="_parent" method="post"> |
|
<input type="hidden" name="postdata" value="" /> |
|
<input type="hidden" name="curseed" value="" /> |
|
<input type="hidden" name="problemtype" value="" /> |
|
</form> |
|
|
ENDCONSTSPACEFORM |
ENDCONSTSPACEFORM |
} |
} |
|
|
Line 1111 sub handler {
|
Line 1177 sub handler {
|
$tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain); |
$tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain); |
$font=&Apache::loncommon::designparm($function.'.font',$domain); |
$font=&Apache::loncommon::designparm($function.'.font',$domain); |
my $script_tag; |
my $script_tag; |
if ($ENV{'environment.remote'} eq 'on') { |
if ($ENV{'environment.remote'} ne 'off') { |
my $utility=&utilityfunctions('/adm/menu'); |
my $utility=&utilityfunctions('/adm/menu'); |
$script_tag=(<<ENDSCRIPT); |
$script_tag=(<<ENDSCRIPT); |
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 1124 ENDSCRIPT
|
Line 1190 ENDSCRIPT
|
$ENV{'browser.interface'}='faketextual'; |
$ENV{'browser.interface'}='faketextual'; |
$ENV{'environment.remote'}='off'; |
$ENV{'environment.remote'}='off'; |
} |
} |
|
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(<<ENDHEADER); |
$r->print(<<ENDHEADER); |
<html><head> |
$html |
|
<head> |
<title>LON-CAPA Main Menu</title> |
<title>LON-CAPA Main Menu</title> |
$script_tag |
$script_tag |
</head> |
</head> |