version 1.214, 2007/04/13 20:22:15
|
version 1.228, 2007/10/11 22:49:49
|
Line 61 sub initlittle {
|
Line 61 sub initlittle {
|
'main' => 'Main Menu', |
'main' => 'Main Menu', |
'roles' => ($env{'user.adv'}? |
'roles' => ($env{'user.adv'}? |
'Roles':'Courses'), |
'Roles':'Courses'), |
'docs' => 'Course Documents', |
'docs' => 'Edit Course', |
'exit' => 'Exit', |
'exit' => 'Exit', |
'login' => 'Log In', |
'login' => 'Log In', |
'launch' => 'Launch Remote Control', |
'launch' => 'Launch Remote Control', |
Line 121 sub menubuttons {
|
Line 121 sub menubuttons {
|
$navmaps=(<<ENDNAV); |
$navmaps=(<<ENDNAV); |
<a href="/adm/navmaps?postdata=$escurl&postsymb=$escsymb" target="_top">$lt{'nav'}</a> |
<a href="/adm/navmaps?postdata=$escurl&postsymb=$escsymb" target="_top">$lt{'nav'}</a> |
ENDNAV |
ENDNAV |
if (($env{'request.noversionuri'}=~/^\/adm\//) && |
if (&show_return_link()) { |
($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) && |
|
($env{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) { |
|
my $escreload=&escape('return:'); |
my $escreload=&escape('return:'); |
$reloadlink=(<<ENDRELOAD); |
$reloadlink=(<<ENDRELOAD); |
<a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a> |
<a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a> |
Line 196 ENDINLINEMENU
|
Line 194 ENDINLINEMENU
|
$navmaps=(<<ENDNAV); |
$navmaps=(<<ENDNAV); |
<td><a href="$link" target="_top">$lt{'nav'}</a></td> |
<td><a href="$link" target="_top">$lt{'nav'}</a></td> |
ENDNAV |
ENDNAV |
my $is_group = (&Apache::loncommon::course_type() eq 'Group'); |
my $is_group = (&Apache::loncommon::course_type() eq 'Group'); |
if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) { |
if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) { |
my $text = ($is_group) ? $lt{'gdoc'} : $lt{'docs'}; |
my $text = ($is_group) ? $lt{'gdoc'} : $lt{'docs'}; |
$docs=(<<ENDDOCS); |
$docs=(<<ENDDOCS); |
Line 208 ENDDOCS
|
Line 206 ENDDOCS
|
<td><a href="/adm/coursegroups" target="_top">$lt{'groups'}</a></td> |
<td><a href="/adm/coursegroups" target="_top">$lt{'groups'}</a></td> |
ENDGROUPS |
ENDGROUPS |
} |
} |
if ( |
foreach my $key (sort(keys(%env))) { |
($env{'request.noversionuri'}=~m[^/(res|public)/] && |
next if ($key !~ /^request/); |
$env{'request.symb'} eq '') |
&Apache::lonnet::logthis("$key =>".$env{$key}); |
|| |
} |
(($env{'request.noversionuri'}=~/^\/adm\//) && |
if (&show_return_link()) { |
($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) && |
|
($env{'request.noversionuri'}!~ |
|
m[^/adm/.*/(smppg|bulletinboard|aboutme)($|\?)]) |
|
) |
|
) { |
|
my $escreload=&escape('return:'); |
my $escreload=&escape('return:'); |
$reloadlink=(<<ENDRELOAD); |
$reloadlink=(<<ENDRELOAD); |
<td><a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a></td> |
<td><a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a></td> |
Line 274 ENDINLINEMENU
|
Line 267 ENDINLINEMENU
|
} |
} |
} |
} |
|
|
|
sub show_return_link { |
|
return (($env{'request.noversionuri'}=~m{^/(res|public)/} && |
|
$env{'request.symb'} eq '') |
|
|| |
|
($env{'request.noversionuri'}=~ m{^/cgi-bin/printout.pl}) |
|
|| |
|
(($env{'request.noversionuri'}=~/^\/adm\//) && |
|
($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) && |
|
($env{'request.noversionuri'}!~ |
|
m[^/adm/.*/(smppg|bulletinboard|aboutme)($|\?)]) |
|
)); |
|
} |
|
|
# ====================================== This gets called in the header section |
# ====================================== This gets called in the header section |
|
|
sub registerurl { |
sub registerurl { |
Line 486 s&8&3&prt.gif&prepare[_1]&printout[_1]&g
|
Line 492 s&8&3&prt.gif&prepare[_1]&printout[_1]&g
|
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); |
if (!$env{'request.enc'}) { |
|
$menuitems.=(<<ENDREALRES); |
s&6&3&catalog.gif&catalog[_1]&info[_1]&catalog_info()&Show catalog information |
s&6&3&catalog.gif&catalog[_1]&info[_1]&catalog_info()&Show catalog information |
|
ENDREALRES |
|
} |
|
$menuitems.=(<<ENDREALRES); |
s&8&1&eval.gif&evaluate[_1]&this[_1]&gopost('/adm/evaluate',currentURL,1)&Provide my evaluation of this resource |
s&8&1&eval.gif&evaluate[_1]&this[_1]&gopost('/adm/evaluate',currentURL,1)&Provide my evaluation of this resource |
s&8&2&fdbk.gif&feedback[_1]&discuss[_1]&gopost('/adm/feedback',currentURL,1)&Provide feedback messages or contribute to the course discussion about this resource |
s&8&2&fdbk.gif&feedback[_1]&discuss[_1]&gopost('/adm/feedback',currentURL,1)&Provide feedback messages or contribute to the course discussion about this resource |
ENDREALRES |
ENDREALRES |
Line 502 ENDMENUITEMS
|
Line 513 ENDMENUITEMS
|
my $buttons=''; |
my $buttons=''; |
foreach (split(/\n/,$menuitems)) { |
foreach (split(/\n/,$menuitems)) { |
my ($command,@rest)=split(/\&/,$_); |
my ($command,@rest)=split(/\&/,$_); |
if ($command eq 's') { |
my $idx=10*$rest[0]+$rest[1]; |
$buttons.=&switch('','',@rest); |
if (&hidden_button_check() eq 'yes') { |
} else { |
if ($idx == 21 ||$idx == 23) { |
$buttons.=&clear(@rest); |
$buttons.=&switch('','',@rest); |
|
} else { |
|
$buttons.=&clear(@rest); |
|
} |
|
} else { |
|
if ($command eq 's') { |
|
$buttons.=&switch('','',@rest); |
|
} else { |
|
$buttons.=&clear(@rest); |
|
} |
} |
} |
} |
} |
|
|
Line 515 ENDMENUITEMS
|
Line 535 ENDMENUITEMS
|
my $inlinebuttons=''; |
my $inlinebuttons=''; |
if ($addremote) { |
if ($addremote) { |
# Registered, textual output |
# 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); |
if ($env{'environment.icons'} eq 'iconsonly') { |
|
$inlinebuttons=(<<ENDARROWSINLINE); |
|
<tr><td> |
|
$inlineremote[21] $inlineremote[23] |
|
ENDARROWSINLINE |
|
if (&hidden_button_check() ne 'yes') { |
|
$inlinebuttons .= (<<ENDINLINEICONS); |
|
$inlineremote[61] $inlineremote[63] |
|
$inlineremote[71] $inlineremote[72] $inlineremote[73] |
|
$inlineremote[81] $inlineremote[82] $inlineremote[83] |
|
$inlineremote[91] $inlineremote[92] $inlineremote[93]</td></tr> |
|
ENDINLINEICONS |
|
} |
|
} else { |
|
if ($inlineremote[21] ne '' || $inlineremote[23] ne '') { |
|
$inlinebuttons=(<<ENDFIRSTLINE); |
<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> |
ENDFIRSTLINE |
<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> |
if (&hidden_button_check() ne 'yes') { |
<tr><td>$inlineremote[91]</td><td>$inlineremote[92]</td><td>$inlineremote[93]</td></tr> |
foreach my $row (6..9) { |
ENDINLINE |
if ($inlineremote[${row}.'1'] ne '' |
} |
|| $inlineremote[$row.'2'] ne '' |
|
|| $inlineremote[$row.'3'] ne '') { |
|
$inlinebuttons .= <<"ENDLINE"; |
|
<tr><td>$inlineremote["${row}1"]</td><td>$inlineremote["${row}2"]</td><td>$inlineremote["${row}3"]</td></tr> |
|
ENDLINE |
|
} |
|
} |
|
} |
|
} |
|
} |
} |
} |
$result =(<<ENDREGTEXT); |
$result =(<<ENDREGTEXT); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// BEGIN LON-CAPA Internal |
// BEGIN LON-CAPA Internal |
</script> |
</script> |
$timesync |
$timesync |
$newmail |
|
$tablestart |
$tablestart |
$inlinebuttons |
$inlinebuttons |
$tableend |
$tableend |
|
$newmail |
<script type="text/javascript"> |
<script type="text/javascript"> |
// END LON-CAPA Internal |
// END LON-CAPA Internal |
</script> |
</script> |
Line 775 sub open {
|
Line 818 sub open {
|
return '<script type="text/javascript">self.name="loncapaclient";</script>'; |
return '<script type="text/javascript">self.name="loncapaclient";</script>'; |
} |
} |
my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'}; |
my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'}; |
unless (shift eq 'unix') { |
|
|
# unless (shift eq 'unix') { |
# resizing does not work on linux because of virtual desktop sizes |
# resizing does not work on linux because of virtual desktop sizes |
$returnval.=(<<ENDRESIZE); |
# $returnval.=(<<ENDRESIZE); |
if (window.screen) { |
#if (window.screen) { |
self.resizeTo(screen.availWidth-215,screen.availHeight-55); |
# self.resizeTo(screen.availWidth-215,screen.availHeight-55); |
self.moveTo(190,15); |
# self.moveTo(190,15); |
} |
#} |
ENDRESIZE |
#ENDRESIZE |
} |
# } |
$returnval.=(<<ENDOPEN); |
$returnval.=(<<ENDOPEN); |
window.status='Opening LON-CAPA Remote Control'; |
window.status='Opening LON-CAPA Remote Control'; |
var menu=window.open("/res/adm/pages/menu.html","$menuname", |
var menu=window.open("/res/adm/pages/menu.html","$menuname", |
Line 849 sub switch {
|
Line 893 sub switch {
|
my $text=$top.' '.$bot; |
my $text=$top.' '.$bot; |
$text=~s/\s*\-\s*//gs; |
$text=~s/\s*\-\s*//gs; |
|
|
my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'}; |
|
if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; } |
|
my $pic= |
my $pic= |
'<img alt="'.$text.'" src="http://'.$ENV{'HTTP_HOST'}. |
'<img alt="'.$text.'" src="'. |
':'.$lonhttpdPort.'/res/adm/pages/'.$img.'" align="'. |
&Apache::loncommon::lonhttpdurl('/res/adm/pages/'.$img). |
($nobreak==3?'right':'left').'" />'; |
'" align="'.($nobreak==3?'right':'left').'" />'; |
if ($env{'browser.interface'} eq 'faketextual') { |
if ($env{'browser.interface'} eq 'faketextual') { |
# Accessibility |
# Accessibility |
if ($nobreak==3) { |
if ($nobreak==3) { |
Line 866 sub switch {
|
Line 908 sub switch {
|
$inlineremote[$idx]="\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"><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 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">'. |
$desc.'</td></tr>'; |
'<a class="LC_menubuttons_link" href="javascript:'.$act.';"><span class="LC_menubuttons_inline_text">'.$desc.'</span></a></td></tr>'; |
} |
} |
} else { |
} else { |
# Inline Menu |
# Inline Menu |
$inlineremote[$idx]= |
if ($env{'environment.icons'} eq 'iconsonly') { |
'<a href="javascript:'.$act.';">'.$pic. |
$inlineremote[$idx]='<a title="'.$desc.'" href="javascript:'.$act.';">'.$pic.'</a>'; |
'</a><span class="LC_menubuttons_inline_text">'.$desc.'</span>'; |
} else { |
|
$inlineremote[$idx]= |
|
'<a class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic. |
|
'<span class="LC_menubuttons_inline_text">'.$desc.'</span></a>'; |
|
} |
} |
} |
} |
} |
return ''; |
return ''; |
Line 1233 function annotate() {
|
Line 1279 function annotate() {
|
'$start_page_annotate' |
'$start_page_annotate' |
+"<form name='goannotate' target='Annotator' method='post' " |
+"<form name='goannotate' target='Annotator' method='post' " |
+"action='/adm/annotations'>" |
+"action='/adm/annotations'>" |
+"<input type='hidden' name='urlnew' value='"+currentURL+"' />" |
+"<input type='hidden' name='symbnew' value='"+currentSymb+"' />" |
+"<\\/form>" |
+"<\\/form>" |
+'$end_page_annotate'); |
+'$end_page_annotate'); |
annotator.document.close(); |
annotator.document.close(); |
Line 1317 sub convert_menu_function {
|
Line 1363 sub convert_menu_function {
|
return $rolename; |
return $rolename; |
} |
} |
|
|
|
sub hidden_button_check { |
|
my $hidden; |
|
if ($env{'request.course.id'} eq '') { |
|
return; |
|
} |
|
if ($env{'request.role.adv'}) { |
|
return; |
|
} |
|
return &Apache::lonnet::EXT('resource.0.buttonshide'); |
|
} |
|
|
# ================================================================ Main Program |
# ================================================================ Main Program |
|
|