version 1.309.2.17, 2010/10/07 15:39:27
|
version 1.309.2.20, 2010/12/02 13:07:08
|
Line 165 sub prep_menuitem {
|
Line 165 sub prep_menuitem {
|
sub primary_menu { |
sub primary_menu { |
my $menu; |
my $menu; |
my $custommenu = &Apache::loncommon::needs_gci_custom(); |
my $custommenu = &Apache::loncommon::needs_gci_custom(); |
|
my $numdc = &Apache::loncommon::check_for_gci_dc(); |
# each element of @primary contains following array: |
# each element of @primary contains following array: |
# (link url, icon path, alt text, link text, condition) |
# (link url, icon path, alt text, link text, condition) |
|
my $public; |
|
if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) |
|
|| (($env{'user.name'} eq '') && ($env{'user.domain'} eq ''))) { |
|
$public = 1; |
|
} |
foreach my $menuitem (@primary_menu) { |
foreach my $menuitem (@primary_menu) { |
# evaluate conditions |
# evaluate conditions |
next if ref($menuitem) ne 'ARRAY'; # |
next if ref($menuitem) ne 'ARRAY'; # |
Line 175 sub primary_menu {
|
Line 181 sub primary_menu {
|
next if $$menuitem[4] eq 'newmsg' # arrived or not |
next if $$menuitem[4] eq 'newmsg' # arrived or not |
&& !&Apache::lonmsg::mynewmail(); # |
&& !&Apache::lonmsg::mynewmail(); # |
next if $$menuitem[4] !~ /public/ ##we've a public user, |
next if $$menuitem[4] !~ /public/ ##we've a public user, |
&& $env{'user.name'} eq 'public' ##who should not see all |
&& $public; ##who should not see all |
&& $env{'user.domain'} eq 'public'; ##links |
##links |
next if $$menuitem[4] eq 'onlypublic'# hide links which are |
next if $$menuitem[4] eq 'onlypublic'# hide links which are |
&& $env{'user.name'} ne 'public' # only visible to public |
&& !$public; # only visible to public |
&& $env{'user.domain'} ne 'public'; # users |
# users |
next if $$menuitem[4] eq 'gci' |
next if $$menuitem[4] eq 'gci' |
&& (!$custommenu || $env{'request.role'} =~ m{^st\./gcitest/}); |
&& (!$custommenu || $env{'request.role'} =~ m{^st\./gcitest/}); |
next if $$menuitem[4] eq 'home' |
next if $$menuitem[4] eq 'home' |
&& (($custommenu) || ($env{'user.domain'} eq 'gcitest')); |
&& (($custommenu) || ($env{'user.domain'} eq 'gcitest') || |
|
(($env{'user.domain'} eq 'gci') && !$numdc)); |
next if $$menuitem[4] eq 'gcitest' |
next if $$menuitem[4] eq 'gcitest' |
&& (($env{'user.domain'} eq 'gci') || ($env{'request.role'} eq 'cm')); |
&& (($env{'user.domain'} eq 'gci') || ($env{'request.role'} eq 'cm')); |
next if $$menuitem[4] eq 'roles' # hide links which are |
next if $$menuitem[4] eq 'roles' # hide links which are |
Line 197 sub primary_menu {
|
Line 204 sub primary_menu {
|
|
|
|
|
if ($$menuitem[3] eq 'Help') { # special treatment for helplink |
if ($$menuitem[3] eq 'Help') { # special treatment for helplink |
$menu .= '<li>'.&Apache::loncommon::top_nav_help('Help').'</li>'; |
if ($public) { |
|
my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
|
my $defdom = &Apache::lonnet::default_login_domain(); |
|
my $to = &Apache::loncommon::build_recipient_list(undef, |
|
'helpdeskmail', |
|
$defdom,$origmail); |
|
if ($to ne '') { |
|
$menu .= &prep_menuitem($menuitem); |
|
} |
|
} else { |
|
$menu .= '<li>'.&Apache::loncommon::top_nav_help('Help').'</li>'; |
|
} |
} else { |
} else { |
my @items = @{$menuitem}; |
my @items = @{$menuitem}; |
$items[0] = 'javascript:'.$menuitem->[0].';'; |
$items[0] = 'javascript:'.$menuitem->[0].';'; |
Line 321 sub gci_secondary_menu {
|
Line 339 sub gci_secondary_menu {
|
foreach my $key (keys(%courses)) { |
foreach my $key (keys(%courses)) { |
$links{$key} = "javascript:switchpage('$key');"; |
$links{$key} = "javascript:switchpage('$key');"; |
if ($env{'request.course.id'} eq $courses{$key}) { |
if ($env{'request.course.id'} eq $courses{$key}) { |
$links{$key} = '/adm/navmaps'; |
if ($env{'environment.remotenavmap'} eq 'on') { |
|
$links{$key} = "javascript:gonav('/adm/navmaps')"; |
|
} else { |
|
$links{$key} = '/adm/navmaps'; |
|
} |
$current = $key; |
$current = $key; |
$links{'managetest'} = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2fmenu'; |
$links{'managetest'} = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2fmenu'; |
} |
} |
Line 330 sub gci_secondary_menu {
|
Line 352 sub gci_secondary_menu {
|
my $tabs; |
my $tabs; |
foreach my $item (@menutabs) { |
foreach my $item (@menutabs) { |
if ($item eq $current) { |
if ($item eq $current) { |
$tabs .= ' <li id="current"><a href="'.$links{$item}.'">'. |
$tabs .= '<li id="current"><a href="'.$links{$item}.'">'. |
$linktext{$item}.'</a></li>'; |
$linktext{$item}.'</a></li>'; |
} else { |
} else { |
$tabs .= ' <li><a href="'.$links{$item}.'">'. |
$tabs .= '<li><a href="'.$links{$item}.'">'. |
$linktext{$item}.'</a></li>'; |
$linktext{$item}.'</a></li>'; |
} |
} |
} |
} |
Line 622 sub innerregister {
|
Line 644 sub innerregister {
|
my @crumbs; |
my @crumbs; |
unless (($forcereg) && ($env{'request.noversionuri'} eq '/adm/navmaps') |
unless (($forcereg) && ($env{'request.noversionuri'} eq '/adm/navmaps') |
&& ($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) { |
&& ($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) { |
|
my $link = "javascript:gopost('/adm/navmaps','')"; |
|
if ($env{'environment.remotenavmap'} eq 'on') { |
|
$link = "javascript:gonav('/adm/navmaps','')" |
|
} |
@crumbs = ({text => Apache::loncommon::course_type() |
@crumbs = ({text => Apache::loncommon::course_type() |
. ' Contents', |
. ' Contents', |
href => "Javascript:gopost('/adm/navmaps','')"}); |
href => $link}); |
} |
} |
if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) { |
if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) { |
push(@crumbs, {text => '...', |
push(@crumbs, {text => '...', |
Line 1443 ENDSCRIPT
|
Line 1469 ENDSCRIPT
|
} |
} |
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) { |
if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) { |
|
my $navlink; |
|
if ($env{'environment.remotenavmap'} eq 'on') { |
|
$navlink = "javascript:gonav('/adm/navmaps')"; |
|
} else { |
|
$navlink = '/adm/navmaps'; |
|
} |
$output .= |
$output .= |
'<div class="LC_Box LC_800Box LC_GCI_Menu">'. |
'<br /><br clear="all" /><div class="LC_Box LC_GCI_Menu">'. |
'<h3 class="LC_hcell">'.&mt('Test Management').'</h3>'. |
'<h3 class="LC_hcell">'.&mt('Management').'</h3>'. |
'<div class="LC_GCI_Menu_left">'. |
'<div class="LC_GCI_Menu_left">'. |
'<dl class="LC_GCI_Menu">'. |
'<dl class="LC_GCI_Menu">'. |
'<dt><a href="/adm/navmaps">'.&mt('Concept Test Contents').'</a></dt>'. |
'<dt><a href="'.$navlink.'">'.&mt('Concept Test Contents').'</a></dt>'. |
'<dd style="background-image:url(\'/res/adm/pages/nav.png\');"><a class="LC_menubuttons_link" href="/adm/navmaps">'.&mt('Display the table of contents for your Concept Test.').'</a></dd>'. |
'<dd style="background-image:url(\'/res/adm/pages/nav.png\');"><a class="LC_menubuttons_link" href="'.$navlink.'">'.&mt('Display the table of contents for your Concept Test.').'</a></dd>'. |
'<dt><a href="/adm/coursedocs">'.&mt('Assemble Concept Test').'</a></dt>'. |
'<dt><a href="/adm/coursedocs">'.&mt('Assemble Concept Test').'</a></dt>'. |
'<dd style="background-image:url(\'/res/adm/pages/docs.png\');"><a class="LC_menubuttons_link" href="/adm/coursedocs">'.&mt('If no students have attempted the Concept Test you will be able to modify it. You can also change the start and end date of the test itself.').'</a></dd>'. |
'<dd style="background-image:url(\'/res/adm/pages/docs.png\');"><a class="LC_menubuttons_link" href="/adm/coursedocs">'.&mt('If no students have attempted the Concept Test you will be able to modify it. You can also change the start and end date of the test itself.').'</a></dd>'. |
'<dt><a href="/adm/createuser">'.&mt('Enrollment and Student Activity').'</a></dt>'. |
'<dt><a href="/adm/createuser">'.&mt('Enrollment and Student Activity').'</a></dt>'. |
Line 1474 ENDSCRIPT
|
Line 1506 ENDSCRIPT
|
$navtext = &mt('Display Test Contents'); |
$navtext = &mt('Display Test Contents'); |
$navdesc = &mt('Display the table of contents for this Concept Test'); |
$navdesc = &mt('Display the table of contents for this Concept Test'); |
} |
} |
|
my $navlink; |
|
if ($env{'environment.remotenavmap'} eq 'on') { |
|
$navlink = "javascript:gonav('/adm/navmaps');" |
|
} else { |
|
$navlink = '/adm/navmaps'; |
|
} |
$output .= |
$output .= |
'<div class="LC_Box LC_800Box LC_GCI_Menu">'. |
'<div class="LC_Box LC_GCI_Menu">'. |
'<h3 class="LC_hcell">'.&mt('Utilities').'</h3>'. |
'<h3 class="LC_hcell">'.&mt('Utilities').'</h3>'. |
'<div class="LC_GCI_Menu_left">'. |
'<div class="LC_GCI_Menu_left">'. |
'<dl class="LC_GCI_Menu">'. |
'<dl class="LC_GCI_Menu">'. |
'<dt><a href="/adm/navmaps">'.$navtext.'</dt>'. |
'<dt><a href="'.$navlink.'">'.$navtext.'</dt>'. |
'<dd style="background-image:url(\'/res/adm/pages/nav.png\');">'. |
'<dd style="background-image:url(\'/res/adm/pages/nav.png\');">'. |
'<a class="LC_menubuttons_link" href="/adm/navmaps">'.$navdesc.'</a></dd></dl></div>'; |
'<a class="LC_menubuttons_link" href="'.$navlink.'">'.$navdesc.'</a></dd></dl></div>'; |
if ($canreq) { |
if ($canreq) { |
$output .= '<div class="LC_GCI_Menu_right">'. |
$output .= '<div class="LC_GCI_Menu_right">'. |
'<dl class="LC_GCI_Menu">'. |
'<dl class="LC_GCI_Menu">'. |
Line 1492 ENDSCRIPT
|
Line 1530 ENDSCRIPT
|
} |
} |
} elsif ($switcher || $canreq) { |
} elsif ($switcher || $canreq) { |
$output .= '<br /><br />'. |
$output .= '<br /><br />'. |
'<div class="LC_Box LC_800Box LC_GCI_Menu">'. |
'<div class="LC_Box LC_GCI_Menu">'. |
'<h3 class="LC_hcell">'.&mt('Utilities').'</h3>'. |
'<h3 class="LC_hcell">'.&mt('Utilities').'</h3>'. |
'<div class="LC_GCI_Menu_left">'. |
'<div class="LC_GCI_Menu_left">'. |
'<dl class="LC_GCI_Menu">'; |
'<dl class="LC_GCI_Menu">'; |
Line 1514 ENDSCRIPT
|
Line 1552 ENDSCRIPT
|
my $queued = &Apache::loncoursequeueadmin::queued_selfenrollment('notitle'); |
my $queued = &Apache::loncoursequeueadmin::queued_selfenrollment('notitle'); |
if ($queued) { |
if ($queued) { |
$output .= |
$output .= |
'<div class="LC_Box LC_800Box">'. |
'<div class="LC_Box">'. |
'<h3 class="LC_hcell">'.&mt('Pending Enrollment Requests').'</h3>'. |
'<h3 class="LC_hcell">'.&mt('Pending Enrollment Requests').'</h3>'. |
$queued. |
$queued. |
'</div>'; |
'</div>'; |