'.
- ''.
- ''.
- ' '.&mt('Utilities').''.
- ' | ';
- if ($switcher) {
- $output .= ' | ';
+ my (%can_request,%request_domains,$canreq,$createtext);
+ my $role = 'st';
+ my $custommenu = &Apache::loncommon::needs_gci_custom();
+ if ($custommenu) {
+ $role = 'cc';
+ }
+ my %courses = &Apache::loncommon::existing_gcitest_courses($role);
+ my $numcourses = keys(%courses);
+ my ($switcher_js,$switcher);
+ my $formname = 'testpicker';
+ 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";
+
+
+ENDSCRIPT
+ }
+ $switcher = $switcher_js.$switcher;
}
- $output .= ' |
| ';
- if (($env{'request.course.id'}) &&
- (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) {
- $output.= ''.
- ' | ';
+ if ($env{'user.domain'} eq 'gci') {
+ $canreq =
+ &Apache::lonnet::check_can_request('gcitest',\%can_request,\%request_domains);
+ $createtext = &mt('Create Concept Test');
+ if ($numcourses) {
+ $createtext = &mt('Create New Test');
+ }
+ }
+ if ($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 .=
+ '
';
+ } else {
+ my $navtext = &mt('Table of Contents');
+ my $navdesc = &mt('Display Table of Contents for Geoscience Concept Inventory');
+ if ($env{'request.role.domain'} eq 'gcitest') {
+ $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 .=
+ '
';
+ }
+ } elsif ($switcher || $canreq) {
+ $output .= '
'.
+ '
';
+ }
+ } elsif ($context eq 'gcinorole') {
+ my $queued = &Apache::loncoursequeueadmin::queued_selfenrollment('notitle');
+ if ($queued) {
+ $output .=
+ ''.
+ '
'.&mt('Pending Enrollment Requests').'
'.
+ $queued.
+ '';
}
- $output.='
';
} else {
# calling rawconfig with "1" will evaluate mydesk.tab,
# even if there is no active remote control
@@ -1736,7 +1886,7 @@ sub utilityfunctions {
my $gcimenujs;
if ($custommenu) {
- my %concepttests = &Apache::loncommon::existing_gcitest_courses();
+ my %concepttests = &Apache::loncommon::existing_gcitest_courses('cc');
my $managetesturl = '/adm/menu';
my $createtesturl = '/adm/requestcourse';
if (($env{'request.course.id'}) &&
@@ -1768,6 +1918,9 @@ function switchpage(caller) {
if (caller == 'managetest') {
document.location.href = '$managetesturl';
}
+ if (caller == 'tutorial') {
+ document.location.href = '/adm/roles?selectrole=1&st./gci/5422913620b814c90gcil1=1';
+ }
return;
}
@@ -1831,12 +1984,6 @@ function go(url) {
}
}
-function gotop(url) {
- if (url!='' && url!= null) {
- top.location.href = url;
- }
-}
-
function gopost(url,postdata) {
if (url!='') {
this.document.server.action=url;
@@ -2013,7 +2160,9 @@ sub hidden_button_check {
return;
}
if ($env{'request.role.adv'}) {
- return;
+ unless (&Apache::loncommon::needs_gci_custom()) {
+ return;
+ }
}
my $buttonshide = &Apache::lonnet::EXT('resource.0.buttonshide');
return $buttonshide;