File Coverage

blib/lib/Labyrinth/Plugin/Articles/Lyrics.pm
Criterion Covered Total %
statement 13 15 86.6
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 18 20 90.0


line stmt bran cond sub pod time code
1             package Labyrinth::Plugin::Articles::Lyrics;
2              
3 5     5   75937 use warnings;
  5         9  
  5         150  
4 5     5   17 use strict;
  5         6  
  5         126  
5              
6 5     5   16 use vars qw($VERSION);
  5         8  
  5         317  
7             $VERSION = '1.02';
8              
9             =head1 NAME
10              
11             Labyrinth::Plugin::Articles::Lyrics - Lyrics plugin for the Labyrinth framework
12              
13             =head1 DESCRIPTION
14              
15             Contains all the lyrics handling functionality, as part of the Music Suite of
16             modules for the Labyrinth web framework.
17              
18             =head1 DESCRIPTION
19              
20             Contains all the lyrics handling functionality for Labyrinth.
21              
22             This module forms part 2 of the Music Suite of modules for the Labyrinth web
23             framework.
24              
25             The Lyrics module only contains the basic handling of lyrics. With a future
26             distribution, the lyrics and/or poems can be grouped into collections, which
27             can then be attributed as a release, such as an album or book.
28              
29             =head1 THE MUSIC SUITE
30              
31             The Music Suite are a collection of modules, which can be used separately or
32             collectively, to help implement music related websites. These include modules
33             for managing band member lyrics, MP3s, lyrics and discographies.
34              
35             =cut
36              
37             # -------------------------------------
38             # Library Modules
39              
40 5     5   25 use base qw(Labyrinth::Plugin::Articles);
  5         7  
  5         1706  
41              
42 5     5   3449 use Labyrinth::Audit;
  0            
  0            
43             use Labyrinth::DBUtils;
44             use Labyrinth::MLUtils;
45             use Labyrinth::Variables;
46              
47             # -------------------------------------
48             # Variables
49              
50             my $ALLSQL = 'AllArticles';
51             my $SECTIONID = 7;
52              
53             # -------------------------------------
54             # Public Methods
55              
56             sub List {
57             $cgiparams{sectionid} = $SECTIONID;
58             $settings{data}{article_limit} = $settings{lyrics_limit};
59             $settings{data}{article_stop} = $settings{lyrics_stop};
60             $settings{data}{order} = 'title';
61             shift->SUPER::List;
62             }
63              
64             # -------------------------------------
65             # Admin Methods
66              
67             sub Admin {
68             $cgiparams{sectionid} = $SECTIONID;
69             shift->SUPER::Admin;
70             }
71              
72             sub LyricSelect {
73             my ($opt,$blank) = @_;
74             my @list = $dbi->GetQuery('hash',$ALLSQL,{where => "WHERE sectionid=$SECTIONID"});
75             unshift @list, {articleid=>0,title=>'Select Lyric'} if(defined $blank && $blank == 1);
76             DropDownRows($opt,'lyricid','articleid','title',@list);
77             }
78              
79             1;
80              
81             __END__