--- loncom/interface/loncommon.pm 2009/12/08 05:00:15 1.925.2.3 +++ loncom/interface/loncommon.pm 2009/12/16 13:00:45 1.928 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.925.2.3 2009/12/08 05:00:15 raeburn Exp $ +# $Id: loncommon.pm,v 1.928 2009/12/16 13:00:45 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1719,10 +1719,13 @@ sub create_workbook { my $workbook = Spreadsheet::WriteExcel->new('/home/httpd'.$filename); if (! defined($workbook)) { $r->log_error("Error creating excel spreadsheet $filename: $!"); - $r->print('

'.&mt("Unable to create new Excel file. ". - "This error has been logged. ". - "Please alert your LON-CAPA administrator"). - '

'); + $r->print( + '

' + .&mt('Problems occurred in creating the new Excel file.') + .' '.&mt('This error has been logged.') + .' '.&mt('Please alert your LON-CAPA administrator.') + .'

' + ); return (undef); } # @@ -1762,9 +1765,13 @@ sub create_text_file { $fh = Apache::File->new('>/home/httpd'.$filename); if (! defined($fh)) { $r->log_error("Couldn't open $filename for output $!"); - $r->print(&mt('Problems occurred in creating the output file. ' - .'This error has been logged. ' - .'Please alert your LON-CAPA administrator.')); + $r->print( + '

' + .&mt('Problems occurred in creating the output file.') + .' '.&mt('This error has been logged.') + .' '.&mt('Please alert your LON-CAPA administrator.') + .'

' + ); } return ($fh,$filename) } @@ -4527,7 +4534,6 @@ sub bodytag { if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') { return $bodytag; } - my $custommenu = &needs_gci_custom(); if ($env{'request.state'} eq 'construct') { $forcereg=1; } @@ -4546,10 +4552,12 @@ sub bodytag { return $bodytag; } - $bodytag .= qq|
$name $role
|; + unless ($env{'request.symb'} =~ m/\.page___\d+___/) { + $bodytag .= qq|
$name $role
|; + } $bodytag .= Apache::lonhtmlcommon::scripttag( - Apache::lonmenu::utilityfunctions('',$custommenu), 'start'); + Apache::lonmenu::utilityfunctions(), 'start'); $bodytag .= Apache::lonmenu::primary_menu(); @@ -4560,11 +4568,7 @@ sub bodytag { #don't show menus for public users if($env{'user.name'} ne 'public' && $env{'user.domain'} ne 'public'){ - if ($custommenu) { - $bodytag .= &Apache::lonmenu::gci_secondary_menu(); - } else { - $bodytag .= Apache::lonmenu::secondary_menu(); - } + $bodytag .= Apache::lonmenu::secondary_menu(); $bodytag .= Apache::lonmenu::serverform(); $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); if ($env{'request.state'} eq 'construct') { @@ -5520,10 +5524,6 @@ table.LC_notify_front_page td { font-size: 1.2em; } -.LC_topic_bar img { - vertical-align: bottom; -} - table.LC_course_group_status { margin: 20px; } @@ -6424,36 +6424,6 @@ ul.LC_funclist li { line-height: 150%; } -#gciheader { - float:left; - width:100%; - background:#DAE0D2 url("/gcimenu_bg.gif") repeat-x bottom; - font-size:93%; - line-height:normal; -} -#gciheader ul { - margin:0; - padding:10px 10px 0; - list-style:none; -} -#gciheader li { - float:left; - background:url("/gcimenu_left.gif") no-repeat left top; - margin:0; - padding:0 0 0 9px; -} -#gciheader a { - display:block; - background:url("/gcimenu_right.gif") no-repeat right top; - padding:5px 15px 4px 6px; -} -#gciheader #current { - background-image:url("/gcimenu_left_on.gif"); -} -#gciheader #current a { - background-image:url("/gcimenu_right_on.gif"); - padding-bottom:5px; -} END } @@ -10716,76 +10686,6 @@ sub clean_symb { return ($symb,$enc); } -sub needs_gci_custom { - my $custommenu; - my $numdc = &check_for_gci_dc(); - unless ($numdc) { - my $then=$env{'user.login.time'}; - my $now = time; - my %cnums = ( - review => '9615072b469884921gcil1', - submit => '1H96711d710194bfegcil1', - ); - if ($env{'user.role.st./gci/'.$cnums{'review'}}) { - my ($start,$end) = - split('.',$env{'user.role.st./gci/'.$cnums{'review'}}); - if (((!$start) || ($start && $start <= $now)) && - ((!$end) || ($end > $now))) { - $custommenu = 1; - if ($env{'user.role.cc./gci/'.$cnums{'review'}}) { - my ($ccstart,$ccend) = - split('.',$env{'user.role.cc./gci/'.$cnums{'review'}}); - if (((!$start) || ($start && $start <= $now)) && - ((!$end) || ($end > $now))) { - $custommenu = ''; - } - } - } - } - } - return $custommenu; -} - -sub check_for_gci_dc { - my $then=$env{'user.login.time'}; - my $numdc = 0; - foreach my $dom ('gci','gcitest') { - if ($env{'user.role.dc./'.$dom.'/'}) { - my $livedc = 1; - my ($tstart,$tend)=split(/\./,$env{'user.role.dc./'.$dom.'/'}); - if ($tstart && $tstart>$then) { $livedc = 0; } - if ($tend && $tend <$then) { $livedc = 0; } - if ($livedc) { - $numdc++; - } - } - } - return $numdc; -} - -sub existing_gcitest_courses { - my %courses; - my $cdom = 'gcitest'; - my $role = 'cc'; - my $now = time; - foreach my $envkey (keys(%env)) { - my $cnum; - if ($envkey =~ m{^user\.role\.\Q$role\E\./\Q$cdom\E/($match_courseid)$}) { - $cnum = $1; - } else { - next; - } - my ($tstart,$tend) = split(':',$env{$envkey}); - if (((!$tstart) || ($tstart < $now)) && ((!$tend) || ($tend > $now))) { - my $descr = $env{'course.'.$cdom.'_'.$cnum.'.description'}; - if ($descr ne '') { - $courses{$cdom.'_'.$cnum}{'description'} = $descr; - } - } - } - return %courses; -} - =pod =back