added: Sort Items switch to Syndicated Content asset

This commit is contained in:
Graham Knop 2010-03-26 09:15:19 -05:00
parent 0a493211ee
commit 445486e291
4 changed files with 37 additions and 3 deletions

View file

@ -1,5 +1,6 @@
7.9.2
- added #11412: Additional navigation in Gallery Photo View
- added: Sort Items switch to Syndicated Content asset
7.9.1
- fixed #11464: blank page after setting posts per page in Collaboration System to 0 (zero)

View file

@ -30,7 +30,7 @@ my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
addSortItemsSCColumn($session);
finish($session); # this line required
@ -44,6 +44,22 @@ finish($session); # this line required
# print "DONE!\n" unless $quiet;
#}
#----------------------------------------------------------------------------
sub addSortItemsSCColumn {
my $session = shift;
print "\tAdding sort items switch to Syndicated Content... " unless $quiet;
my $sth = $session->db->read('DESCRIBE `SyndicatedContent`');
while (my ($col) = $sth->array) {
if ($col eq 'sortItems') {
print "Skipped.\n" unless $quiet;
return;
}
}
$session->db->write('ALTER TABLE SyndicatedContent ADD COLUMN sortItems BOOL DEFAULT 1');
print "Done.\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------

View file

@ -106,7 +106,14 @@ sub definition {
label=>$i18n->get('hasTermsLabel'),
hoverHelp=>$i18n->get('hasTermsLabel description'),
maxlength=>255
}
},
sortItems => {
tab => 'properties',
fieldType => 'yesNo',
defaultValue => 1,
label => $i18n->get('sortItemsLabel'),
hoverHelp => $i18n->get('sortItemsLabel description'),
},
);
push(@{$definition}, {
assetName=>$i18n->get('assetName'),
@ -185,7 +192,9 @@ sub generateFeed {
}
# sort them by date and remove any duplicate from the OR based term matching above
$feed->sort_item();
if ($self->get('sortItems')) {
$feed->sort_item();
}
# limit the feed to the maximum number of headlines (or the feed generator limit).
$feed->limit_item($limit);

View file

@ -244,6 +244,14 @@ our $I18N = {
lastUpdated => 1168227896,
},
'sortItemsLabel' => {
message => q{Sort feed items by date?},
},
'sortItemsLabel description' => {
message => q{If enabled, items will be sorted by date. If disabled, items will be left in the order they appear in the original feed.},
},
'syndicated content asset template variables title' => {
message => q|Syndicated Content Asset Template Variables|,
lastUpdated => 1164841146