version 1.925.2.18, 2010/11/09 03:20:32
|
version 1.925.2.23, 2010/12/05 19:35:38
|
Line 1980 sub select_dom_form {
|
Line 1980 sub select_dom_form {
|
if ($dom ne '') { |
if ($dom ne '') { |
my $domdesc; |
my $domdesc; |
if ($name eq 'srchdomain') { |
if ($name eq 'srchdomain') { |
if ($dom eq 'gci') { |
if ($dom =~ /^\w+ci$/) { |
$domdesc = 'Faculty'; |
$domdesc = 'Faculty'; |
} else { |
} else { |
$domdesc = 'Students'; |
$domdesc = 'Students'; |
Line 4463 sub bodytag {
|
Line 4463 sub bodytag {
|
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg, |
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg, |
$no_nav_bar,$bgcolor,$no_inline_link,$args)=@_; |
$no_nav_bar,$bgcolor,$no_inline_link,$args)=@_; |
|
|
|
my $public; |
|
if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) |
|
|| ($env{'user.name'} eq '') && ($env{'user.domain'} eq '')) { |
|
$public = 1; |
|
} |
if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); } |
if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); } |
|
|
$function = &get_users_function() if (!$function); |
$function = &get_users_function() if (!$function); |
Line 4528 sub bodytag {
|
Line 4533 sub bodytag {
|
} |
} |
|
|
my $name = &plainname($env{'user.name'},$env{'user.domain'}); |
my $name = &plainname($env{'user.name'},$env{'user.domain'}); |
if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') { |
if ($public) { |
undef($role); |
undef($role); |
} else { |
} else { |
$name = &aboutmewrapper($name,$env{'user.name'},$env{'user.domain'}); |
$name = &aboutmewrapper($name,$env{'user.name'},$env{'user.domain'}); |
Line 4549 sub bodytag {
|
Line 4554 sub bodytag {
|
$role = '<span class="LC_nobreak">('.$role.')</span>' if $role; |
$role = '<span class="LC_nobreak">('.$role.')</span>' if $role; |
&get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']); |
&get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']); |
|
|
if ($env{'environment.remote'} eq 'off') { |
if ($env{'environment.remote'} ne 'on') { |
# No Remote |
# No Remote |
if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') { |
if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') { |
return $bodytag; |
return $bodytag; |
Line 4564 sub bodytag {
|
Line 4569 sub bodytag {
|
my $role_selector; |
my $role_selector; |
if (($custommenu) && !($env{'form.context'} eq 'requestcrs') && |
if (($custommenu) && !($env{'form.context'} eq 'requestcrs') && |
($env{'request.course.id'}) && |
($env{'request.course.id'}) && |
($env{'course.'.$env{'request.course.id'}.'.domain'} eq 'gcitest')) { |
($env{'course.'.$env{'request.course.id'}.'.domain'} =~ /^\w+citest$/)) { |
$role_selector = &Apache::lonmenu::roles_selector( |
$role_selector = &Apache::lonmenu::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'} ); |
Line 4573 sub bodytag {
|
Line 4578 sub bodytag {
|
} |
} |
} |
} |
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
my %gcicourses = ( |
my %cicourses; |
gci_9615072b469884921gcil1 => 'review', |
my $udom = $env{'user.domain'}; |
gci_1H96711d710194bfegcil1 => 'submit', |
my %allnums = &get_faculty_cnums(); |
gci_5422913620b814c90gcil1 => 'tutorial', |
if (($udom ne '') && (ref($allnums{$udom}) eq 'HASH')) { |
); |
foreach my $key (%{$allnums{$udom}}) { |
if (($custommenu && $cid && !$gcicourses{$cid}) && |
$cicourses{$udom.'_'.$key} = $allnums{$udom}->{$key}; |
|
} |
|
} |
|
if (($custommenu && $cid && !$cicourses{$cid}) && |
!($env{'form.context'} eq 'requestcrs') || |
!($env{'form.context'} eq 'requestcrs') || |
($env{'user.domain'} eq 'gcitest')) { |
($env{'user.domain'} =~ /^\w+citest$/)) { |
my $role = 'st'; |
my $role = 'st'; |
if ($custommenu) { |
if ($custommenu) { |
$role = 'cc'; |
$role = 'cc'; |
Line 4602 sub bodytag {
|
Line 4610 sub bodytag {
|
$current = $role.'./'.$env{'course.'.$cid.'.domain'}. |
$current = $role.'./'.$env{'course.'.$cid.'.domain'}. |
'/'.$env{'course.'.$cid.'.num'}; |
'/'.$env{'course.'.$cid.'.num'}; |
} |
} |
$switcher_js = &Apache::loncommon::gcitest_switcher_js($current,$numcourses,$formname); |
$switcher_js = &gcitest_switcher_js($current,$numcourses,$formname); |
if ($switcher_js) { |
if ($switcher_js) { |
$switcher_js= <<"ENDSCRIPT"; |
$switcher_js= <<"ENDSCRIPT"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 4638 ENDSCRIPT
|
Line 4646 ENDSCRIPT
|
return $bodytag; |
return $bodytag; |
} |
} |
|
|
if ($cid && $gcicourses{$cid} eq 'tutorial') { |
if ($cid && $cicourses{$cid} eq 'tutorial') { |
$bodytag .= '<div class="LC_page_header">'; |
$bodytag .= '<div class="LC_page_header">'; |
} |
} |
|
|
Line 4653 ENDSCRIPT
|
Line 4661 ENDSCRIPT
|
$dc_info = &dc_courseid_toggle($dc_info); |
$dc_info = &dc_courseid_toggle($dc_info); |
} |
} |
$bodytag .= qq|<div id="LC_realm">$realm $dc_info</div>|; |
$bodytag .= qq|<div id="LC_realm">$realm $dc_info</div>|; |
if ($cid && $gcicourses{$cid} eq 'tutorial') { |
if ($cid && $cicourses{$cid} eq 'tutorial') { |
$bodytag .= '</div>'; |
$bodytag .= '</div>'; |
} |
} |
|
|
#don't show menus for public users |
#don't show menus for public users |
if($env{'user.name'} ne 'public' && $env{'user.domain'} ne 'public'){ |
if(!$public){ |
if (($custommenu) && |
if (($custommenu) && |
($env{'request.role'} !~ m{^st\./gcitest/$match_courseid})) { |
($env{'request.role'} !~ m{^st\./(\w+)citest/$match_courseid})) { |
$bodytag .= &Apache::lonmenu::gci_secondary_menu(); |
$bodytag .= &Apache::lonmenu::gci_secondary_menu(); |
} elsif ($env{'request.role'} ne 'cm' || &check_for_gci_dc()) { |
} elsif ($env{'request.role'} ne 'cm' || &check_for_gci_dc()) { |
$bodytag .= Apache::lonmenu::secondary_menu(); |
$bodytag .= Apache::lonmenu::secondary_menu(); |
Line 6181 ol.LC_primary_menu {
|
Line 6189 ol.LC_primary_menu {
|
margin: 0.2em 0 0 0; |
margin: 0.2em 0 0 0; |
} |
} |
|
|
span.LC_new_message{ |
|
font-weight:bold; |
|
color: darkred; |
|
} |
|
|
|
ol#LC_PathBreadcrumbs { |
ol#LC_PathBreadcrumbs { |
margin: 0; |
margin: 0; |
} |
} |
Line 6206 ol.LC_primary_menu a {
|
Line 6209 ol.LC_primary_menu a {
|
text-decoration: none; |
text-decoration: none; |
} |
} |
|
|
|
ol.LC_primary_menu a.LC_new_message { |
|
font-weight:bold; |
|
color: darkred; |
|
} |
|
|
ul#LC_secondary_menu { |
ul#LC_secondary_menu { |
clear: both; |
clear: both; |
color: $fontmenu; |
color: $fontmenu; |
Line 11005 sub clean_symb {
|
Line 11013 sub clean_symb {
|
sub needs_gci_custom { |
sub needs_gci_custom { |
my $custommenu; |
my $custommenu; |
my $numdc = &check_for_gci_dc(); |
my $numdc = &check_for_gci_dc(); |
|
my $udom = $env{'user.domain'}; |
|
return if ($udom eq ''); |
unless ($numdc) { |
unless ($numdc) { |
my $then=$env{'user.login.time'}; |
my $then=$env{'user.login.time'}; |
my $now = time; |
my $now = time; |
my %cnums = ( |
my %allnums = &get_faculty_cnums(); |
review => '9615072b469884921gcil1', |
my $cnums = $allnums{$udom}; |
submit => '1H96711d710194bfegcil1', |
return unless (ref($cnums) eq 'HASH'); |
); |
if ($env{'user.role.st./\Q$udom\E/'.$cnums->{'review'}}) { |
if ($env{'user.role.st./gci/'.$cnums{'review'}}) { |
|
my ($start,$end) = |
my ($start,$end) = |
split('.',$env{'user.role.st./gci/'.$cnums{'review'}}); |
split('.',$env{'user.role.st./\Q$udom\E/'.$cnums->{'review'}}); |
if (((!$start) || ($start && $start <= $now)) && |
if (((!$start) || ($start && $start <= $now)) && |
((!$end) || ($end > $now))) { |
((!$end) || ($end > $now))) { |
$custommenu = 1; |
$custommenu = 1; |
if ($env{'user.role.cc./gci/'.$cnums{'review'}}) { |
if ($env{'user.role.cc./\Q$udom\E/'.$cnums->{'review'}}) { |
my ($ccstart,$ccend) = |
my ($ccstart,$ccend) = |
split('.',$env{'user.role.cc./gci/'.$cnums{'review'}}); |
split('.',$env{'user.role.cc./\Q$udom\E/'.$cnums->{'review'}}); |
if (((!$start) || ($start && $start <= $now)) && |
if (((!$start) || ($start && $start <= $now)) && |
((!$end) || ($end > $now))) { |
((!$end) || ($end > $now))) { |
$custommenu = ''; |
$custommenu = ''; |
Line 11032 sub needs_gci_custom {
|
Line 11041 sub needs_gci_custom {
|
return $custommenu; |
return $custommenu; |
} |
} |
|
|
|
sub ci_tabs { |
|
my ($domain) = @_; |
|
my %tabs = ( |
|
gci => ['review','submit','managetest','tutorial'], |
|
slci => ['review'], |
|
); |
|
return $tabs{$domain}; |
|
} |
|
|
sub check_for_gci_dc { |
sub check_for_gci_dc { |
my $then=$env{'user.login.time'}; |
my $then=$env{'user.login.time'}; |
my $numdc = 0; |
my $numdc = 0; |
foreach my $dom ('gci','gcitest') { |
my @doms = &Apache::lonnet::current_machine_domains(); |
|
foreach my $dom (@doms) { |
if ($env{'user.role.dc./'.$dom.'/'}) { |
if ($env{'user.role.dc./'.$dom.'/'}) { |
my $livedc = 1; |
my $livedc = 1; |
my ($tstart,$tend)=split(/\./,$env{'user.role.dc./'.$dom.'/'}); |
my ($tstart,$tend)=split(/\./,$env{'user.role.dc./'.$dom.'/'}); |
Line 11049 sub check_for_gci_dc {
|
Line 11068 sub check_for_gci_dc {
|
return $numdc; |
return $numdc; |
} |
} |
|
|
|
sub get_faculty_cnums { |
|
my %cnums = ( |
|
gci => { |
|
review => '9615072b469884921gcil1', |
|
submit => '1H96711d710194bfegcil1', |
|
tutorial => '5422913620b814c90gcil1', |
|
}, |
|
slci => { |
|
review => '', |
|
} |
|
); |
|
return %cnums; |
|
} |
|
|
sub existing_gcitest_courses { |
sub existing_gcitest_courses { |
my ($role) = @_; |
my ($role) = @_; |
my %courses; |
my %courses; |
my $cdom = 'gcitest'; |
my $cdom = $env{'user.domain'}.'test'; |
my $now = time; |
my $now = time; |
foreach my $envkey (keys(%env)) { |
foreach my $envkey (keys(%env)) { |
my $cnum; |
my $cnum; |
Line 11145 ENDJS
|
Line 11178 ENDJS
|
return $output; |
return $output; |
} |
} |
|
|
|
sub get_citest_map { |
|
my ($cdom) = @_; |
|
my %questionnaires = ( |
|
gcitest => 'default_1261144274.sequence', |
|
slcitest => 'default_1261144274.sequence', |
|
); |
|
return $questionnaires{$cdom}; |
|
} |
|
|
=pod |
=pod |
|
|