| 1 | package Labyrinth::Plugin::Articles::Lyrics; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use vars qw($VERSION); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 5 | $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 | ▶ | use base qw(Labyrinth::Plugin::Articles); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 5 | ▶ | use Labyrinth::Audit; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 43 | 5 | ▶ | use Labyrinth::DBUtils; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 44 | 5 | ▶ | use Labyrinth::MLUtils; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 45 | 5 | ▶ | use Labyrinth::Variables; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | # ------------------------------------- | ||||||||||||||||||||||||||||
| 48 | # Variables | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 5 | my $ALLSQL = 'AllArticles'; | |||||||||||||||||||||||||||
| 51 | 5 | my $SECTIONID = 7; | |||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | # ------------------------------------- | ||||||||||||||||||||||||||||
| 54 | # Public Methods | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | sub List { | ||||||||||||||||||||||||||||
| 57 | 0 | ▶ | $cgiparams{sectionid} = $SECTIONID; | ||||||||||||||||||||||||||
|
Subroutine
List: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 58 | 0 | $settings{data}{article_limit} = $settings{lyrics_limit}; | |||||||||||||||||||||||||||
| 59 | 0 | $settings{data}{article_stop} = $settings{lyrics_stop}; | |||||||||||||||||||||||||||
| 60 | 0 | $settings{data}{order} = 'title'; | |||||||||||||||||||||||||||
| 61 | 0 | shift->SUPER::List; | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | # ------------------------------------- | ||||||||||||||||||||||||||||
| 65 | # Admin Methods | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | sub Admin { | ||||||||||||||||||||||||||||
| 68 | 0 | ▶ | $cgiparams{sectionid} = $SECTIONID; | ||||||||||||||||||||||||||
|
Subroutine
Admin: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 69 | 0 | shift->SUPER::Admin; | |||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | sub LyricSelect { | ||||||||||||||||||||||||||||
| 73 | 0 | ▶ | my ($opt,$blank) = @_; | ||||||||||||||||||||||||||
|
Subroutine
LyricSelect: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 74 | 0 | my @list = $dbi->GetQuery('hash',$ALLSQL,{where => "WHERE sectionid=$SECTIONID"}); | |||||||||||||||||||||||||||
| 75 | 0 | ▶ | unshift @list, {articleid=>0,title=>'Select Lyric'} if(defined $blank && $blank == 1); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $blank and $blank == 1
MC/DC0%0/2
defined $blank and $blank == 1
defined $blank
$blank == 1
Truth table0%0/3
A and B
A= defined $blankB= $blank == 1
| |||||||||||||||||||||||||||||
| 76 | 0 | DropDownRows($opt,'lyricid','articleid','title',@list); | |||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | 5 | 1; | |||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | __END__ | ||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | # ------------------------------------- | ||||||||||||||||||||||||||||
| 84 | # Documentation | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | =head1 PUBLIC INTERFACE METHODS | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | =over 4 | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | =item List | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | Retrieves an initial list of lyric entries. Primarily used to prepare a front | ||||||||||||||||||||||||||||
| 93 | page. | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | =item Item | ||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | Provides a single lyric entry. | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | =back | ||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | =head1 ADMIN INTERFACE METHODS | ||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | =over 4 | ||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | =item Access | ||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | Check whether user has the appropriate admin access. | ||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | =item Admin | ||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | Lists the current set of lyric entries. | ||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | Also provides the delete, copy and promote functionality from the main | ||||||||||||||||||||||||||||
| 114 | administration page for the given section. | ||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||
| 116 | =item LyricSelect | ||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | Provides a drop-down select box of lyrics within the system. The method is | ||||||||||||||||||||||||||||
| 119 | intended to be called via other plugins. | ||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | =item Add | ||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | Add a lyric entry. | ||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | =item Edit | ||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | Edit a lyric entry. | ||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||
| 129 | =item Save | ||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||
| 131 | Save a lyric entry. | ||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||
| 133 | =item Delete | ||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||
| 135 | Delete a lyric entry. | ||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||
| 137 | =item AddParagraph | ||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | Add a text block to the current article. | ||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||
| 141 | =item AddImage | ||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||
| 143 | Add an image block to the current article. | ||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||
| 145 | =item AddLink | ||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | Add a link block to the current article. | ||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||
| 149 | =item DeleteItem | ||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||
| 151 | Delete an article block. | ||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||
| 153 | =item Relocate | ||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||
| 155 | Relocate an article in a list, where an order is in use. | ||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||
| 157 | =back | ||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||
| 159 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | Labyrinth | ||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | Barbie, <barbie@missbarbell.co.uk> for | ||||||||||||||||||||||||||||
| 166 | Miss Barbell Productions, L<http://www.missbarbell.co.uk/> | ||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||
| 168 | =head1 COPYRIGHT & LICENSE | ||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||
| 170 | Copyright (C) 2002-2014 Barbie for Miss Barbell Productions | ||||||||||||||||||||||||||||
| 171 | All Rights Reserved. | ||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||
| 173 | This distribution is free software; you can redistribute it and/or | ||||||||||||||||||||||||||||
| 174 | modify it under the Artistic Licence v2. | ||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||
| 176 | =cut | ||||||||||||||||||||||||||||