version 1.309.2.4, 2009/12/15 05:25:07
|
version 1.309.2.24, 2010/12/07 04:33:49
|
Line 131 use Apache::lonhtmlcommon();
|
Line 131 use Apache::lonhtmlcommon();
|
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonenc(); |
use Apache::lonenc(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
|
use Apache::loncoursequeueadmin; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
use HTML::Entities(); |
use HTML::Entities(); |
|
|
Line 150 sub prep_menuitem {
|
Line 151 sub prep_menuitem {
|
} else { # textual Link |
} else { # textual Link |
$link = &mt($$menuitem[3]); |
$link = &mt($$menuitem[3]); |
} |
} |
return '<li><a href="'.$$menuitem[0].'">'.$link.'</a></li>'; |
return '<li><a' |
|
# highlighting for new messages |
|
. ( $$menuitem[4] eq 'newmsg' ? ' class="LC_new_message"' : '') |
|
. qq| href="$$menuitem[0]" target="_top">$link</a></li>|; |
} |
} |
|
|
# primary_menu() evaluates @primary_menu and returns XHTML for the menu |
# primary_menu() evaluates @primary_menu and returns XHTML for the menu |
Line 161 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(); |
|
my %allnums = &Apache::loncommon::get_faculty_cnums(); |
# 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,$faculty); |
|
if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) |
|
|| (($env{'user.name'} eq '') && ($env{'user.domain'} eq ''))) { |
|
$public = 1; |
|
} elsif (ref($allnums{$env{'user.domain'}}) eq 'HASH') { |
|
$faculty = 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 171 sub primary_menu {
|
Line 184 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 'ci' |
|
&& (!$custommenu || $env{'request.role'} =~ m{^st\./\w+citest/}); |
|
next if $$menuitem[4] eq 'home' |
|
&& (($custommenu) || ($env{'user.domain'} =~ /^\w+citest$/) || |
|
($faculty && !$numdc)); |
|
next if $$menuitem[4] eq 'citest' |
|
&& ($faculty || ($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 |
&& $custommenu; # not visible when GCI |
&& $custommenu; # not visible when GCI |
next if $$menuitem[4] eq 'courses' # tabbed interface in use |
next if $$menuitem[4] eq 'courses' # tabbed interface in use |
Line 187 sub primary_menu {
|
Line 207 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}; |
$menu .= &prep_menuitem($menuitem); |
$items[0] = 'javascript:'.$menuitem->[0].';'; |
|
$menu .= &prep_menuitem(\@items); |
|
} |
} |
} |
} |
|
|
Line 212 sub secondary_menu {
|
Line 241 sub secondary_menu {
|
$env{'user.domain'}, $env{'user.name'}, |
$env{'user.domain'}, $env{'user.name'}, |
$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'}); |
|
my $custommenu = &Apache::loncommon::needs_gci_custom(); |
|
my $numdc = &Apache::loncommon::check_for_gci_dc(); |
|
my $role = $env{'request.role'}; |
foreach my $menuitem (@secondary_menu) { |
foreach my $menuitem (@secondary_menu) { |
# evaluate conditions |
# evaluate conditions |
next if ref($menuitem) ne 'ARRAY'; |
next if ref($menuitem) ne 'ARRAY'; |
next if $$menuitem[4] ne 'always' |
next if $$menuitem[4] eq 'showmenu' |
|
&& ($custommenu || (!$numdc && $role eq 'cm')); |
|
next if $$menuitem[4] ne 'showmenu' |
|
&& $$menuitem[4] ne 'author' |
&& !$env{'request.course.id'}; |
&& !$env{'request.course.id'}; |
next if $$menuitem[4] eq 'showreturn' |
next if $$menuitem[4] eq 'showreturn' |
&& !$showlink |
&& !$showlink |
Line 237 sub secondary_menu {
|
Line 272 sub secondary_menu {
|
next if $$menuitem[4] =~ /showgroups$/ |
next if $$menuitem[4] =~ /showgroups$/ |
&& !$canviewgrps |
&& !$canviewgrps |
&& !%groups; |
&& !%groups; |
|
next if $$menuitem[4] eq 'showroles' |
if ($$menuitem[3] eq 'Roles' && $env{'request.course.id'}) { |
&& ($custommenu || !$numdc || ($numdc && $env{'request.noversionuri'} eq '/adm/roles')); |
|
if ($$menuitem[3] eq 'Roles' && $env{'request.course.id'} && !$custommenu) { |
# 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'}, |
Line 283 sub secondary_menu {
|
Line 319 sub secondary_menu {
|
} |
} |
|
|
sub gci_secondary_menu { |
sub gci_secondary_menu { |
my %courses = ( |
my %courses; |
'review' => 'gci_9615072b469884921gcil1', |
my $inventory; |
'submit' => 'gci_1H96711d710194bfegcil1', |
if ($env{'user.domain'} =~ /^(\w+ci)test$/) { |
); |
$inventory = $1; |
|
} else { |
|
$inventory = $env{'user.domain'}; |
|
} |
|
my %allnums = &Apache::loncommon::get_faculty_cnums(); |
|
if (($inventory ne '') && (ref($allnums{$inventory}) eq 'HASH')) { |
|
foreach my $key (keys(%{$allnums{$inventory}})) { |
|
$courses{$key} = $inventory.'_'.$allnums{$inventory}->{$key}; |
|
} |
|
} |
|
|
my %linktext = ( |
my %linktext = ( |
'review' => 'Review Questions', |
'review' => 'Review Questions', |
'submit' => 'Submit Questions', |
'submit' => 'Submit Questions', |
'managetest' => 'Manage Tests', |
'managetest' => 'Manage Tests', |
|
'tutorial' => 'Tutorials', |
); |
); |
my %links = ( |
my (%links,@menutabs,$current,%can_request,%request_domains); |
'managetest' => '/adm/menu', |
my %concepttests = &Apache::loncommon::existing_gcitest_courses('cc'); |
); |
my $canreq = &Apache::lonnet::check_can_request($env{'user.domain'}.'test', |
my $current = 'managetest'; |
\%can_request,\%request_domains); |
|
if (($canreq) || (keys(%concepttests) > 0)) { |
|
%links = ( |
|
'managetest' => '/adm/menu', |
|
); |
|
$current = 'managetest'; |
|
} |
|
if ($env{'form.destinationurl'} eq '/adm/ci_info') { |
|
undef($current); |
|
} |
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'; |
if (($canreq) || (keys(%concepttests) > 0) { |
|
$links{'managetest'} = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2fmenu'; |
|
} |
} |
} |
} |
} |
my @menutabs = ('review','submit','managetest'); |
my @posstabs = ('review','submit','managetest','tutorial'); |
my $tabs; |
my $tabs; |
foreach my $item (@menutabs) { |
foreach my $item (@posstabs) { |
|
next if ($links{$item} eq ''); |
|
push(@menutabs,$item); |
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 511 ENDINLINEMENU
|
Line 575 ENDINLINEMENU
|
} |
} |
|
|
sub show_return_link { |
sub show_return_link { |
|
return unless ($env{'request.course.id'}); |
|
if (($env{'request.noversionuri'} =~ m{^/adm/(viewclasslist|navmaps)($|\?)}) |
|
|| ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) { |
|
return if ($env{'form.register'}); |
|
} |
return (($env{'request.noversionuri'}=~m{^/(res|public)/} && |
return (($env{'request.noversionuri'}=~m{^/(res|public)/} && |
$env{'request.symb'} eq '') |
$env{'request.symb'} eq '') |
|| |
|| |
Line 519 sub show_return_link {
|
Line 588 sub show_return_link {
|
(($env{'request.noversionuri'}=~/^\/adm\//) && |
(($env{'request.noversionuri'}=~/^\/adm\//) && |
($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) && |
($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) && |
($env{'request.noversionuri'}!~ |
($env{'request.noversionuri'}!~ |
m[^/adm/.*/(smppg|bulletinboard|aboutme)($|\?)]) |
m[^/adm/.*/(smppg|bulletinboard)($|\?)]) |
)); |
)); |
} |
} |
|
|
Line 592 sub innerregister {
|
Line 661 sub innerregister {
|
} else { |
} else { |
$contentstext = &mt('Course Contents'); |
$contentstext = &mt('Course Contents'); |
} |
} |
my @crumbs = ({text => $contentstext, |
my @crumbs; |
href => "Javascript:gonav('/adm/navmaps')"}); |
unless (($forcereg) && ($env{'request.noversionuri'} eq '/adm/navmaps') |
|
&& ($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() |
|
. ' Contents', |
|
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 => '...', |
no_mt => 1}); |
no_mt => 1}); |
Line 838 $menuitems.="Make notes and annotations
|
Line 915 $menuitems.="Make notes and annotations
|
"&go('/adm/requestcourse')&Course requests\n"; |
"&go('/adm/requestcourse')&Course requests\n"; |
} |
} |
} |
} |
unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) { |
unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|portfolio)(\?|$)/) { |
if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/})) { |
if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/})) { |
$menuitems.=(<<ENDREALRES); |
$menuitems.=(<<ENDREALRES); |
s&6&3&catalog.gif&catalog[_2]&info[_1]&catalog_info()&Show Metadata |
s&6&3&catalog.gif&catalog[_2]&info[_1]&catalog_info()&Show Metadata |
Line 878 ENDMENUITEMS
|
Line 955 ENDMENUITEMS
|
my $addremote=0; |
my $addremote=0; |
foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} } |
foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} } |
my $inlinebuttons=''; |
my $inlinebuttons=''; |
|
|
if ($addremote) { |
if ($addremote) { |
|
|
#SD START (work in progress!) |
|
Apache::lonhtmlcommon::clear_breadcrumb_tools(); |
Apache::lonhtmlcommon::clear_breadcrumb_tools(); |
# Arrows for navigation |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'A', $inlineremote[21] ); |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'A', $inlineremote[23] ); |
|
if(hidden_button_check() ne 'yes'){ |
|
# notes |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[93]); |
|
# bookmark |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[91]); |
|
# evaluate |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[81]); |
|
# feedback |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[82]); |
|
# print |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[83]); |
|
# metadata |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[63]); |
|
|
|
# ? |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[61]); |
|
# ? |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[71]); |
|
# ? |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[72]); |
|
# ? |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[73]); |
|
# ? |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[92]); |
|
|
|
|
Apache::lonhtmlcommon::add_breadcrumb_tool( |
|
'navigation', @inlineremote[21,23]); |
|
if(hidden_button_check() ne 'yes') { |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( |
|
'tools', @inlineremote[93,91,81,82,83]); |
|
|
|
#publish button in construction space |
|
if ($env{'request.state'} eq 'construct'){ |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( |
|
'advtools', @inlineremote[63]); |
|
}else{ |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( |
|
'tools', @inlineremote[63]); |
|
} |
|
|
|
unless ($env{'request.noversionuri'}=~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) { |
|
Apache::lonhtmlcommon::add_breadcrumb_tool( |
|
'advtools', @inlineremote[61,71,72,73,92]); |
|
} |
} |
} |
|
|
#SD END |
|
# # Registered, textual output |
# # Registered, textual output |
# if ( $env{'environment.icons'} eq 'iconsonly' ) { |
# if ( $env{'environment.icons'} eq 'iconsonly' ) { |
# $inlinebuttons = (<<ENDARROWSINLINE); |
# $inlinebuttons = (<<ENDARROWSINLINE); |
Line 1373 sub openmenu {
|
Line 1441 sub openmenu {
|
} |
} |
|
|
sub inlinemenu { |
sub inlinemenu { |
my ($context,$switcher) = @_; |
my ($context) = @_; |
undef(@inlineremote); |
undef(@inlineremote); |
undef(%category_members); |
undef(%category_members); |
my $output; |
my $output; |
if ($context eq 'gcicustom') { |
if ($context eq 'gcicustom') { |
my $createtext = &mt('Create Concept Test'); |
my (%can_request,%request_domains,$canreq,$createtext); |
if ($switcher) { |
my $role = 'st'; |
$createtext = &mt('Create New Test'); |
my $custommenu = &Apache::loncommon::needs_gci_custom(); |
} |
if ($custommenu) { |
$output='<table><tr>'. |
$role = 'cc'; |
'<td class="LC_mainmenu_col_fieldset">'. |
} |
'<div class="LC_Box LC_400Box">'. |
my %courses = &Apache::loncommon::existing_gcitest_courses($role); |
'<h3 class="LC_hcell">'.&mt('Utilities').'</h3>'. |
my $numcourses = keys(%courses); |
'<table><tr><td align="left"><a href="javascript:switchpage('."'createtest'".');"><img alt="choose role" src="/res/adm/pages/rcrs.png" align="left" class="LC_icon" /></a></td><td class="LC_menubuttons_text" colspan="3"><a class="LC_menubuttons_link" href="javascript:switchpage('."'createtest'".');"><span class="LC_menubuttons_inline_text">'.$createtext.'</span></a></td></tr>'; |
my ($switcher_js,$switcher); |
if ($switcher) { |
my $formname = 'testpicker'; |
$output .= '<tr><td align="left"><a href="javascript:courseswitcher('."'icon'".');"><img alt="choose role" src="/res/adm/pages/roles.png" align="left" class="LC_icon" /></a></td><td class="LC_menubuttons_text" colspan="2">'.$switcher.'</td></tr>'; |
if ($numcourses > 0) { |
|
$switcher = &Apache::loncommon::gcitest_switcher($role,$formname,%courses); |
|
my $current; |
|
my $cid = $env{'request.course.id'}; |
|
if ($cid) { |
|
$current = $role.'./'.$env{'course.'.$cid.'.domain'}. |
|
'/'.$env{'course.'.$cid.'.num'}; |
|
} |
|
$switcher_js = &Apache::loncommon::gcitest_switcher_js($current,$numcourses,$formname); |
|
if ($switcher_js) { |
|
$switcher_js= <<"ENDSCRIPT"; |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
|
|
$switcher_js |
|
|
|
// ]]> |
|
</script> |
|
|
|
ENDSCRIPT |
|
} |
|
$switcher = $switcher_js.$switcher; |
} |
} |
$output .= '<tr><td align="left"><a href="javascript:go('."'/adm/communicate'".');"><img alt="communication" src="/res/adm/pages/com.png" align="left" class="LC_icon" /></a></td><td class="LC_menubuttons_text" colspan="3"><a class="LC_menubuttons_link" href="javascript:go('."'/adm/communicate'".');"><span class="LC_menubuttons_inline_text">'.&mt('Send/Display Messages').'</span></a></td></tr></table></div></td>'; |
if ($env{'user.domain'} !~ /^\w+citest$/) { |
if (($env{'request.course.id'}) && |
$canreq = |
(&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) { |
&Apache::lonnet::check_can_request($env{'user.domain'}.'test',\%can_request,\%request_domains); |
$output.= '<td class="LC_mainmenu_col_fieldset">'. |
$createtext = &mt('Create Concept Test'); |
'<div class="LC_Box LC_400Box">'. |
if ($numcourses) { |
'<h3 class="LC_hcell">'.&mt('Test Management').'</h3>'. |
$createtext = &mt('Create New Test'); |
'<table><tr><td align="left"><a href="javascript:gonav('."'/adm/navmaps'".');"><img alt="course contents" src="/res/adm/pages/nav.png" align="left" class="LC_icon" /></a></td><td class="LC_menubuttons_text" colspan="3"><a class="LC_menubuttons_link" href="javascript:gonav('."'/adm/navmaps'".');"><span class="LC_menubuttons_inline_text">Concept Test Contents</span></a></td></tr>'."\n". |
} |
'<tr><td align="left"><a href="javascript:go('."'/adm/coursedocs'".');"><img alt="assemble test" src="/res/adm/pages/docs.png" align="left" class="LC_icon" /></a></td><td class="LC_menubuttons_text" colspan="3"><a class="LC_menubuttons_link" href="javascript:go('."'/adm/coursedocs'".');"><span class="LC_menubuttons_inline_text">Assemble Concept Test</span></a></td></tr>'."\n". |
} |
'<tr><td align="left"><a href="javascript:go('."'/adm/createuser'".');"><img alt="user privs" src="/res/adm/pages/cprv.png" align="left" class="LC_icon" /></a></td><td class="LC_menubuttons_text" colspan="3"><a class="LC_menubuttons_link" href="javascript:go('."'/adm/createuser'".');"><span class="LC_menubuttons_inline_text">'.&mt('Manage Enrollment').'</span></a></td></tr>'."\n". |
if ($env{'request.course.id'}) { |
'<tr><td align="left"><a href="javascript:go('."'/adm/whatsnew'".');"><img alt="what is new" src="/res/adm/pages/new.png" align="left" class="LC_icon" /></a></td><td class="LC_menubuttons_text" colspan="3"><a class="LC_menubuttons_link" href="javascript:go('."'/adm/whatsnew'".');"><span class="LC_menubuttons_inline_text">'.&mt("What's New?").'</span></a></td></tr></table></div></td>'; |
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 .= |
|
'<br /><br clear="all" /><div class="LC_Box LC_GCI_Menu">'. |
|
'<h3 class="LC_hcell">'.&mt('Management').'</h3>'. |
|
'<div class="LC_GCI_Menu_left">'. |
|
'<dl class="LC_GCI_Menu">'. |
|
'<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="'.$navlink.'">'.&mt('Display the table of contents for your Concept Test.').'</a></dd>'. |
|
'<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>'. |
|
'<dt><a href="/adm/createuser">'.&mt('Enrollment and Student Activity').'</a></dt>'. |
|
'<dd style="background-image:url(\'/res/adm/pages/cprv.png\');"><a class="LC_menubuttons_link" href="/adm/createuser">'.&mt('Display or download a course roster, and view information about completion status and last login. You can also add new students, or change access dates for existing students.').'</a></dd></dl></div>'. |
|
'<div class="LC_GCI_Menu_right"><dl class="LC_GCI_Menu">'. |
|
'<dt><a href="/adm/whatsnew">'.&mt("What's New?").'</a></dt>'. |
|
'<dd style="background-image:url(\'/res/adm/pages/new.png\');"><a class="LC_menubuttons_link" href="/adm/whatsnew">'.&mt('View information about changes in your Concept Test course.').'</a></dd>'. |
|
'<dt><a href="/adm/printout">'.&mt('Prepare Printable Concept Test').'</a></dt>'. |
|
'<dd style="background-image:url(\'/res/adm/pages/prnt.png\');"><a class="LC_menubuttons_link" href="/adm/printout">'.&mt('Create a PDF which you can send to a printer to create a hardcopy of the Concept Test.').'</a></dd>'. |
|
'<dt><a href="/adm/statistics">'.&mt('Concept Test Statistics').'</a></dt>'. |
|
'<dd style="background-image:url(\'/res/adm/pages/chrt.png\');"><a class="LC_menubuttons_link" href="/adm/statistics">'.&mt('After the closing date of the Concept Test you can view and download statistics for the test, as well as anonymized submission data.').'</a></dd>'; |
|
if ($canreq) { |
|
$output .= '<dt><a href="javascript:switchpage('."'createtest'".');">'.&mt('Create New Test').'</a></dt>'. |
|
'<dd style="background-image:url(\'/res/adm/pages/rcrs.png\');"><a class="LC_menubuttons_link" href="javascript:switchpage('."'createtest'".');">'. |
|
&mt('Create a new Concept Test Course Container. Choose GCI questions to include in the test and upload a student roster.').'</a></dd>'; |
|
} |
|
$output .= '</dl></div></div><br clear="all"/>'; |
|
} else { |
|
my $navtext = &mt('Table of Contents'); |
|
my $navdesc = &mt('Display Table of Contents for Geoscience Concept Inventory'); |
|
if ($env{'request.role.domain'} =~ /^\w+citest$/) { |
|
$navtext = &mt('Display Test Contents'); |
|
$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 .= |
|
'<div class="LC_Box LC_GCI_Menu">'. |
|
'<h3 class="LC_hcell">'.&mt('Utilities').'</h3>'. |
|
'<div class="LC_GCI_Menu_left">'. |
|
'<dl class="LC_GCI_Menu">'. |
|
'<dt><a href="'.$navlink.'">'.$navtext.'</dt>'. |
|
'<dd style="background-image:url(\'/res/adm/pages/nav.png\');">'. |
|
'<a class="LC_menubuttons_link" href="'.$navlink.'">'.$navdesc.'</a></dd></dl></div>'; |
|
if ($canreq) { |
|
$output .= '<div class="LC_GCI_Menu_right">'. |
|
'<dl class="LC_GCI_Menu">'. |
|
'<dt><a href="javascript:switchpage('."'createtest'".');">'.$createtext.'</a></dt>'. |
|
'<dd style="background-image:url(\'/res/adm/pages/rcrs.png\');"><a class="LC_menubuttons_link" href="javascript:switchpage('."'createtest'".');">'.&mt('Create a new Concept Test Course Container').'</a>. '.&mt('Choose GCI questions to include in the test and upload a student roster.').'</dd></dl></div>'; |
|
} |
|
$output .= '</div><br clear="all"/>'; |
|
} |
|
} elsif ($switcher || $canreq) { |
|
$output .= '<br /><br />'. |
|
'<div class="LC_Box LC_GCI_Menu">'. |
|
'<h3 class="LC_hcell">'.&mt('Utilities').'</h3>'. |
|
'<div class="LC_GCI_Menu_left">'. |
|
'<dl class="LC_GCI_Menu">'; |
|
if ($canreq) { |
|
$output .= '<dt><a href="javascript:switchpage('."'createtest'".');">'.$createtext.'</a></dt>'. |
|
'<dd style="background-image:url(\'/res/adm/pages/rcrs.png\');"><a class="LC_menubuttons_link" href="javascript:switchpage('."'createtest'".');">'.&mt('Create a new Concept Test Course Container. Choose GCI questions to include in the test and upload a student roster.').'</a></dd></dl></div>'; |
|
if ($switcher) { |
|
$output .= '<div class="LC_GCI_Menu_right">'. |
|
'<dl class="LC_GCI_Menu">'; |
|
} |
|
} |
|
if ($switcher) { |
|
$output .= '<dt>'.&mt('Select Concept Test').'</dt>'. |
|
'<dd style="background-image:url(\'/res/adm/pages/roles.png\');">'.$switcher.'<br /><br /></dd></dl></div>'; |
|
} |
|
$output .= '</div><br clear="all"/>'; |
|
} |
|
} elsif ($context eq 'gcinorole') { |
|
my $queued = &Apache::loncoursequeueadmin::queued_selfenrollment('notitle'); |
|
if ($queued) { |
|
$output .= |
|
'<div class="LC_Box">'. |
|
'<h3 class="LC_hcell">'.&mt('Pending Enrollment Requests').'</h3>'. |
|
$queued. |
|
'</div>'; |
} |
} |
$output.='</tr></table>'; |
|
} else { |
} else { |
# calling rawconfig with "1" will evaluate mydesk.tab, |
# calling rawconfig with "1" will evaluate mydesk.tab, |
# even if there is no active remote control |
# even if there is no active remote control |
Line 1733 sub utilityfunctions {
|
Line 1908 sub utilityfunctions {
|
|
|
my $gcimenujs; |
my $gcimenujs; |
if ($custommenu) { |
if ($custommenu) { |
my %concepttests = &Apache::loncommon::existing_gcitest_courses(); |
my %concepttests = &Apache::loncommon::existing_gcitest_courses('cc'); |
my $managetesturl = '/adm/menu'; |
my (@calls,%switchpage_call,%canrequest,%request_domains); |
my $createtesturl = '/adm/requestcourse'; |
my $canreq = &Apache::lonnet::check_can_request($env{'user.domain'}.'test', |
|
\%canrequest,\%request_domains); |
|
if ($canreq) { |
|
foreach my $call ('createtest','managetest') { |
|
push(@calls,$call); |
|
} |
|
$switchpage_call{'managetest'} = '/adm/menu'; |
|
$switchpage_call{'createtest'} = '/adm/requestcourse'; |
|
if ($env{'request.course.id'}) { |
|
$switchpage_call{'createtest'} = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2frequestcourse'; |
|
} |
|
} |
if (($env{'request.course.id'}) && |
if (($env{'request.course.id'}) && |
($env{'course.'.$env{'request.course.id'}.'.domain'} eq 'gci')) { |
($env{'course.'.$env{'request.course.id'}.'.domain'} !~ /^\w+citest$/)) { |
my @items = keys(%concepttests); |
my @items = keys(%concepttests); |
if (@items== 1) { |
if (@items==1) { |
my $newrole = $items[0]; |
my $newrole = $items[0]; |
$newrole =~ s{_}{/}; |
$newrole =~ s{_}{/}; |
$managetesturl = '/adm/roles?selectrole=1&cc./'.$newrole.'=1'; |
$switchpage_call{'managetest'} = '/adm/roles?selectrole=1&cc./'.$newrole.'=1'; |
} else { |
} else { |
$managetesturl = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2fmenu'; |
$switchpage_call{'managetest'} = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2fmenu'; |
} |
} |
} |
} |
if ($env{'request.course.id'}) { |
my %allnums = &Apache::loncommon::get_faculty_cnums(); |
$createtesturl = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2frequestcourse'; |
my $udom = $env{'user.domain'}; |
|
if (ref($allnums{$udom}) eq 'HASH') { |
|
foreach my $key (keys(%{$allnums{$udom}})) { |
|
$switchpage_call{$key} = '/adm/roles?selectrole=1&'. |
|
'st./'.$udom.'/'.$allnums{$udom}->{$key}.'=1'; |
|
push(@calls,$key); |
|
} |
} |
} |
$gcimenujs = <<"ENDCUSTOM"; |
if (@calls > 0) { |
|
$gcimenujs = ' |
function switchpage(caller) { |
function switchpage(caller) { |
if (caller == 'review') { |
'; |
document.location.href = '/adm/roles?selectrole=1&st./gci/9615072b469884921gcil1=1'; |
foreach my $call (@calls) { |
} |
$gcimenujs .= " |
if (caller == 'submit') { |
if (caller == '$call') { |
document.location.href = '/adm/roles?selectrole=1&st./gci/1H96711d710194bfegcil1=1'; |
document.location.href = '$switchpage_call{$call}'; |
} |
}"; |
if (caller == 'createtest') { |
} |
document.location.href = '$createtesturl'; |
$gcimenujs .= ' |
} |
|
if (caller == 'managetest') { |
|
document.location.href = '$managetesturl'; |
|
} |
|
return; |
return; |
} |
} |
|
'; |
ENDCUSTOM |
} |
} |
} |
|
|
my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0])); |
my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0])); |
Line 1828 function go(url) {
|
Line 2016 function go(url) {
|
} |
} |
} |
} |
|
|
function gotop(url) { |
|
if (url!='' && url!= null) { |
|
top.location.href = url; |
|
} |
|
} |
|
|
|
function gopost(url,postdata) { |
function gopost(url,postdata) { |
if (url!='') { |
if (url!='') { |
this.document.server.action=url; |
this.document.server.action=url; |
Line 2010 sub hidden_button_check {
|
Line 2192 sub hidden_button_check {
|
return; |
return; |
} |
} |
if ($env{'request.role.adv'}) { |
if ($env{'request.role.adv'}) { |
return; |
unless (&Apache::loncommon::needs_gci_custom()) { |
|
return; |
|
} |
} |
} |
my $buttonshide = &Apache::lonnet::EXT('resource.0.buttonshide'); |
my $buttonshide = &Apache::lonnet::EXT('resource.0.buttonshide'); |
return $buttonshide; |
return $buttonshide; |