[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
droeschl
droeschl@source.lon-capa.org
Tue, 11 Aug 2009 11:33:52 -0000
droeschl Tue Aug 11 11:33:52 2009 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
Introduced sub current_course_title() which returns the description of the currently active course.
This is intended to improve code readability.
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1013 loncom/lonnet/perl/lonnet.pm:1.1014
--- loncom/lonnet/perl/lonnet.pm:1.1013 Tue Aug 11 01:39:44 2009
+++ loncom/lonnet/perl/lonnet.pm Tue Aug 11 11:33:52 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.1013 2009/08/11 01:39:44 raeburn Exp $
+# $Id: lonnet.pm,v 1.1014 2009/08/11 11:33:52 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -8048,6 +8048,11 @@
&devalidate_cache_new('title',$key);
}
+# ------------------------------------------------- Get the title of a course
+
+sub current_course_title {
+ return $env{ 'course.' . $env{'request.course.id'} . '.description' };
+}
# ------------------------------------------------- Get the title of a resource
sub gettitle {