--- loncom/interface/lonsyllabus.pm 2013/05/03 21:57:13 1.118 +++ loncom/interface/lonsyllabus.pm 2013/05/06 16:15:59 1.120 @@ -1,7 +1,7 @@ # The LearningOnline Network # Syllabus # -# $Id: lonsyllabus.pm,v 1.118 2013/05/03 21:57:13 raeburn Exp $ +# $Id: lonsyllabus.pm,v 1.120 2013/05/06 16:15:59 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -143,6 +143,8 @@ sub handler { } } + my $crstype = &Apache::loncommon::course_type(); + # ------------------------------ The buck stops here: internal syllabus display # --------------------------------------------------------- The syllabus fields my %syllabusfields=&Apache::lonlocal::texthash( @@ -292,7 +294,6 @@ ENDSCRIPT text=>"Course syllabus"}); $args->{'bread_crumbs'} = $brcrum; } elsif ($env{'form.folderpath'} =~ /^supplemental/) { - my $crstype = &Apache::loncommon::course_type(); my $title = $env{'form.title'}; if ($title eq '') { $title = &mt('Syllabus'); @@ -522,13 +523,14 @@ ENDSCRIPT if ($target ne 'tex') { my $protocol = $Apache::lonnet::protocol{$homeserver}; $protocol = 'http' if ($protocol ne 'https'); - $r->print('
' - .'

' - .&mt('This syllabus can be publicly viewed at [_1]' - ,''.$protocol.'://'.&Apache::lonnet::hostname($homeserver).$r->uri.'') - .' '.&Apache::loncommon::help_open_topic('Syllabus_ExtLink') - .'

' - .'
'); + my $link = $protocol.'://'.&Apache::lonnet::hostname($homeserver).$r->uri; + $r->print('
' + .'' + .'' + .&mt('Public link (no log-in): [_1]',''.$link.'') + .' '.&Apache::loncommon::help_open_topic('Syllabus_ExtLink') + .'' + .'
'); my $lonhost = $r->dir_config('lonHostID'); $r->print(&chooser($external,$uploaded,$cdom,$cnum,$lonhost,\%syllabusfields,\%syllabus)); } @@ -645,15 +647,39 @@ ENDSCRIPT } &Apache::lontemplate::print_start_template($r,&mt('RSS Feeds and Blogs'),'LC_Box', 'box_000_showrssfeeds',$display); - $r->print(&Apache::lonrss::advertisefeeds($cnum,$cdom,$forceedit)); + my ($numfeeds,$hiddenfeeds,$rsslinktext); + my $feeds=&Apache::lonrss::advertisefeeds($cnum,$cdom,$forceedit,\$numfeeds,\$hiddenfeeds); + if ($numfeeds) { + $r->print($feeds); + $rsslinktext = &mt('New RSS Feed or Blog'); + } else { + my $msg = '
'. + &mt("RSS Feeds and Blogs item is not included in a student's view of the syllabus."); + if ($hiddenfeeds) { + $r->print('

'. + &mt('All feeds currently hidden'). + $msg. + '

'); + } else { + $r->print('

'. + &mt('No current feeds'). + $msg. + '

'); + } + $rsslinktext = &mt('Manage Course RSS Feeds/Blogs'); + if ($crstype eq 'Community') { + $rsslinktext = &mt('Manage Communiity RSS Feeds/Blogs'); + } + } my $editurl= &Apache::lonnet::absolute_url().'/adm/'.$cdom.'/'.$cnum.'/_rss.html'; - $r->print( ''.&mt('New RSS Feed or Blog').''); + $r->print( ''.$rsslinktext.''); &Apache::lontemplate::print_end_template($r); } else { unless ($syllabus{'000_showrssfeeds'} eq 'no') { - if (&Apache::lonrss::advertisefeeds($cnum,$cdom) ne '') { + my $feeds = &Apache::lonrss::advertisefeeds($cnum,$cdom,$forceedit); + if ($feeds ne '') { &Apache::lontemplate::print_start_template($r,&mt('RSS Feeds and Blogs'),'LC_Box'); - $r->print(&Apache::lonrss::advertisefeeds($cnum,$cdom,$forceedit)); + $r->print($feeds); &Apache::lontemplate::print_end_template($r); } }