added ability to configure number of files per page in the galleryalbum

This commit is contained in:
Doug Bell 2008-06-09 21:37:23 +00:00
parent e7260285be
commit b137688f65
5 changed files with 37 additions and 1 deletions

View file

@ -100,6 +100,7 @@
- added: A template variable to distinguish between Files and Albums in the Gallery
Search
- added: A thumbnail for Photo edit screen
- added: Configure the amount of files shown per page in the Gallery
7.5.10
- fix: Syntax error in GetCsMail

View file

@ -78,9 +78,24 @@ addLoginMessage( $session );
addNewApprovalActivities( $session );
addUserListWobject( $session );
addInheritUrlFromParent( $session );
addDefaultFilesPerPage( $session );
finish($session); # this line required
#----------------------------------------------------------------------------
# Add default files per page to the Gallery
sub addDefaultFilesPerPage {
my $session = shift;
print "\tAdding Default Files Per Page to Gallery... " unless $quiet;
$session->db->write(
"ALTER TABLE Gallery ADD COLUMN defaultFilesPerPage INT"
);
$session->db->write(
"UPDATE Gallery SET defaultFilesPerPage=24"
);
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Add two new approval activities
sub addNewApprovalActivities {

View file

@ -307,6 +307,13 @@ sub definition {
label => $i18n->get("workflowIdCommit label"),
hoverHelp => $i18n->get("workflowIdCommit description"),
},
defaultFilesPerPage => {
tab => 'display',
fieldType => 'integer',
defaultValue => 24,
label => $i18n->get( 'defaultFilesPerPage label' ),
hoverHelp => $i18n->get( 'defaultFilesPerPage description' ),
},
);
push @{$definition}, {

View file

@ -440,8 +440,9 @@ url to the current page that will be given to the paginator.
sub getFilePaginator {
my $self = shift;
my $url = shift || $self->getUrl;
my $perPage = $self->getParent->get( 'defaultFilesPerPage' );
my $p = WebGUI::Paginator->new( $self->session, $url );
my $p = WebGUI::Paginator->new( $self->session, $url, $perPage );
$p->setDataByArrayRef( $self->getFileIds );
return $p;

View file

@ -699,6 +699,18 @@ our $I18N = {
lastUpdated => 0,
context => q{Description of template variable},
},
'defaultFilesPerPage label' => {
message => q{Default Files Per Page},
lastUpdated => 0,
context => q{Asset property label},
},
'defaultFilesPerPage description' => {
message => q{The number of files to show per page of the album view.},
lastUpdated => 0,
context => q{Description of asset property},
},
};
1;