Update of /cvsroot/popfile/engine/UI
In directory sc8-pr-cvs1:/tmp/cvs-serv21095/UI
Modified Files:
HTML.pm
Log Message:
Add new get_bucket_word_prefixesd API and use it to make the viewing of the contents of an individual bucket work; this completes the core features for v0.20.0.
Index: HTML.pm
===================================================================
RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v
retrieving revision 1.201
retrieving revision 1.202
diff -C2 -d -r1.201 -r1.202
*** HTML.pm 10 Sep 2003 03:54:15 -0000 1.201
--- HTML.pm 10 Sep 2003 22:33:57 -0000 1.202
***************
*** 1709,1750 ****
$body .= "<tr><td colspan=2>";
- # TODO FIX THIS TO USE NEW API
-
if ( $self->{classifier__}->get_bucket_word_count( $self->{form_}{showbucket} ) > 0 ) {
! for my $i ($self->{classifier__}->get_bucket_word_list($self->{form_}{showbucket})) {
! if ( defined($i) ) {
! my $j = $i;
! $j =~ /^\|(.)/;
! my $first = $1;
!
! if ( defined( $self->{form_}{showletter} ) && ( $first eq $self->{form_}{showletter} ) ) {
! # Split the entries on the double bars
!
! my %temp;
!
! while ( $j =~ m/\G\|(.*?) L?\-?[\.\d]+\|/g ) {
! my $word = $1;
! $temp{$word} = $self->{classifier__}->get_count_for_word( $self->{form_}{showbucket}, $word );
! }
! $body .= "</td></tr><tr><td colspan=2> </td></tr><tr>\n<td valign=\"top\">\n<b>$first</b>\n</td>\n<td valign=\"top\">\n<table><tr valign=\"top\">";
! my $count = 0;
! for my $word (sort { $temp{$b} <=> $temp{$a} } keys %temp) {
! $body .= "</tr><tr valign=\"top\">" if ( ( $count % 6 ) == 0 );
! $body .= "<td><a class=\"wordListLink\" href=\"\/buckets\?session=$self->{session_key__}\&lookup=Lookup\&word=". $self->url_encode_( $word ) . "#Lookup\"><b>$word</b><\/a></td><td>$temp{$word}</td><td> </td>";
! $count += 1;
! }
! $body .= "</tr></table></td>\n</tr>\n<tr><td colspan=2> </td></tr><tr><td colspan=2>";
} else {
! $j = '';
!
! $body .= "<a href=/buckets?session=$self->{session_key__}\&showbucket=$self->{form_}{showbucket}\&showletter=" . $self->url_encode_($first) . "><b>$first</b></a>\n";
}
! }
! }
}
--- 1709,1736 ----
$body .= "<tr><td colspan=2>";
if ( $self->{classifier__}->get_bucket_word_count( $self->{form_}{showbucket} ) > 0 ) {
! for my $i ($self->{classifier__}->get_bucket_word_prefixes($self->{form_}{showbucket})) {
! if ( defined( $self->{form_}{showletter} ) && ( $i eq $self->{form_}{showletter} ) ) {
! my %temp;
! for my $j ( $self->{classifier__}->get_bucket_word_list( $self->{form_}{showbucket}, $i ) ) {
! $temp{$j} = $self->{classifier__}->get_count_for_word( $self->{form_}{showbucket}, $j );
! }
! $body .= "</td></tr><tr><td colspan=2> </td></tr><tr>\n<td valign=\"top\">\n<b>$i</b>\n</td>\n<td valign=\"top\">\n<table><tr valign=\"top\">";
! my $count = 0;
! for my $word (sort { $temp{$b} <=> $temp{$a} } keys %temp) {
! $body .= "</tr><tr valign=\"top\">" if ( ( $count % 6 ) == 0 );
! $body .= "<td><a class=\"wordListLink\" href=\"\/buckets\?session=$self->{session_key__}\&lookup=Lookup\&word=". $self->url_encode_( $word ) . "#Lookup\"><b>$word</b><\/a></td><td>$temp{$word}</td><td> </td>";
! $count += 1;
! }
+ $body .= "</tr></table></td>\n</tr>\n<tr><td colspan=2> </td></tr><tr><td colspan=2>";
} else {
! $body .= "<a href=/buckets?session=$self->{session_key__}\&showbucket=$self->{form_}{showbucket}\&showletter=" . $self->url_encode_($i) . "><b>$i</b></a>\n";
}
! }
}
|