--- loncom/interface/loncommon.pm 2004/07/03 18:55:16 1.194 +++ loncom/interface/loncommon.pm 2004/07/19 21:00:53 1.201 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.194 2004/07/03 18:55:16 raeburn Exp $ +# $Id: loncommon.pm,v 1.201 2004/07/19 21:00:53 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -250,6 +250,8 @@ of the element the selection from the se =cut sub browser_and_searcher_javascript { + my ($mode)=@_; + if (!defined($mode)) { $mode='edit'; } my $resurl=&lastresurl(); return <<END; var editbrowser = null; @@ -259,7 +261,7 @@ sub browser_and_searcher_javascript { url += 'launch=1&'; } url += 'catalogmode=interactive&'; - url += 'mode=edit&'; + url += 'mode=$mode&'; url += 'form=' + formname + '&'; if (only != null) { url += 'only=' + only + '&'; @@ -284,7 +286,7 @@ sub browser_and_searcher_javascript { url += 'launch=1&'; } url += 'catalogmode=interactive&'; - url += 'mode=edit&'; + url += 'mode=$mode&'; url += 'form=' + formname + '&'; if (titleelement != null) { url += 'titleelement=' + titleelement + '&'; @@ -648,39 +650,27 @@ sub help_open_menu { $width = 620 if (not defined $width); $height = 600 if (not defined $height); my $link=''; - my $title = &mt('Choose your help'); + my $title = &mt('Get help'); my $origurl = $ENV{'REQUEST_URI'}; my $timestamp = time; -# if ($ENV{'request.course.fn'}) { -# open(FILE,">$ENV{'request.course.fn'}.formdata"); -# &get_unprocessed_cgi($ENV{'QUERY_STRING'},undef); -# foreach (keys %ENV) { -# if ($_ =~ m/^form\.(.+)$/) { -# if (ref($ENV{$_}) eq 'ARRAY') { -# my $valstr = join(",",@{$ENV{$_}}); -# print FILE "$1 = $valstr\n"; -# } else { -# print FILE "$1 = $ENV{$_}\n"; -# } -# } -# } -# close(FILE); -# } foreach (\$color,\$function,\$topic,\$component_help,\$faq,\$bug,\$origurl) { $$_ = &Apache::lonnet::escape($$_); } - if (!$stayOnPage) - { + if (!$stayOnPage) { $link = "javascript:helpMenu('open')"; - } - else - { + } else { $link = "javascript:helpMenu('display')"; } - my $banner_link = "/adm/helpmenu?page=banner&color=$color&function=$function&topic=$topic&component_help=$component_help&faq=$faq&bug=$bug&origurl=$origurl&stamp=$timestamp"; + my $banner_link = "/adm/helpmenu?page=banner&color=$color&function=$function&topic=$topic&component_help=$component_help&faq=$faq&bug=$bug&origurl=$origurl&stamp=$timestamp&stayonpage=$stayOnPage"; my $details_link = "/adm/helpmenu?page=body&color=$color&function=$function&topic=$topic&component_help=$component_help&faq=$faq&bug=$bug&origurl=$origurl&stamp=$timestamp"; - my $template .= <<"ENDTEMPLATE"; + 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>"; + } + $template .= <<"ENDTEMPLATE"; <script> function helpMenu(caller) { if (caller == 'open') { @@ -700,6 +690,7 @@ function helpMenu(caller) { </script> <a href="$link" title="$title"><image src="/adm/lonMisc/smallFAQ.gif" border="0" alt="(Help Menu)" /></a> ENDTEMPLATE + if ($text ne '') { $template.='</td></tr></table>' }; return $template; } @@ -1796,9 +1787,11 @@ sub screenname { # ------------------------------------------------------------- Message Wrapper sub messagewrapper { - my ($link,$un,$do)=@_; + my ($link,$username,$domain)=@_; return -"<a href='/adm/email?compose=individual&recname=$un&recdom=$do'>$link</a>"; + '<a href="/adm/email?compose=individual&'. + 'recname='.$username.'&recdom='.$domain.'" '. + 'title="'.&mt('Send message').'">'.$link.'</a>'; } # --------------------------------------------------------------- Notes Wrapper @@ -1811,8 +1804,8 @@ sub noteswrapper { sub aboutmewrapper { my ($link,$username,$domain,$target)=@_; - return "<a href='/adm/$domain/$username/aboutme'". - ($target?" target='$target'":'').">$link</a>"; + return '<a href="/adm/$domain/$username/aboutme"'. + ($target?' target="$target"':'').' title="'.&mt('View this users personal page').'">'.$link.'</a>'; } # ------------------------------------------------------------ Syllabus Wrapper @@ -1892,6 +1885,9 @@ returns description of a specified copyr sub copyrightdescription { return &mt($cprtag{shift(@_)}); } + +=pod + =item * source_copyrightids() returns list of all source copyrights