version 1.309.2.13, 2010/02/25 04:21:01
|
version 1.315, 2010/03/03 21:33:15
|
Line 42 Coordinates the response to clicking an
|
Line 42 Coordinates the response to clicking an
|
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. |
|
|
|
=head1 GLOBAL VARIABLES |
|
|
|
=over |
|
|
|
=item @desklines |
|
|
|
Each element of this array contains a line of mydesk.tab that doesn't start with |
|
cat, prim or scnd. |
|
It gets filled in the BEGIN block of this module. |
|
|
|
=item %category_names |
|
|
|
The keys of this hash are the abbreviations used in mydesk.tab in those lines that |
|
start with cat, the values are strings representing titles. |
|
It gets filled in the BEGIN block of this module. |
|
|
|
=item %category_members |
|
|
|
TODO |
|
|
|
=item %category_positions |
|
|
|
The keys of this hash are the abbreviations used in mydesk.tab in those lines that |
|
start with cat, its values are position vectors (column, row). |
|
It gets filled in the BEGIN block of this module. |
|
|
|
=item $readdesk |
|
|
|
Indicates that mydesk.tab has been read. |
|
It is set to 'done' in the BEGIN block of this module. |
|
|
|
=item @primary_menu |
|
|
|
The elements of this array reference arrays that are made up of the components |
|
of those lines of mydesk.tab that start with prim. |
|
It is used by primary_menu() to generate the corresponding menu. |
|
It gets filled in the BEGIN block of this module. |
|
|
|
=item @secondary_menu |
|
|
|
The elements of this array reference arrays that are made up of the components |
|
of those lines of mydesk.tab that start with scnd. |
|
It is used by secondary_menu() to generate the corresponding menu. |
|
It gets filled in the BEGIN block of this module. |
|
|
|
=back |
|
|
=head1 SUBROUTINES |
=head1 SUBROUTINES |
|
|
=over |
=over |
|
|
Little texts |
=item prep_menuitems(\@menuitem) |
|
|
=item initlittle() |
This routine wraps a menuitem in proper HTML. It is used by primary_menu() and |
|
secondary_menu(). |
|
|
=item menubuttons() |
=item primary_menu() |
|
|
This gets called at the top of the body section |
This routine evaluates @primary_menu and returns XHTML for the menu |
|
that contains following links: About, Message, Roles, Help, Logout |
|
@primary_menu is filled within the BEGIN block of this module with |
|
entries from mydesk.tab |
|
|
|
=item secondary_menu() |
|
|
|
Same as primary_menu() but operates on @secondary_menu. |
|
|
=item show_return_link() |
=item show_return_link() |
|
|
Line 131 use Apache::lonhtmlcommon();
|
Line 186 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 151 sub prep_menuitem {
|
Line 205 sub prep_menuitem {
|
} else { # textual Link |
} else { # textual Link |
$link = &mt($$menuitem[3]); |
$link = &mt($$menuitem[3]); |
} |
} |
|
if($$menuitem[4] eq 'newmsg'){ #special style for New Messages |
|
return '<li><a href="'.$$menuitem[0].'"><span class="LC_new_message">'.$link.'</span></a></li>'; |
|
} |
return '<li><a href="'.$$menuitem[0].'">'.$link.'</a></li>'; |
return '<li><a href="'.$$menuitem[0].'">'.$link.'</a></li>'; |
} |
} |
|
|
Line 161 sub prep_menuitem {
|
Line 218 sub prep_menuitem {
|
# entries from mydesk.tab |
# entries from mydesk.tab |
sub primary_menu { |
sub primary_menu { |
my $menu; |
my $menu; |
my $custommenu = &Apache::loncommon::needs_gci_custom(); |
|
# 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) |
foreach my $menuitem (@primary_menu) { |
foreach my $menuitem (@primary_menu) { |
Line 177 sub primary_menu {
|
Line 233 sub primary_menu {
|
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 |
&& $env{'user.name'} ne 'public' # only visible to public |
&& $env{'user.domain'} ne 'public'; # users |
&& $env{'user.domain'} ne 'public'; # users |
next if $$menuitem[4] eq 'roles' # hide links which are |
|
&& $custommenu; # not visible when GCI |
|
next if $$menuitem[4] eq 'courses' # tabbed interface in use |
|
&& $custommenu; # |
|
next if $$menuitem[4] eq 'roles' ##show links depending on |
next if $$menuitem[4] eq 'roles' ##show links depending on |
&& &Apache::loncommon::show_course(); ##term 'Courses' or |
&& &Apache::loncommon::show_course(); ##term 'Courses' or |
next if $$menuitem[4] eq 'courses' ##'Roles' wanted |
next if $$menuitem[4] eq 'courses' ##'Roles' wanted |
Line 283 sub secondary_menu {
|
Line 335 sub secondary_menu {
|
return "<ul id=\"LC_secondary_menu\">$menu</ul>"; |
return "<ul id=\"LC_secondary_menu\">$menu</ul>"; |
} |
} |
|
|
sub gci_secondary_menu { |
|
my %courses = ( |
|
'review' => 'gci_9615072b469884921gcil1', |
|
'submit' => 'gci_1H96711d710194bfegcil1', |
|
); |
|
my %linktext = ( |
|
'review' => 'Review Questions', |
|
'submit' => 'Submit Questions', |
|
'managetest' => 'Manage Tests', |
|
); |
|
my %links = ( |
|
'managetest' => '/adm/menu', |
|
); |
|
my $current = 'managetest'; |
|
if ($env{'form.destinationurl'} eq '/adm/gci_info') { |
|
undef($current); |
|
} |
|
foreach my $key (keys(%courses)) { |
|
$links{$key} = "javascript:switchpage('$key');"; |
|
if ($env{'request.course.id'} eq $courses{$key}) { |
|
$links{$key} = '/adm/navmaps'; |
|
$current = $key; |
|
$links{'managetest'} = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2fmenu'; |
|
} |
|
} |
|
my @menutabs = ('review','submit','managetest'); |
|
my $tabs; |
|
foreach my $item (@menutabs) { |
|
if ($item eq $current) { |
|
$tabs .= ' <li id="current"><a href="'.$links{$item}.'">'. |
|
$linktext{$item}.'</a></li>'; |
|
} else { |
|
$tabs .= ' <li><a href="'.$links{$item}.'">'. |
|
$linktext{$item}.'</a></li>'; |
|
} |
|
} |
|
return '<div id="gciheader">'. |
|
'<ul>'.$tabs.'</ul></div><br />'; |
|
} |
|
|
|
# |
|
# This routine returns a translated hash for the menu items in the top inline menu row |
|
# Probably should be in mydesk.tab |
|
|
|
#SD this sub is deprecated - don't use it |
|
sub initlittle { |
|
return &Apache::lonlocal::texthash('ret' => 'Return to Last Location', |
|
'nav' => 'Course Contents', |
|
'main' => 'Main Menu', |
|
'roles' => (&Apache::loncommon::show_course()? |
|
'Courses':'Roles'), |
|
'other' => 'Other Roles', |
|
'docs' => 'Edit Course', |
|
'exit' => 'Logout', |
|
'login' => 'Log In', |
|
'launch' => 'Launch Remote Control', |
|
'groups' => 'Groups', |
|
'gdoc' => 'Community Documents', |
|
); |
|
} |
|
|
|
#SD this sub is deprecated - don't use it |
|
#SD functionality is covered by new loncommon::bodytag and primary_menu(), secondary_menu() |
|
sub menubuttons { |
|
my $forcereg=shift; |
|
my $titletable=shift; |
|
# |
|
# Early-out for pages that should not have a menu, triggered by query string "inhibitmenu=yes" |
|
# |
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
|
['inhibitmenu']); |
|
if (($env{'form.inhibitmenu'} eq 'yes') || |
|
($ENV{'REQUEST_URI'} eq '/adm/logout')) { return ''; } |
|
|
|
if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { return ''; } |
|
|
|
my %lt=&initlittle(); |
|
my $navmaps=''; |
|
my $reloadlink=''; |
|
my $docs=''; |
|
my $groups=''; |
|
my $roles='<a href="/adm/roles" target="_top">'.$lt{'roles'}.'</a>'; |
|
my $role_selector; |
|
my $showgroups=0; |
|
my ($cnum,$cdom); |
|
# |
|
# if the URL is hidden, symbs and the non-versioned version of the URL would be encrypted |
|
# |
|
my $escurl=&escape(&Apache::lonenc::check_encrypt($env{'request.noversionuri'})); |
|
my $escsymb=&escape(&Apache::lonenc::check_encrypt($env{'request.symb'})); |
|
|
|
my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif"); |
|
$logo = '<a href="/adm/about.html"><img src="'. |
|
$logo.'" alt="LON-CAPA Logo" class="LC_noBorder" /></a>'; |
|
|
|
if ($env{'request.state'} eq 'construct') { |
|
# |
|
# We are in construction space |
|
# |
|
if (($env{'request.noversionuri'} eq '') || (!defined($env{'request.noversionuri'}))) { |
|
my $returnurl = $env{'request.filename'}; |
|
$returnurl =~ s:^/home/([^/]+)/public_html/(.*)$:/priv/$1/$2:; |
|
$escurl = &escape($returnurl); |
|
} |
|
} |
|
if ($env{'request.course.id'}) { |
|
# |
|
# We are in a course |
|
# |
|
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my %coursegroups; |
|
my $viewgrps_permission = |
|
&Apache::lonnet::allowed('vcg',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')); |
|
if (!$viewgrps_permission) { |
|
%coursegroups = &Apache::lonnet::get_active_groups($env{'user.domain'},$env{'user.name'},$cdom,$cnum); |
|
} |
|
if ((keys(%coursegroups) > 0) || ($viewgrps_permission)) { |
|
$showgroups = 1; |
|
} |
|
$role_selector = &roles_selector($cdom,$cnum); |
|
if ($role_selector) { |
|
$roles = '<span class="LC_nobreak">'.$role_selector.' <a href="/adm/roles" target="_top">'.$lt{'other'}.'</a></span>'; |
|
} |
|
} |
|
|
|
if ($env{'environment.remote'} eq 'off') { |
|
# Remote Control is switched off |
|
# figure out colors |
|
my %lt=&initlittle(); |
|
|
|
my $domain=&Apache::loncommon::determinedomain(); |
|
my $function=&Apache::loncommon::get_users_function(); |
|
my $link=&Apache::loncommon::designparm($function.'.link',$domain); |
|
my $alink=&Apache::loncommon::designparm($function.'.alink',$domain); |
|
my $vlink=&Apache::loncommon::designparm($function.'.vlink',$domain); |
|
my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain); |
|
|
|
if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') { |
|
return (<<ENDINLINEMENU); |
|
<ol class="LC_primary_menu LC_right"> |
|
<li>$logo</li> |
|
<li><a href="/adm/roles" target="_top">$lt{'login'}</a></li> |
|
</ol> |
|
<hr /> |
|
ENDINLINEMENU |
|
} |
|
$roles = '<a href="/adm/roles" target="_top">'.$lt{'roles'}.'</a>'; |
|
# Do we have a NAV link? |
|
if ($env{'request.course.id'}) { |
|
my $link='/adm/navmaps?postdata='.$escurl.'&postsymb='. |
|
$escsymb; |
|
if ($env{'environment.remotenavmap'} eq 'on') { |
|
$link="javascript:gonav('".$link."')"; |
|
} |
|
$navmaps=(<<ENDNAV); |
|
<li><a href="$link" target="_top">$lt{'nav'}</a></li> |
|
ENDNAV |
|
my $is_community = |
|
(&Apache::loncommon::course_type() eq 'Community'); |
|
if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) { |
|
my $text = ($is_community) ? $lt{'gdoc'} : $lt{'docs'}; |
|
$docs=(<<ENDDOCS); |
|
<li><a href="/adm/coursedocs" target="_top">$text</a></li> |
|
ENDDOCS |
|
} |
|
if ($showgroups) { |
|
$groups =(<<ENDGROUPS); |
|
<li><a href="/adm/coursegroups" target="_top">$lt{'groups'}</a></li> |
|
ENDGROUPS |
|
} |
|
if (&show_return_link()) { |
|
my $escreload=&escape('return:'); |
|
$reloadlink=(<<ENDRELOAD); |
|
<li><a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a></li> |
|
ENDRELOAD |
|
} |
|
if ($role_selector) { |
|
#$roles = '<td>'.$role_selector.'</td><td><a href="/adm/roles" target="_top">'.$lt{'other'}.'</a></td>'; |
|
$role_selector = '<li>'.$role_selector.'</li>'; |
|
} |
|
} |
|
if (($env{'request.state'} eq 'construct') && ($env{'request.course.id'})) { |
|
my $escreload=&escape('return:'); |
|
$reloadlink=(<<ENDCRELOAD); |
|
<li><a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a></li> |
|
ENDCRELOAD |
|
} |
|
my $reg = $forcereg ? &innerregister($forcereg,$titletable) : ''; |
|
my $form = &serverform(); |
|
my $utility = &utilityfunctions(); |
|
|
|
#Prepare the message link that indicates the arrival of new mail |
|
my $messagelink = &Apache::lonmsg::mynewmail() ? "Message (new)" : "Message"; |
|
$messagelink = '<a href="javascript:go(\'/adm/communicate\');">' |
|
. mt($messagelink) .'</a>'; |
|
|
|
my $helplink = &Apache::loncommon::top_nav_help('Help'); |
|
return (<<ENDINLINEMENU); |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
// BEGIN LON-CAPA Internal |
|
$utility |
|
// ]]> |
|
</script> |
|
<ol class="LC_primary_menu LC_right"> |
|
<li>$logo</li> |
|
<li>$messagelink</li> |
|
<li>$roles</li> |
|
<li>$helplink</li> |
|
<li><a href="/adm/logout" target="_top">$lt{'exit'}</a></li> |
|
</ol> |
|
<ul id="LC_secondary_menu"> |
|
<li><a href="/adm/menu" target="_top">$lt{'main'}</a></li> |
|
$reloadlink |
|
$navmaps |
|
$docs |
|
$groups |
|
$role_selector |
|
</ul> |
|
$form |
|
<script type="text/javascript"> |
|
// END LON-CAPA Internal |
|
</script> |
|
$reg |
|
ENDINLINEMENU |
|
} else { |
|
return ''; |
|
} |
|
} |
|
|
|
sub show_return_link { |
sub show_return_link { |
return (($env{'request.noversionuri'}=~m{^/(res|public)/} && |
return (($env{'request.noversionuri'}=~m{^/(res|public)/} && |
$env{'request.symb'} eq '') |
$env{'request.symb'} eq '') |
Line 884 ENDMENUITEMS
|
Line 705 ENDMENUITEMS
|
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]); |
|
} |
|
|
|
|
|
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 951 ENDMENUITEMS
|
Line 762 ENDMENUITEMS
|
# } |
# } |
# } |
# } |
} |
} |
#SD see below |
|
$breadcrumb = &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0); |
$breadcrumb = &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0); |
$result =(<<ENDREGTEXT); |
$result =(<<ENDREGTEXT); |
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 1377 sub openmenu {
|
Line 1187 sub openmenu {
|
} |
} |
|
|
sub inlinemenu { |
sub inlinemenu { |
my ($context,$switcher) = @_; |
|
undef(@inlineremote); |
undef(@inlineremote); |
undef(%category_members); |
undef(%category_members); |
my $output; |
# calling rawconfig with "1" will evaluate mydesk.tab, even if there is no active remote control |
if (($context eq 'gcicustom') || ($context eq 'gcistudent') || |
&rawconfig(1); |
($context eq 'gcinorole')) { |
my $output='<table><tr>'; |
$output='<table><tr>'. |
for (my $col=1; $col<=2; $col++) { |
'<td class="LC_mainmenu_col_fieldset">'. |
$output.='<td class="LC_mainmenu_col_fieldset">'; |
'<div class="LC_Box LC_400Box">'. |
for (my $row=1; $row<=8; $row++) { |
'<h3 class="LC_hcell">'.&mt('Utilities').'</h3>'. |
foreach my $cat (keys(%category_members)) { |
'<table>'; |
if ($category_positions{$cat} ne "$col,$row") { next; } |
if ($context eq 'gcicustom') { |
#$output.='<table><tr><td colspan="4" class="LC_menubuttons_category">'.&mt($category_names{$cat}).'</td></tr>'; |
my $createtext = &mt('Create Concept Test'); |
$output.='<div class="LC_Box LC_400Box">'; |
if ($switcher) { |
$output.='<h3 class="LC_hcell">'.&mt($category_names{$cat}).'</h3>'; |
$createtext = &mt('Create New Test'); |
$output.='<table>'; |
} |
my %active=(); |
$output .= '<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>'; |
foreach my $menu_item (split(/\:/,$category_members{$cat})) { |
} |
if ($inlineremote[$menu_item]) { |
if ($switcher) { |
$active{$menu_item}=1; |
$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>'; |
} |
} |
} |
$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>'. |
foreach my $item (sort(keys(%active))) { |
'<tr><td align="left"><a href="javascript:go('."'/adm/preferences'".');"><img alt="user preferences" src="/res/adm/pages/pref.png" align="left" class="LC_icon" /></a></td><td class="LC_menubuttons_text" colspan="3"><a class="LC_menubuttons_link" href="javascript:go('."'/adm/preferences'".');"><span class="LC_menubuttons_inline_text">'.&mt('Set my user preferences').'</span></a></td></tr>'; |
$output.=$inlineremote[$item]; |
if ($env{'request.course.id'}) { |
} |
if (($context eq 'gcicustom') && (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) { |
$output.='</table>'; |
$output.= '</td></tr></table></div></td>'. |
$output.='</div>'; |
'<td class="LC_mainmenu_col_fieldset">'. |
|
'<div class="LC_Box LC_400Box">'. |
|
'<h3 class="LC_hcell">'.&mt('Test Management').'</h3>'. |
|
'<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". |
|
'<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>'. |
|
'<tr><td align="left"><a href="javascript:go('."'/adm/printout'".');"><img alt="print concept test" src="/res/adm/pages/prnt.png" align="left" class="LC_icon" /></a></td><td class="LC_menubuttons_text" colspan="3"><a class="LC_menubuttons_link" href="javascript:go('."'/adm/printout'".');"><span class="LC_menubuttons_inline_text">'.&mt("Prepare Printable Concept Test").'</span></a></td></tr>'. |
|
'<tr><td align="left"><a href="javascript:go('."'/adm/statistics'".');"><img alt="Test Statistics" src="/res/adm/pages/chrt.png" align="left" class="LC_icon" /></a></td><td class="LC_menubuttons_text" colspan="3"><a class="LC_menubuttons_link" href="javascript:go('."'/adm/statistics'".');"><span class="LC_menubuttons_inline_text">'.&mt("Concept Test Statistics").'</span></a></td></tr></table></div></td>'; |
|
} else { |
|
my $navtext = &mt('Table of Contents'); |
|
if ($env{'request.role.domain'} eq 'gcitest') { |
|
$navtext = &mt('Display Test Contents'); |
|
} |
|
$output .= '<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">'.$navtext.'</span></a></td></tr></table></div></td>'; |
|
} |
|
} else { |
|
$output.='</td></tr></table></div></td>'; |
|
} |
|
if ($context eq 'gcinorole') { |
|
my $queued = &Apache::loncoursequeueadmin::queued_selfenrollment('notitle'); |
|
if ($queued) { |
|
$output .= '<td class="LC_mainmenu_col_fieldset">'. |
|
'<div class="LC_Box LC_400Box">'. |
|
'<h3 class="LC_hcell">'.&mt('Pending Enrollment Requests').'</h3>'. |
|
$queued. |
|
'</td></tr></table></div></td>'; |
|
} |
|
} |
|
$output.='</tr></table>'; |
|
} else { |
|
# calling rawconfig with "1" will evaluate mydesk.tab, |
|
# even if there is no active remote control |
|
&rawconfig(1); |
|
$output='<table><tr>'; |
|
for (my $col=1; $col<=2; $col++) { |
|
$output.='<td class="LC_mainmenu_col_fieldset">'; |
|
for (my $row=1; $row<=8; $row++) { |
|
foreach my $cat (keys(%category_members)) { |
|
if ($category_positions{$cat} ne "$col,$row") { next; } |
|
$output.='<div class="LC_Box LC_400Box">'; |
|
$output.='<h3 class="LC_hcell">'.&mt($category_names{$cat}).'</h3>'; |
|
$output.='<table>'; |
|
my %active=(); |
|
foreach my $menu_item (split(/\:/,$category_members{$cat})) { |
|
if ($inlineremote[$menu_item]) { |
|
$active{$menu_item}=1; |
|
} |
|
} |
|
foreach my $item (sort(keys(%active))) { |
|
$output.=$inlineremote[$item]; |
|
} |
|
$output.='</table>'; |
|
$output.='</div>'; |
|
} |
|
} |
} |
$output.="</td>"; |
} |
} |
$output.="</td>"; |
$output.="</tr></table>"; |
|
} |
} |
|
$output.="</tr></table>"; |
return $output; |
return $output; |
} |
} |
|
|
Line 1757 END
|
Line 1511 END
|
} |
} |
|
|
sub utilityfunctions { |
sub utilityfunctions { |
my ($caller,$custommenu) = @_; |
my $caller = shift; |
unless ($env{'environment.remote'} eq 'off' || |
unless ($env{'environment.remote'} eq 'off' || |
$caller eq '/adm/menu') { |
$caller eq '/adm/menu') { |
return ''; } |
return ''; } |
|
|
my $gcimenujs; |
|
if ($custommenu) { |
|
my %concepttests = &Apache::loncommon::existing_gcitest_courses('cc'); |
|
my $managetesturl = '/adm/menu'; |
|
my $createtesturl = '/adm/requestcourse'; |
|
if (($env{'request.course.id'}) && |
|
($env{'course.'.$env{'request.course.id'}.'.domain'} eq 'gci')) { |
|
my @items = keys(%concepttests); |
|
if (@items== 1) { |
|
my $newrole = $items[0]; |
|
$newrole =~ s{_}{/}; |
|
$managetesturl = '/adm/roles?selectrole=1&cc./'.$newrole.'=1'; |
|
} else { |
|
$managetesturl = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2fmenu'; |
|
} |
|
} |
|
if ($env{'request.course.id'}) { |
|
$createtesturl = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2frequestcourse'; |
|
} |
|
$gcimenujs = <<"ENDCUSTOM"; |
|
|
|
function switchpage(caller) { |
|
if (caller == 'review') { |
|
document.location.href = '/adm/roles?selectrole=1&st./gci/9615072b469884921gcil1=1'; |
|
} |
|
if (caller == 'submit') { |
|
document.location.href = '/adm/roles?selectrole=1&st./gci/1H96711d710194bfegcil1=1'; |
|
} |
|
if (caller == 'createtest') { |
|
document.location.href = '$createtesturl'; |
|
} |
|
if (caller == 'managetest') { |
|
document.location.href = '$managetesturl'; |
|
} |
|
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])); |
if ($currenturl =~ m{^/adm/wrapper/ext/}) { |
if ($currenturl =~ m{^/adm/wrapper/ext/}) { |
if ($env{'request.external.querystring'}) { |
if ($env{'request.external.querystring'}) { |
Line 1849 return (<<ENDUTILITY)
|
Line 1563 return (<<ENDUTILITY)
|
$nav_control |
$nav_control |
$dc_popup_cid |
$dc_popup_cid |
|
|
$gcimenujs |
|
|
|
function go(url) { |
function go(url) { |
if (url!='' && url!= null) { |
if (url!='' && url!= null) { |
currentURL = null; |
currentURL = null; |
Line 2041 sub hidden_button_check {
|
Line 1753 sub hidden_button_check {
|
return; |
return; |
} |
} |
if ($env{'request.role.adv'}) { |
if ($env{'request.role.adv'}) { |
unless (&Apache::loncommon::needs_gci_custom()) { |
return; |
return; |
|
} |
|
} |
} |
my $buttonshide = &Apache::lonnet::EXT('resource.0.buttonshide'); |
my $buttonshide = &Apache::lonnet::EXT('resource.0.buttonshide'); |
return $buttonshide; |
return $buttonshide; |