package CGI::Wiki::Plugin::Summariser; use strict; use CGI::Wiki::Plugin; use vars qw( $VERSION @ISA ); $VERSION = '0.01'; @ISA = qw( CGI::Wiki::Plugin ); =head1 NAME CGI::Wiki::Plugin::Summariser - Category management for CGI::Wiki. =head1 DESCRIPTION =head1 SYNOPSIS use CGI::Wiki; use CGI::Wiki::Plugin::Summariser; my $summariser = CGI::Wiki::Plugin::Summariser->new; $wiki->register_plugin( plugin => $summariser ); =head1 METHODS =over 4 =item B my $summariser = CGI::Wiki::Plugin::Summariser->new; $wiki->register_plugin( plugin => $summariser ); =cut sub new { my $class = shift; my $self = {}; bless $self, $class; return $self; } =item B my @list = $summariser->metadata_list( type => "Category" ); =cut sub metadata_list { my ($self, %args) = @_; my $dbh = $self->datastore->dbh; my $sth; if ( $args{type} ) { $sth = $dbh->prepare( " SELECT DISTINCT metadata.metadata_value FROM metadata WHERE metadata.metadata_type = ? ORDER BY metadata.metadata_value " ); $sth->execute( $args{type} ); } else { $sth = $dbh->prepare( " SELECT DISTINCT metadata.metadata_value FROM metadata ORDER BY metadata.metadata_value " ); $sth->execute( ); } my @categories; while ( my ($cat) = $sth->fetchrow_array ) { push @categories, $cat; } return @categories; } =head1 SEE ALSO =over 4 =item * L =item * L =back =head1 AUTHOR Christopher Schmidt =head1 COPYRIGHT Copyright (C) 2005 Christopher Schmidt. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1;