Adding reverse page loop
This commit is contained in:
parent
e3b558fc2b
commit
75b03b006e
5 changed files with 42 additions and 3 deletions
|
|
@ -25,7 +25,8 @@
|
||||||
Kamerbeek / Procolix)
|
Kamerbeek / Procolix)
|
||||||
- Fixed a bug where WebGUI::Asset::File->addRevision did not set correct
|
- Fixed a bug where WebGUI::Asset::File->addRevision did not set correct
|
||||||
privs to the storage associated with it. (Martin Kamerbeek / Procolix)
|
privs to the storage associated with it. (Martin Kamerbeek / Procolix)
|
||||||
|
- Added a reverse page loop option to the navigation asset (Martin
|
||||||
|
Kamerbeek / Procolix)
|
||||||
|
|
||||||
7.0.1
|
7.0.1
|
||||||
- fix: User profile field "Department" needs i18n
|
- fix: User profile field "Department" needs i18n
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ use lib "../../lib";
|
||||||
use strict;
|
use strict;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
|
use WebGUI::Utility;
|
||||||
|
|
||||||
my $toVersion = "7.0.2"; # make this match what version you're going to
|
my $toVersion = "7.0.2"; # make this match what version you're going to
|
||||||
my $quiet; # this line required
|
my $quiet; # this line required
|
||||||
|
|
@ -22,6 +22,7 @@ my $session = start(); # this line required
|
||||||
|
|
||||||
# upgrade functions go here
|
# upgrade functions go here
|
||||||
addAdminToVisitorGroup($session);
|
addAdminToVisitorGroup($session);
|
||||||
|
addReversePageLoopColumn($session);
|
||||||
|
|
||||||
finish($session); # this line required
|
finish($session); # this line required
|
||||||
|
|
||||||
|
|
@ -32,6 +33,16 @@ sub addAdminToVisitorGroup {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub addReversePageLoopColumn {
|
||||||
|
my $session = shift;
|
||||||
|
print "\tAdding the reversePageLoop column to the Navigation table\n" unless ($quiet);
|
||||||
|
|
||||||
|
my @columns = $session->db->buildArray('describe Navigation');
|
||||||
|
unless (isIn('reversePageLoop', @columns)) {
|
||||||
|
$session->db->write('alter table Navigation add column reversePageLoop tinyint(1) default 0');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
##-------------------------------------------------
|
##-------------------------------------------------
|
||||||
#sub exampleFunction {
|
#sub exampleFunction {
|
||||||
# my $session = shift;
|
# my $session = shift;
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,11 @@ sub definition {
|
||||||
showUnprivilegedPages=>{
|
showUnprivilegedPages=>{
|
||||||
fieldType=>'yesNo',
|
fieldType=>'yesNo',
|
||||||
defaultValue=>0
|
defaultValue=>0
|
||||||
}
|
},
|
||||||
|
reversePageLoop=>{
|
||||||
|
fieldType=>'yesNo',
|
||||||
|
defaultValue=>0
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return $class->SUPER::definition($session, $definition);
|
return $class->SUPER::definition($session, $definition);
|
||||||
|
|
@ -222,6 +226,12 @@ sub getEditForm {
|
||||||
-hoverHelp=>$i18n->get('32 description'),
|
-hoverHelp=>$i18n->get('32 description'),
|
||||||
-value=>$self->getValue("showUnprivilegedPages")
|
-value=>$self->getValue("showUnprivilegedPages")
|
||||||
);
|
);
|
||||||
|
$tabform->getTab("display")->yesNo(
|
||||||
|
-name=>'reversePageLoop',
|
||||||
|
-label=>$i18n->get('reverse page loop'),
|
||||||
|
-hoverHelp => $i18n->get('reverse page loop description'),
|
||||||
|
-value=>$self->getValue('reversePageLoop'),
|
||||||
|
);
|
||||||
my $start = $self->getValue("startPoint");
|
my $start = $self->getValue("startPoint");
|
||||||
$tabform->getTab("properties")->raw("<script type=\"text/javascript\">
|
$tabform->getTab("properties")->raw("<script type=\"text/javascript\">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
|
|
@ -345,11 +355,14 @@ sub view {
|
||||||
}
|
}
|
||||||
$start = $current unless (defined $start); # if none of the above results in a start point, then the current page must be it
|
$start = $current unless (defined $start); # if none of the above results in a start point, then the current page must be it
|
||||||
my @includedRelationships = split("\n",$self->get("assetsToInclude"));
|
my @includedRelationships = split("\n",$self->get("assetsToInclude"));
|
||||||
|
|
||||||
my %rules;
|
my %rules;
|
||||||
$rules{returnObjects} = 1;
|
$rules{returnObjects} = 1;
|
||||||
$rules{endingLineageLength} = $start->getLineageLength+$self->get("descendantEndPoint");
|
$rules{endingLineageLength} = $start->getLineageLength+$self->get("descendantEndPoint");
|
||||||
$rules{assetToPedigree} = $current if (isIn("pedigree",@includedRelationships));
|
$rules{assetToPedigree} = $current if (isIn("pedigree",@includedRelationships));
|
||||||
$rules{ancestorLimit} = $self->get("ancestorEndPoint");
|
$rules{ancestorLimit} = $self->get("ancestorEndPoint");
|
||||||
|
$rules{orderByClause} = 'rpad(asset.lineage, 255, 9) desc' if ($self->get('reversePageLoop'));
|
||||||
|
|
||||||
my $assets = $start->getLineage(\@includedRelationships,\%rules);
|
my $assets = $start->getLineage(\@includedRelationships,\%rules);
|
||||||
my $var = {'page_loop' => []};
|
my $var = {'page_loop' => []};
|
||||||
my @interestingProperties = ('assetId', 'parentId', 'ownerUserId', 'synopsis', 'newWindow');
|
my @interestingProperties = ('assetId', 'parentId', 'ownerUserId', 'synopsis', 'newWindow');
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,11 @@ our $HELP = {
|
||||||
description => '32 description',
|
description => '32 description',
|
||||||
namespace => 'Asset_Navigation',
|
namespace => 'Asset_Navigation',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title => 'reverse page loop',
|
||||||
|
description => 'reverse page loop description',
|
||||||
|
namespace => 'Asset_Navigation',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
related => [
|
related => [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -534,6 +534,15 @@ a Google sitemap of your site.</p>
|
||||||
lastUpdated => 1153314572,
|
lastUpdated => 1153314572,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'reverse page loop' => {
|
||||||
|
message => q|Reverse page loop|,
|
||||||
|
lastUpdated => 1153314572,
|
||||||
|
},
|
||||||
|
|
||||||
|
'reverse page loop description' => {
|
||||||
|
message => q|Reverses the order of all pages while maintaining hierarchy.|,
|
||||||
|
lastUpdated => 1153314572,
|
||||||
|
},
|
||||||
|
|
||||||
'1097' => {
|
'1097' => {
|
||||||
message => q|<p>These variables are available in Navigation Templates:</p>
|
message => q|<p>These variables are available in Navigation Templates:</p>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue