diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt
index 5ccc60e10..96e0f388c 100644
--- a/docs/changelog/6.x.x.txt
+++ b/docs/changelog/6.x.x.txt
@@ -31,6 +31,8 @@
- Added a config file option to specify where the file cache is persisted.
- Added complete documentation of all WebGUI config file options to the
default config file.
+ - Added an end point to limit ancestors in navigation.
+ - Added missing international entries for Navigation.
- fix [1177858] lib/WebGUI/i18n/English/Macros.pm can not translated
diff --git a/docs/upgrades/upgrade_6.5.6-6.6.0.sql b/docs/upgrades/upgrade_6.5.6-6.6.0.sql
index fdde76d03..92b53240c 100644
--- a/docs/upgrades/upgrade_6.5.6-6.6.0.sql
+++ b/docs/upgrades/upgrade_6.5.6-6.6.0.sql
@@ -4,3 +4,6 @@ update template set template='^StyleSheet(^Extras;/slidePanel/slidePanel.css);\r
alter table DataForm add column defaultView int(11) DEFAULT 0 NOT NULL;
update template set template = '\">\n\n
' where assetId='PBtmpl0000000000000021';
+alter table Navigation change endPoint descendantEndPoint int not null default 55;
+alter table Navigation add column anscestorEndPoint int not null default 55;
+
diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm
index 80f279e09..157bac9f4 100644
--- a/lib/WebGUI/Asset.pm
+++ b/lib/WebGUI/Asset.pm
@@ -1233,6 +1233,10 @@ An integer limiting the length of the lineages of the assets to be returned. Thi
An asset object reference to draw a pedigree from. A pedigree includes ancestors, siblings, descendants and other information. It's specifically used in flexing navigations.
+=head4 ancestorLimit
+
+An integer describing how many levels of ancestry from the start point that should be retrieved.
+
=head4 excludeClasses
An array reference containing a list of asset classes to remove from the result set. The opposite of the includOnlyClasses rule.
@@ -1276,9 +1280,12 @@ sub getLineage {
# ancestors too
my @specificFamilyMembers = ();
if (isIn("ancestors",@{$relatives})) {
+ my $i = 1;
my @familyTree = ($lineage =~ /(.{6})/g);
while (pop(@familyTree)) {
push(@specificFamilyMembers,join("",@familyTree)) if (scalar(@familyTree));
+ last if ($i >= $rules->{ancestorLimit});
+ $i++;
}
}
# let's add ourself to the list
diff --git a/lib/WebGUI/Asset/Wobject/Navigation.pm b/lib/WebGUI/Asset/Wobject/Navigation.pm
index a8ce07c53..fa7dc47a7 100644
--- a/lib/WebGUI/Asset/Wobject/Navigation.pm
+++ b/lib/WebGUI/Asset/Wobject/Navigation.pm
@@ -52,7 +52,11 @@ sub definition {
fieldType=>'text',
defaultValue=>0
},
- endPoint=>{
+ ancestorEndPoint=>{
+ fieldType=>'selectList',
+ defaultValue=>55
+ },
+ descendantEndPoint=>{
fieldType=>'selectList',
defaultValue=>55
},
@@ -102,65 +106,86 @@ sub getEditForm {
$pedigreeChecked = 1;
}
}
+ my $i18n = WebGUI::International->new("Asset_Navigation");
$tabform->getTab("properties")->selectList(
-name=>"startType",
-options=>{
- specificUrl=>'Specific URL',
- relativeToCurrentUrl=>'Relative To Current URL',
- relativeToRoot=>'Relative To Root'
+ specificUrl=>$i18n->get('Specific URL'),
+ relativeToCurrentUrl=>$i18n->get('Relative To Current URL'),
+ relativeToRoot=>$i18n->get('Relative To Root')
},
-value=>[$self->getValue("startType")],
- -label=>"Start Point Type",
+ -label=>$i18n->get("Start Point Type"),
-extras=>'id="navStartType" onChange="changeStartPoint()"'
);
$tabform->getTab("properties")->readOnly(
- -label=>"Start Point",
+ -label=>$i18n->get("Start Point"),
-value=>''
);
+ my %options = ();
+ tie %options, 'Tie::IxHash';
+ %options = (
+ '1'=>'../ (-1)',
+ '2'=>'../../ (-2)',
+ '3'=>'../../../ (-3)',
+ '4'=>'../../../../ (-4)',
+ '5'=>'../../../../../ (-5)',
+ '55'=>$i18n->get('Infinity')
+ );
+ $tabform->getTab("properties")->raw(
+ '