--- loncom/interface/lonmeta.pm 2005/05/09 01:51:44 1.97 +++ loncom/interface/lonmeta.pm 2005/07/08 10:39:49 1.98 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.97 2005/05/09 01:51:44 banghart Exp $ +# $Id: lonmeta.pm,v 1.98 2005/07/08 10:39:49 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -578,6 +578,15 @@ sub report_bombs { $r->print('

'.&Apache::lonnet::clutter($uri).'

'); my ($domain,$author)=($uri=~/^(\w+)\/(\w+)\//); if (&Apache::loncacc::constructaccess('/~'.$author.'/',$domain)) { + if ($env{'form.clearbombs'}) { + &Apache::lonmsg::clear_author_res_msg($uri); + } + my $clear=&mt('Clear all Messages in Subdirectory'); + $r->print(< + + +ENDCLEAR my %brokenurls = &Apache::lonmsg::all_url_author_res_msg($author,$domain); foreach (sort(keys(%brokenurls))) { @@ -901,11 +910,22 @@ sub present_editable_metadata { $bombs=&mt('Error deleting messages'); } } - my $del=&mt('Delete Messages'); + if ($env{'form.clearmsg'}) { + my $cleardir=$target; + $cleardir=~s/\/[^\/]+$/\//; + if (&Apache::lonmsg::clear_author_res_msg($cleardir) eq 'ok') { + $bombs=&mt('Messages cleared.'); + } else { + $bombs=&mt('Error clearing messages'); + } + } + my $del=&mt('Delete Messages for this Resource'); + my $clear=&mt('Clear all Messages in Subdirectory'); $r->print(<$disuri
+
$bombs ENDBOMBS } else { @@ -1025,4 +1045,4 @@ ENDEDIT 1; __END__ - \ No newline at end of file +