--- loncom/interface/loncommon.pm 2004/08/25 18:13:00 1.207 +++ loncom/interface/loncommon.pm 2004/09/10 08:42:21 1.211 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.207 2004/08/25 18:13:00 matthew Exp $ +# $Id: loncommon.pm,v 1.211 2004/09/10 08:42:21 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -667,8 +667,8 @@ sub help_open_menu { my $template; if ($text ne "") { $template .= - "<table bgcolor='#337733' cellspacing='1' cellpadding='1' border='0'><tr>". - "<td bgcolor='#448844'><a href=\"$link\"><font color='#FFFFFF' size='2'>$text</font></a>"; + "<table bgcolor='#773311' cellspacing='1' cellpadding='1' border='0'><tr>". + "<td bgcolor='#886622'><a href=\"$link\"><font color='#FFFFFF' size='2'>$text</font></a>"; } $template .= <<"ENDTEMPLATE"; <script> @@ -812,7 +812,7 @@ format. sub csv_translate { my $text = shift; $text =~ s/\"/\"\"/g; - $text =~ s/\n//g; + $text =~ s/\n/ /g; return $text; } @@ -1829,9 +1829,28 @@ sub syllabuswrapper { if ($fontcolor) { $linktext='<font color="'.$fontcolor.'">'.$linktext.'</font>'; } - return "<a href='/public/$domain/$coursedir/syllabus'>$linktext</a>"; + return qq{<a href="/public/$domain/$coursedir/syllabus">$linktext</a>}; } +sub track_student_link { + my ($linktext,$sname,$sdom,$target) = @_; + my $link ="/adm/trackstudent"; + my $title = 'View recent activity'; + if (defined($sname) && $sname !~ /^\s*$/ && + defined($sdom) && $sdom !~ /^\s*$/) { + $link .= "?selected_student=$sname:$sdom"; + $title .= ' of this student'; + } + if (defined($target) && $target !~ /^\s*$/) { + $target = qq{target="$target"}; + } else { + $target = ''; + } + return qq{<a href="$link" title="$title" $target>$linktext</a>}; +} + + + =pod =back @@ -2312,7 +2331,7 @@ sub maketime { my %th=@_; return POSIX::mktime( ($th{'seconds'},$th{'minutes'},$th{'hours'}, - $th{'day'},$th{'month'}-1,$th{'year'}-1900,0,0,$th{'dlsav'})); + $th{'day'},$th{'month'}-1,$th{'year'}-1900,0,0,-1)); } #########################################