[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm
www
lon-capa-cvs-allow@mail.lon-capa.org
Thu, 06 Mar 2008 20:31:52 -0000
www Thu Mar 6 15:31:52 2008 EDT
Modified files:
/loncom/xml londefdef.pm
Log:
Bug #5652: control printing of URLs and Anchors
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.381 loncom/xml/londefdef.pm:1.382
--- loncom/xml/londefdef.pm:1.381 Thu Feb 14 17:37:46 2008
+++ loncom/xml/londefdef.pm Thu Mar 6 15:31:52 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Tags Default Definition Module
#
-# $Id: londefdef.pm,v 1.381 2008/02/14 22:37:46 www Exp $
+# $Id: londefdef.pm,v 1.382 2008/03/06 20:31:52 www Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -1654,14 +1654,18 @@
&Apache::lonxml::get_param('href',$parstack,$safeeval,undef,1);
my $name =
&Apache::lonxml::get_param('name',$parstack,$safeeval,undef,1);
- if ($href =~ /\S/) {
+ my $uriprint =
+ &Apache::lonxml::get_param('uriprint',$parstack,$safeeval,undef,1);
+ my $anchorprint =
+ &Apache::lonxml::get_param('anchorprint',$parstack,$safeeval,undef,1);
+ if (($href =~ /\S/) && ($uriprint=~/^on|uriprint|yes|1$/i)) {
$href =~ s/([^\\])%/$1\\\%/g;
# Substitute special symbols... and allow line breaks at each /
#
$href = &Apache::lonxml::latex_special_symbols($href);
$href =~ s/\//\/\\-/g; # Map / to /\- to allow hyphenation.
$currentstring .= ' ({\tt URI:'.$href.'})';
- } elsif ($name =~ /\S/) {
+ } elsif (($name =~ /\S/) && ($anchorprint=~/^on|anchorprint|yes|1$/i)) {
$currentstring .= ' ({\tt Anchor:'.&Apache::lonxml::latex_special_symbols($name).'})';
} else {
$currentstring.='';