version 1.367, 2012/01/13 17:35:13
|
version 1.369.2.7, 2012/05/25 03:23:36
|
Line 26
|
Line 26
|
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
# |
# |
# There is one parameter controlling the action of this module: |
|
# |
|
|
|
=head1 NAME |
=head1 NAME |
|
|
Line 35 Apache::lonmenu
|
Line 33 Apache::lonmenu
|
|
|
=head1 SYNOPSIS |
=head1 SYNOPSIS |
|
|
Coordinates the response to clicking an image. |
Loads contents of /home/httpd/lonTabs/mydesk.tab, |
|
used to generate inline menu, and Main Menu page. |
|
|
This is part of the LearningOnline Network with CAPA project |
This is part of the LearningOnline Network with CAPA project |
described at http://www.lon-capa.org. |
described at http://www.lon-capa.org. |
Line 74 It is set to 'done' in the BEGIN block o
|
Line 73 It is set to 'done' in the BEGIN block o
|
=item @primary_menu |
=item @primary_menu |
|
|
The elements of this array reference arrays that are made up of the components |
The elements of this array reference arrays that are made up of the components |
of those lines of mydesk.tab that start with prim. |
of those lines of mydesk.tab that start with prim:. |
It is used by primary_menu() to generate the corresponding menu. |
It is used by primary_menu() to generate the corresponding menu. |
It gets filled in the BEGIN block of this module. |
It gets filled in the BEGIN block of this module. |
|
|
|
=item %primary_sub_menu |
|
|
|
The keys of this hash reference are the names of items in the primary_menu array |
|
which have sub-menus. For each key, the corresponding value is a reference to |
|
an array containing components extracted from lines in mydesk.tab which begin |
|
with primsub:. |
|
This hash, which is used by primary_menu to generate sub-menus, is populated in |
|
the BEGIN block. |
|
|
=item @secondary_menu |
=item @secondary_menu |
|
|
The elements of this array reference arrays that are made up of the components |
The elements of this array reference arrays that are made up of the components |
Line 107 entries from mydesk.tab
|
Line 115 entries from mydesk.tab
|
|
|
Same as primary_menu() but operates on @secondary_menu. |
Same as primary_menu() but operates on @secondary_menu. |
|
|
|
=item create_submenu() |
|
|
|
Creates XHTML for unordered list of sub-menu items which belong to a |
|
particular top-level menu item. Uses hover pseudo class in css to display |
|
dropdown list when mouse hovers over top-level item. Support for IE6 |
|
(no hover psuedo class) via LC_hoverable class for <li> tag for top- |
|
level item, which employs jQuery to handle behavior on mouseover. |
|
|
|
Inputs: 4 - (a) link and (b) target for anchor href in top level item, |
|
(c) title for text wrapped by anchor tag in top level item. |
|
(d) reference to array of arrays of sub-menu items. |
|
|
=item innerregister() |
=item innerregister() |
|
|
This gets called in order to register a URL in the body of the document |
This gets called in order to register a URL in the body of the document |
Line 129 The javascript is usually similar to "go
|
Line 149 The javascript is usually similar to "go
|
|
|
=item utilityfunctions() |
=item utilityfunctions() |
|
|
|
Output from this routine is a number of javascript functions called by |
|
items in the inline menu, and in some cases items in the Main Menu page. |
|
|
=item serverform() |
=item serverform() |
|
|
=item constspaceform() |
=item constspaceform() |
Line 156 use Apache::lonlocal;
|
Line 179 use Apache::lonlocal;
|
use Apache::lonmsg(); |
use Apache::lonmsg(); |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
use HTML::Entities(); |
use HTML::Entities(); |
use Apache::lonwishlist(); |
|
|
|
use vars qw(@desklines %category_names %category_members %category_positions |
use vars qw(@desklines %category_names %category_members %category_positions |
$readdesk @primary_menu @secondary_menu); |
$readdesk @primary_menu %primary_submenu @secondary_menu %secondary_submenu); |
|
|
my @inlineremote; |
my @inlineremote; |
|
|
Line 182 sub prep_menuitem {
|
Line 204 sub prep_menuitem {
|
|
|
# primary_menu() evaluates @primary_menu and returns XHTML for the menu |
# primary_menu() evaluates @primary_menu and returns XHTML for the menu |
# that contains following links: |
# that contains following links: |
# About, Message, Roles, Help, Logout |
# About, Message, Personal, Roles, Help, Logout |
# @primary_menu is filled within the BEGIN block of this module with |
# @primary_menu is filled within the BEGIN block of this module with |
# entries from mydesk.tab |
# entries from mydesk.tab |
sub primary_menu { |
sub primary_menu { |
Line 212 sub primary_menu {
|
Line 234 sub primary_menu {
|
next if $$menuitem[4] eq 'courses' ##'Roles' wanted |
next if $$menuitem[4] eq 'courses' ##'Roles' wanted |
&& !&Apache::loncommon::show_course(); ## |
&& !&Apache::loncommon::show_course(); ## |
|
|
|
my $title = $menuitem->[3]; |
if ($$menuitem[3] eq 'Help') { # special treatment for helplink |
if (defined($primary_submenu{$title})) { |
|
my ($link,$target); |
|
if ($menuitem->[0] ne '') { |
|
$link = $menuitem->[0]; |
|
$target = '_top'; |
|
} else { |
|
$link = '#'; |
|
} |
|
my @primsub; |
|
if (ref($primary_submenu{$title}) eq 'ARRAY') { |
|
foreach my $item (@{$primary_submenu{$title}}) { |
|
next if (($item->[2] eq 'wishlist') && |
|
((!&Apache::lonnet::allowed('bre',"/res/$env{'user.domain'}/")) && |
|
(!&Apache::lonnet::allowed('bro',"/res/$env{'user.domain'}/")))); |
|
next if (($item->[2] eq 'reqcrs') && (!&check_for_rcrs())); |
|
next if ((($item->[2] eq 'portfolio') || |
|
($item->[2] eq 'blog')) && |
|
(!&Apache::lonnet::usertools_access('','',$item->[2], |
|
undef,'tools'))); |
|
push(@primsub,$item); |
|
} |
|
if (@primsub > 0) { |
|
$menu .= &create_submenu($link,$target,$title,\@primsub); |
|
} elsif ($link) { |
|
$menu .= '<li><a href="'.$link.'" target="'.$target.'">'.&mt($title).'</a></li>'; |
|
} |
|
} |
|
} elsif ($$menuitem[3] eq 'Help') { # special treatment for helplink |
if ($public) { |
if ($public) { |
my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
my $defdom = &Apache::lonnet::default_login_domain(); |
my $defdom = &Apache::lonnet::default_login_domain(); |
Line 269 sub secondary_menu {
|
Line 318 sub secondary_menu {
|
? "/$env{'request.course.sec'}" |
? "/$env{'request.course.sec'}" |
: ''); |
: ''); |
my $canedit = &Apache::lonnet::allowed('mdc', $env{'request.course.id'}); |
my $canedit = &Apache::lonnet::allowed('mdc', $env{'request.course.id'}); |
my $canviewgrps = &Apache::lonnet::allowed('vcg', $crs_sec); |
my $canviewroster = $env{'course.'.$env{'request.course.id'}.'.student_classlist_view'}; |
my $canmodifyuser = &Apache::lonnet::allowed('cst', $crs_sec); |
my $canviewgrps = &Apache::lonnet::allowed('vcg', $crs_sec); |
my $canviewwnew = &Apache::lonnet::allowed('whn', $crs_sec); |
my $canmodifyuser = &Apache::lonnet::allowed('cst', $crs_sec); |
|
my $canviewwnew = &Apache::lonnet::allowed('whn', $crs_sec); |
my $canmodpara = &Apache::lonnet::allowed('opa', $crs_sec); |
my $canmodpara = &Apache::lonnet::allowed('opa', $crs_sec); |
my $canvgr = &Apache::lonnet::allowed('vgr', $crs_sec); |
my $canvgr = &Apache::lonnet::allowed('vgr', $crs_sec); |
my $canmgr = &Apache::lonnet::allowed('mgr', $crs_sec); |
my $canmgr = &Apache::lonnet::allowed('mgr', $crs_sec); |
my $author = &getauthor(); |
my $author = &getauthor(); |
|
|
my %groups = &Apache::lonnet::get_active_groups( |
my %groups = &Apache::lonnet::get_active_groups( |
Line 290 sub secondary_menu {
|
Line 340 sub secondary_menu {
|
&& !$env{'request.course.id'}; |
&& !$env{'request.course.id'}; |
next if $$menuitem[4] =~ /^mdc/ |
next if $$menuitem[4] =~ /^mdc/ |
&& !$canedit; |
&& !$canedit; |
|
next if $$menuitem[4] eq 'mdcCourse' |
|
&& ($crstype eq 'Community'); |
|
next if $$menuitem[4] eq 'mdcCommunity' |
|
&& ($crstype eq 'Course'); |
next if $$menuitem[4] eq 'nvgr' |
next if $$menuitem[4] eq 'nvgr' |
&& $canvgr; |
&& $canvgr; |
next if $$menuitem[4] eq 'vgr' |
next if $$menuitem[4] eq 'vgr' |
Line 297 sub secondary_menu {
|
Line 351 sub secondary_menu {
|
next if $$menuitem[4] eq 'cst' |
next if $$menuitem[4] eq 'cst' |
&& !$canmodifyuser; |
&& !$canmodifyuser; |
next if $$menuitem[4] eq 'ncst' |
next if $$menuitem[4] eq 'ncst' |
&& $canmodifyuser; |
&& ($canmodifyuser || !$canviewroster); |
next if $$menuitem[4] eq 'mgr' |
next if $$menuitem[4] eq 'mgr' |
&& !$canmgr; |
&& !$canmgr; |
next if $$menuitem[4] eq 'nmgr' |
next if $$menuitem[4] eq 'nmgr' |
Line 306 sub secondary_menu {
|
Line 360 sub secondary_menu {
|
&& !$canviewwnew; |
&& !$canviewwnew; |
next if $$menuitem[4] eq 'opa' |
next if $$menuitem[4] eq 'opa' |
&& !$canmodpara; |
&& !$canmodpara; |
next if $$menuitem[4] =~ /showgroups$/ |
next if $$menuitem[4] eq 'nvcg' |
&& !$canviewgrps |
&& ($canviewgrps || !%groups); |
&& !%groups; |
|
next if $$menuitem[4] eq 'author' |
next if $$menuitem[4] eq 'author' |
&& !$author; |
&& !$author; |
|
|
if ($$menuitem[3] eq 'Roles' && $env{'request.course.id'}) { |
my $title = $menuitem->[3]; |
|
if (defined($secondary_submenu{$title})) { |
|
my ($link,$target); |
|
if ($menuitem->[0] ne '') { |
|
$link = $menuitem->[0]; |
|
$target = '_top'; |
|
} else { |
|
$link = '#'; |
|
} |
|
my @scndsub; |
|
if (ref($secondary_submenu{$title}) eq 'ARRAY') { |
|
foreach my $item (@{$secondary_submenu{$title}}) { |
|
if (ref($item) eq 'ARRAY') { |
|
next if ($item->[2] eq 'vgr' && !$canvgr); |
|
next if ($item->[2] eq 'opa' && !$canmodpara); |
|
next if ($item->[2] eq 'cst' && !$canmodifyuser); |
|
next if ($item->[2] eq 'mgr' && !$canmgr); |
|
next if ($item->[2] eq 'vcg' && !$canviewgrps); |
|
push(@scndsub,$item); |
|
} |
|
} |
|
if (@scndsub > 0) { |
|
$menu .= &create_submenu($link,$target,$title,\@scndsub); |
|
} elsif ($link) { |
|
$menu .= '<li><a href="'.$link.'" target="'.$target.'">'.&mt($title).'</a></li>'; |
|
} |
|
} |
|
} elsif ($$menuitem[3] eq 'Roles' && $env{'request.course.id'}) { |
# special treatment for role selector |
# special treatment for role selector |
my $roles_selector = &roles_selector( |
my $roles_selector = &roles_selector( |
$env{'course.' . $env{'request.course.id'} . '.domain'}, |
$env{'course.' . $env{'request.course.id'} . '.domain'}, |
$env{'course.' . $env{'request.course.id'} . '.num'} ); |
$env{'course.' . $env{'request.course.id'} . '.num'} ); |
|
|
$menu .= $roles_selector ? "<li>$roles_selector</li>" |
$menu .= $roles_selector ? "<li style=\"padding: 0 0.8em;\">$roles_selector</li>" |
: ''; |
: ''; |
} else { |
} else { |
$menu .= &prep_menuitem(\@$menuitem); |
$menu .= &prep_menuitem(\@$menuitem); |
Line 348 sub secondary_menu {
|
Line 428 sub secondary_menu {
|
return "<ul id=\"LC_secondary_menu\">$menu</ul>"; |
return "<ul id=\"LC_secondary_menu\">$menu</ul>"; |
} |
} |
|
|
|
sub create_submenu { |
|
my ($link,$target,$title,$submenu) = @_; |
|
return unless (ref($submenu) eq 'ARRAY'); |
|
my $menu = '<li class="LC_hoverable">'. |
|
'<a href="'.$link.'" target="'.$target.'">'. |
|
'<span class="LC_nobreak">'.&mt($title). |
|
'<span class="LC_fontsize_small" style="font-weight:normal;">'. |
|
' ▼</span></span></a>'. |
|
'<ul>'; |
|
my $count = 0; |
|
my $numsub = scalar(@{$submenu}); |
|
foreach my $item (@{$submenu}) { |
|
$count ++; |
|
if (ref($item) eq 'ARRAY') { |
|
my $borderbot; |
|
if ($count == $numsub) { |
|
$borderbot = 'border-bottom:1px solid black;'; |
|
} |
|
$menu .= '<li style="margin:0;padding:0;'. |
|
$borderbot.'"><a href="'.$item->[0].'">'. |
|
'" style="padding:0;">'. |
|
&mt($item->[1]).'</a></li>'; |
|
} |
|
} |
|
$menu .= '</ul></li>'; |
|
return $menu; |
|
} |
|
|
sub innerregister { |
sub innerregister { |
my ($forcereg,$bread_crumbs) = @_; |
my ($forcereg,$bread_crumbs) = @_; |
my $const_space = ($env{'request.state'} eq 'construct'); |
my $const_space = ($env{'request.state'} eq 'construct'); |
Line 628 c&6&3
|
Line 736 c&6&3
|
c&8&1 |
c&8&1 |
c&8&2 |
c&8&2 |
s&8&3&prt.png&Print&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document |
s&8&3&prt.png&Print&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document |
|
s&9&1&sbkm.png&Bookmark&set[_1]bookmark[_2]&set_bookmark()&Set a bookmark for this resource&&1 |
|
|
ENDMENUITEMS |
ENDMENUITEMS |
if (&Apache::lonnet::allowed('bre', $env{'request.course.id'}) eq 'F' && $env{'request.uri'} =~ /^\/res/) { |
|
# wishlist is only available for users with access to resource-pool |
|
# and links can only be set for resources within the resource-pool |
|
$menuitems .= (<<ENDMENUITEMS); |
|
s&9&1&wishlist-link.png&Wishlist&wishlistlink[_2]&set_wishlistlink()&Set a link for this resource to wishlist&&1 |
|
ENDMENUITEMS |
|
} |
|
|
|
my $currentURL = &Apache::loncommon::get_symb(); |
my $currentURL = &Apache::loncommon::get_symb(); |
my ($symb_old,$symb_old_enc) = &Apache::loncommon::clean_symb($currentURL); |
my ($symb_old,$symb_old_enc) = &Apache::loncommon::clean_symb($currentURL); |
Line 665 ENDREALRES
|
Line 768 ENDREALRES
|
$menuitems .= (<<ENDMENUITEMS); |
$menuitems .= (<<ENDMENUITEMS); |
s&8&3&prt.png&Print&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document |
s&8&3&prt.png&Print&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document |
ENDMENUITEMS |
ENDMENUITEMS |
if (&Apache::lonnet::allowed('bre', $env{'request.course.id'}) eq 'F') { |
|
# wishlist is only available for users with access to resource-pool |
|
$menuitems .= (<<ENDMENUITEMS); |
|
s&9&1&wishlist-link.png&Wishlist&wishlistlink[_2]&set_wishlistlink()&Set a link for this resource to wishlist&&1 |
|
ENDMENUITEMS |
|
} |
|
} |
} |
my $buttons=''; |
my $buttons=''; |
foreach (split(/\n/,$menuitems)) { |
foreach (split(/\n/,$menuitems)) { |
Line 761 sub edit_course_upload {
|
Line 858 sub edit_course_upload {
|
return $cfile; |
return $cfile; |
} |
} |
|
|
|
sub startupremote { |
|
my ($lowerurl)=@_; |
|
if ($env{'environment.remote'} eq 'off') { |
|
return ('<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url='.$lowerurl.'" />'); |
|
} |
|
# |
|
# The Remote actually gets launched! |
|
# |
|
my $configmenu=&rawconfig(); |
|
my $esclowerurl=&escape($lowerurl); |
|
my $message=&mt('"Waiting for Remote Control window to load: "+[_1]','waited'); |
|
return(<<ENDREMOTESTARTUP); |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
var timestart; |
|
function wheelswitch() { |
|
if (typeof(document.wheel) != 'undefined') { |
|
if (typeof(document.wheel.spin) != 'undefined') { |
|
var date=new Date(); |
|
var waited=Math.round(30-((date.getTime()-timestart)/1000)); |
|
document.wheel.spin.value=$message; |
|
} |
|
} |
|
if (window.status=='|') { |
|
window.status='/'; |
|
} else { |
|
if (window.status=='/') { |
|
window.status='-'; |
|
} else { |
|
if (window.status=='-') { |
|
window.status='\\\\'; |
|
} else { |
|
if (window.status=='\\\\') { window.status='|'; } |
|
} |
|
} |
|
} |
|
} |
|
|
|
// ---------------------------------------------------------- The wait function |
|
var canceltim; |
|
function wait() { |
|
if ((menuloaded==1) || (tim==1)) { |
|
window.status='Done.'; |
|
if (tim==0) { |
|
clearTimeout(canceltim); |
|
$configmenu |
|
window.location='$lowerurl'; |
|
} else { |
|
window.location='/adm/remote?action=collapse&url=$esclowerurl'; |
|
} |
|
} else { |
|
wheelswitch(); |
|
setTimeout('wait();',200); |
|
} |
|
} |
|
|
|
function main() { |
|
canceltim=setTimeout('tim=1;',30000); |
|
window.status='-'; |
|
var date=new Date(); |
|
timestart=date.getTime(); |
|
wait(); |
|
} |
|
|
|
// ]]> |
|
</script> |
|
ENDREMOTESTARTUP |
|
} |
|
|
|
sub setflags() { |
|
return(<<ENDSETFLAGS); |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
menuloaded=0; |
|
tim=0; |
|
// ]]> |
|
</script> |
|
ENDSETFLAGS |
|
} |
|
|
|
sub maincall() { |
|
if ($env{'environment.remote'} eq 'off') { return ''; } |
|
return(<<ENDMAINCALL); |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
main(); |
|
// ]]> |
|
</script> |
|
ENDMAINCALL |
|
} |
|
|
|
sub load_remote_msg { |
|
my ($lowerurl)=@_; |
|
|
|
if ($env{'environment.remote'} eq 'off') { return ''; } |
|
|
|
my $esclowerurl=&escape($lowerurl); |
|
my $link=&mt('[_1]Continue[_2] on in Inline Menu mode' |
|
,'<a href="/adm/remote?action=collapse&url='.$esclowerurl.'">' |
|
,'</a>'); |
|
return(<<ENDREMOTEFORM); |
|
<p> |
|
<form name="wheel"> |
|
<input name="spin" type="text" size="60" /> |
|
</form> |
|
</p> |
|
<p>$link</p> |
|
ENDREMOTEFORM |
|
} |
|
|
|
sub get_menu_name { |
|
my $hostid = $Apache::lonnet::perlvar{'lonHostID'}; |
|
$hostid =~ s/\W//g; |
|
return 'LCmenu'.$hostid; |
|
} |
|
|
|
|
|
sub reopenmenu { |
|
if ($env{'environment.remote'} eq 'off') { return ''; } |
|
my $menuname = &get_menu_name(); |
|
my $nothing = &Apache::lonhtmlcommon::javascript_nothing(); |
|
return('window.open('.$nothing.',"'.$menuname.'","",false);'); |
|
} |
|
|
|
|
|
sub open { |
|
my $returnval=''; |
|
if ($env{'environment.remote'} eq 'off') { |
|
return |
|
'<script type="text/javascript">'."\n" |
|
.'// <![CDATA['."\n" |
|
.'self.name="loncapaclient";'."\n" |
|
.'// ]]>'."\n" |
|
.'</script>'; |
|
} |
|
my $menuname = &get_menu_name(); |
|
|
|
# unless (shift eq 'unix') { |
|
# resizing does not work on linux because of virtual desktop sizes |
|
# $returnval.=(<<ENDRESIZE); |
|
#if (window.screen) { |
|
# self.resizeTo(screen.availWidth-215,screen.availHeight-55); |
|
# self.moveTo(190,15); |
|
#} |
|
#ENDRESIZE |
|
# } |
|
$returnval=(<<ENDOPEN); |
|
// <![CDATA[ |
|
window.status='Opening LON-CAPA Remote Control'; |
|
var menu=window.open("/res/adm/pages/menu.html?inhibitmenu=yes","$menuname", |
|
"height=375,width=150,scrollbars=no,menubar=no,top=5,left=5,screenX=5,screenY=5"); |
|
self.name='loncapaclient'; |
|
// ]]> |
|
ENDOPEN |
|
return '<script type="text/javascript">'.$returnval.'</script>'; |
|
} |
|
|
|
|
# ================================================================== Raw Config |
# ================================================================== Raw Config |
|
|
sub clear { |
sub clear { |
Line 1076 sub check_for_rcrs {
|
Line 1331 sub check_for_rcrs {
|
return $showreqcrs; |
return $showreqcrs; |
} |
} |
|
|
|
# ======================================================================= Close |
|
|
|
sub close { |
|
if ($env{'environment.remote'} eq 'off') { return ''; } |
|
my $menuname = &get_menu_name(); |
|
return(<<ENDCLOSE); |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
window.status='Accessing Remote Control'; |
|
menu=window.open("/adm/rat/empty.html","$menuname", |
|
"height=350,width=150,scrollbars=no,menubar=no"); |
|
window.status='Disabling Remote Control'; |
|
menu.active=0; |
|
menu.autologout=0; |
|
window.status='Closing Remote Control'; |
|
menu.close(); |
|
window.status='Done.'; |
|
// ]]> |
|
</script> |
|
ENDCLOSE |
|
} |
|
|
sub dc_popup_js { |
sub dc_popup_js { |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
more => '(More ...)', |
more => '(More ...)', |
Line 1087 function showCourseID() {
|
Line 1364 function showCourseID() {
|
document.getElementById('dccid').style.display='block'; |
document.getElementById('dccid').style.display='block'; |
document.getElementById('dccid').style.textAlign='left'; |
document.getElementById('dccid').style.textAlign='left'; |
document.getElementById('dccid').style.textFace='normal'; |
document.getElementById('dccid').style.textFace='normal'; |
document.getElementById('dccidtext').innerHTML ='<a href="javascript:hideCourseID();">$lt{'less'}</a>'; |
document.getElementById('dccidtext').innerHTML ='<a href="javascript:hideCourseID();" class="LC_menubuttons_link">$lt{'less'}</a>'; |
return; |
return; |
} |
} |
|
|
function hideCourseID() { |
function hideCourseID() { |
document.getElementById('dccid').style.display='none'; |
document.getElementById('dccid').style.display='none'; |
document.getElementById('dccidtext').innerHTML ='<a href="javascript:showCourseID()">$lt{'more'}</a>'; |
document.getElementById('dccidtext').innerHTML ='<a href="javascript:showCourseID()" class="LC_menubuttons_link">$lt{'more'}</a>'; |
return; |
return; |
} |
} |
|
|
Line 1129 sub utilityfunctions {
|
Line 1406 sub utilityfunctions {
|
my $end_page_annotate = |
my $end_page_annotate = |
&Apache::loncommon::end_page({'js_ready' => 1}); |
&Apache::loncommon::end_page({'js_ready' => 1}); |
|
|
|
my $start_page_bookmark = |
|
&Apache::loncommon::start_page('Bookmarks',undef, |
|
{'only_body' => 1, |
|
'js_ready' => 1, |
|
'bgcolor' => '#BBBBBB',}); |
|
|
|
my $end_page_bookmark = |
|
&Apache::loncommon::end_page({'js_ready' => 1}); |
|
|
my $confirm_switch = &mt("Editing requires switching to the resource's home server.").'\n'. |
my $confirm_switch = &mt("Editing requires switching to the resource's home server.").'\n'. |
&mt('Switch server?'); |
&mt('Switch server?'); |
|
|
|
my $esc_url=&escape($currenturl); |
|
my $esc_symb=&escape($currentsymb); |
|
|
return (<<ENDUTILITY) |
return (<<ENDUTILITY) |
|
|
var currentURL="$currenturl"; |
var currentURL=unescape("$esc_url"); |
var reloadURL="$currenturl"; |
var reloadURL=unescape("$esc_url"); |
var currentSymb="$currentsymb"; |
var currentSymb=unescape("$esc_symb"); |
|
|
$dc_popup_cid |
$dc_popup_cid |
|
|
Line 1243 function group_chat(group) {
|
Line 1531 function group_chat(group) {
|
grpchat=window.open(url,winName,'height=320,width=280,resizable=yes,location=no,menubar=no,toolbar=no'); |
grpchat=window.open(url,winName,'height=320,width=280,resizable=yes,location=no,menubar=no,toolbar=no'); |
} |
} |
|
|
|
function edit_bookmarks() { |
|
go(''); |
|
w_BookmarkPal_flag=1; |
|
bookmarkpal=window.open("/adm/bookmarks", |
|
"BookmarkPal", "width=500,height=505,scrollbars=0"); |
|
} |
|
|
function annotate() { |
function annotate() { |
w_Annotator_flag=1; |
w_Annotator_flag=1; |
annotator=window.open('','Annotator','width=365,height=265,scrollbars=0'); |
annotator=window.open('','Annotator','width=365,height=265,scrollbars=0'); |
Line 1256 function annotate() {
|
Line 1551 function annotate() {
|
annotator.document.close(); |
annotator.document.close(); |
} |
} |
|
|
function open_Wishlist_Import(rat) { |
(function (\$) { |
var newWin; |
\$(document).ready(function () { |
if (rat) { |
\$.single=function(a){return function(b){a[0]=b;return a}}(\$([1])); |
newWin = window.open('/adm/wishlist?inhibitmenu=yes&mode=import&rat='+rat, |
/*\@cc_on |
'wishlistImport','scrollbars=1,resizable=1,menubar=0'); |
if (!window.XMLHttpRequest) { |
} |
\$('.LC_hoverable').each(function () { |
else { |
this.attachEvent('onmouseenter', function (evt) { \$.single(evt.srcElement).addClass('hover'); }); |
newWin = window.open('/adm/wishlist?inhibitmenu=yes&mode=import', |
this.attachEvent('onmouseleave', function (evt) { \$.single(evt.srcElement).removeClass('hover'); }); |
'wishlistImport','scrollbars=1,resizable=1,menubar=0'); |
}); |
} |
} |
newWin.focus(); |
\@*/ |
|
}); |
|
}(jQuery)); |
|
|
|
function set_bookmark() { |
|
go(''); |
|
clienttitle=document.title; |
|
clienthref=location.pathname; |
|
w_bmquery_flag=1; |
|
bmquery=window.open('','bmquery','width=365,height=165,scrollbars=0'); |
|
bmquery.document.write( |
|
'$start_page_bookmark' |
|
+'<center><form method="post"' |
|
+' name="newlink" action="/adm/bookmarks" target="bmquery" ' |
|
+'> <table width="340" height="150" ' |
|
+'bgcolor="#FFFFFF" align="center"><tr><td>Link Name:<br /><input ' |
|
+'type="text" name="title" size="45" value="'+clienttitle+'" />' |
|
+'<br />Address:<br /><input type="text" name="address" size="45" ' |
|
+'value="'+clienthref+'" /><br /><center><input type="submit" ' |
|
+'value="Save" /> <input type="button" value="Close" ' |
|
+'onclick="javascript:window.close();" /></center></td>' |
|
+'</tr></table></form></center>' |
|
+'$end_page_bookmark' ); |
|
bmquery.document.close(); |
} |
} |
|
|
ENDUTILITY |
ENDUTILITY |
Line 1685 BEGIN {
|
Line 2003 BEGIN {
|
} elsif ($configline=~/^prim\:/) { |
} elsif ($configline=~/^prim\:/) { |
my @entries = (split(/\:/, $configline))[1..5]; |
my @entries = (split(/\:/, $configline))[1..5]; |
push @primary_menu, \@entries; |
push @primary_menu, \@entries; |
|
} elsif ($configline=~/^primsub\:/) { |
|
my ($parent,@entries) = (split(/\:/, $configline))[1..4]; |
|
push (@{$primary_submenu{$parent}},\@entries); |
} elsif ($configline=~/^scnd\:/) { |
} elsif ($configline=~/^scnd\:/) { |
my @entries = (split(/\:/, $configline))[1..5]; |
my @entries = (split(/\:/, $configline))[1..5]; |
push @secondary_menu, \@entries; |
push @secondary_menu, \@entries; |
|
} elsif ($configline=~/^scndsub\:/) { |
|
my ($parent,@entries) = (split(/\:/, $configline))[1..4]; |
|
push (@{$secondary_submenu{$parent}},\@entries); |
} elsif ($configline) { |
} elsif ($configline) { |
push(@desklines,$configline); |
push(@desklines,$configline); |
} |
} |