--- loncom/interface/lonrss.pm 2007/07/27 00:17:17 1.37 +++ loncom/interface/lonrss.pm 2010/01/03 21:21:25 1.47.8.1 @@ -1,7 +1,7 @@ # The LearningOnline Network # RSS Feeder # -# $Id: lonrss.pm,v 1.37 2007/07/27 00:17:17 albertel Exp $ +# $Id: lonrss.pm,v 1.47.8.1 2010/01/03 21:21:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -60,6 +60,9 @@ sub displayfeedname { # no, construct a name my $name=$filterfilename; if ($name=~/^CourseBlog/) { + if ($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Community') { + $name = &mt('Community Blog'); + } $name=&mt('Course Blog'); if ($env{'course.'.$env{'request.course.id'}.'.description'}) { $name.=' '.$env{'course.'.$env{'request.course.id'}.'.description'}; @@ -106,8 +109,8 @@ sub advertisefeeds { } } else { $feeds.='
  • '.$feednames{$feed}. - '
    '.($edit?&mt('Edit'):'HTML').': '.$htmlurl.''. - '
    '.&mt('Public RSS/podcast (subscribe to)').': '.$feedurl.'
  • '; + '
    '.($edit?&mt('Edit'):'HTML').': '.$feednames{$feed}.' HTML'. + '
    '.&mt('Public RSS/podcast (subscribe to)').': '.$feednames{$feed}.' RSS/Podcast'; } } if ($feeds) { @@ -303,18 +306,33 @@ sub handler { my $filterfeedname=&filterfeedname($filename); my $feedname=&feedname($filename); my ($displayfeedname,$displayoption)=&displayfeedname($filename,$uname,$udom); - my ($blocked,$blocktext); + my ($blocked,$blocktext,$disabled,$disabletext); if (!&Apache::lonnet::is_course($udom,$uname)) { ($blocked,$blocktext) = &blocking_blogdisplay($uname,$udom,$html,$filterfeedname); + if (&Apache::lonnet::usertools_access($uname,$udom,'blog')) { + $disabled = 0; + } else { + $disabled = 1; + if ($html) { + $disabletext = '

    '.&mt('No user blog available') .'

    '. + &mt('This is a result of one of the following:').''; + } else { + $disabletext = &mt('No user blog available'); + } + } } if ($html) { - my $title = $displayfeedname?$displayfeedname - :"Available RSS Feeds and Blogs"; +# my $title = $displayfeedname?$displayfeedname:"Available RSS Feeds and Blogs"; + my $title = "My Space"; my $rss_link = &Apache::lonrss::rss_link($uname,$udom); + my $brcrumb = [{href=>$rss_link,text=>"Available RSS Feeds and Blogs"}]; $r->print(&Apache::loncommon::start_page($title,$rss_link, - {'domain' => $udom, - 'force_register' => - $env{'form.register'}}). + {'bread_crumbs' => $brcrumb, + 'domain' => $udom, + 'force_register' => $env{'form.register'}}). &changed_js()); } else { # render RSS my $server = &Apache::lonnet::absolute_url(); @@ -329,7 +347,7 @@ sub handler { my $newid = &get_new_feed_id(); # Is this user for real? my $homeserver=&Apache::lonnet::homeserver($uname,$udom); - if ($html && !$blocked) { + if ($html && !$blocked && !$disabled) { # Any new feeds or renaming of feeds? if ($edit) { # Hide a feed? @@ -361,6 +379,9 @@ sub handler { } elsif ($blocked) { $r->print($blocktext); $r->print(($html?&Apache::loncommon::end_page():''."\n")); + } elsif ($disabled) { + $r->print($disabletext); + $r->print(($html?&Apache::loncommon::end_page():''."\n")); } else { # is indeed a user # Course or user? my $name=''; @@ -372,9 +393,10 @@ sub handler { } # Add a new feed if (($html) && ($edit)) { + $r->print('

    ' . &mt('New RSS Feed or Blog'). '

    '); $r->print('
    '); - $r->print(&mt('Name for New Feed').": "); - $r->print(''); + $r->print(&mt('Name').": "); + $r->print(''); $r->print('
    '); } if ($displayfeedname) { # this is an existing feed @@ -491,7 +513,7 @@ sub handler { 'private' => 'private', 'hidden' => 'hidden', 'delete' => 'delete', - 'store' => 'Save changes', + 'store' => 'Select', 'title' => 'Title', 'link' => 'Link', 'description' => 'Description', @@ -571,7 +593,7 @@ ENDEDIT if ($html) { $r->print(''); if ($edit) { - $r->print(''. + $r->print(''. ($displayoption eq 'hidden'?'': '')); }