[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm loncreateuser.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Thu, 17 Jul 2003 18:10:53 -0000
matthew Thu Jul 17 14:10:53 2003 EDT
Modified files:
/loncom/interface loncreateuser.pm loncommon.pm
Log:
Bug 1045 - add syllabus link to create user page
loncreateuser.pm - now shows link
loncommon.pm - modified syllabuswrapper with more explicit variable names
so it won't take as long for me to figure out what it is doing next time
I have to add a syllabus link.
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.56 loncom/interface/loncreateuser.pm:1.57
--- loncom/interface/loncreateuser.pm:1.56 Fri Jun 20 10:37:26 2003
+++ loncom/interface/loncreateuser.pm Thu Jul 17 14:10:53 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.56 2003/06/20 14:37:26 www Exp $
+# $Id: loncreateuser.pm,v 1.57 2003/07/17 18:10:53 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -46,7 +46,7 @@
# 05/10,10/16 Gerd Kortemeyer
# 02/11/02 Matthew Hall
#
-# $Id: loncreateuser.pm,v 1.56 2003/06/20 14:37:26 www Exp $
+# $Id: loncreateuser.pm,v 1.57 2003/07/17 18:10:53 matthew Exp $
###
package Apache::loncreateuser;
@@ -286,12 +286,15 @@
my $allowed=0;
my $delallowed=0;
if ($area =~ /^\/(\w+)\/(\d\w+)/ ) {
+ my ($coursedom,$coursedir) = ($1,$2);
+ # $1.'_'.$2 is the course id (eg. 103_12345abcef103l3).
my %coursedata=
&Apache::lonnet::coursedescription($1.'_'.$2);
my $carea;
if (defined($coursedata{'description'})) {
$carea='Course: '.$coursedata{'description'}.
- '<br />Domain: '.$1;
+ '<br />Domain: '.$coursedom.(' 'x8).
+ &Apache::loncommon::syllabuswrapper('Syllabus',$coursedir,$coursedom);
} else {
$carea='Unavailable course: '.$area;
}
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.108 loncom/interface/loncommon.pm:1.109
--- loncom/interface/loncommon.pm:1.108 Wed Jul 16 10:21:56 2003
+++ loncom/interface/loncommon.pm Thu Jul 17 14:10:53 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.108 2003/07/16 14:21:56 bowersj2 Exp $
+# $Id: loncommon.pm,v 1.109 2003/07/17 18:10:53 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1353,9 +1353,11 @@
sub syllabuswrapper {
- my ($link,$un,$do,$tf)=@_;
- if ($tf) { $link='<font color="'.$tf.'">'.$link.'</font>'; }
- return "<a href='/public/$do/$un/syllabus'>$link</a>";
+ my ($linktext,$coursedir,$domain,$fontcolor)=@_;
+ if ($fontcolor) {
+ $linktext='<font color="'.$fontcolor.'">'.$linktext.'</font>';
+ }
+ return "<a href='/public/$domain/$coursedir/syllabus'>$linktext</a>";
}
# ---------------------------------------------------------------- Language IDs