Fixed bugs in navigation template vars and privilege bug in WG::A::File. Also added page.parent.rank tmpl_var to the nav template.

This commit is contained in:
Martin Kamerbeek 2006-07-19 15:16:53 +00:00
parent 209e529a45
commit e3b558fc2b
5 changed files with 23 additions and 6 deletions

View file

@ -251,6 +251,7 @@ sub processPropertiesFromFormPost {
delete $self->{_storageLocation};
my $storage = $self->getStorageLocation;
my $filename = $storage->addFileFromFormPost("file",1);
$storage->setPrivileges($self->get('ownerUserId'), $self->get('groupIdView'), $self->get('groupIdEdit'));
if (defined $filename && $filename ne $self->get("filename")) {
my %data;
$data{filename} = $filename;

View file

@ -438,9 +438,9 @@ sub view {
++$var->{"currentPage.hasSibling"}
if $pageData->{"page.isSibling"};
++$var->{"currentPage.hasViewableSiblings"}
if ($pageData->{"page.isSibling"} && $pageData->{"isViewable"});
if ($pageData->{"page.isSibling"} && $pageData->{"page.isViewable"});
++$var->{"currentPage.hasViewableChildren"}
if ($pageData->{"page.isChild"} && $pageData->{"isViewable"});
if ($pageData->{"page.isChild"} && $pageData->{"page.isViewable"});
my $parent = $asset->getParent;
if (defined $parent) {
@ -449,7 +449,8 @@ sub view {
}
$pageData->{'page.parent.menuTitle'} = $parent->getMenuTitle;
$pageData->{'page.parent.title'} = $parent->getTitle;
$pageData->{"page.parent.url"} = $parent->getUrl;
$pageData->{"page.parent.url"} = $parent->getUrl;
$pageData->{"page.parent.rank"} = $parent->getRank;
$pageData->{"page.isRankedFirst"} = 1 unless exists $lastChildren{$parent->getId};
$lastChildren{$parent->getId} = $asset->getId;
}

View file

@ -265,7 +265,10 @@ our $HELP = {
},
{
'name' => 'page.parent.newWindow'
}
},
{
'name' => 'page.parent.rank'
},
]
}
],

View file

@ -529,6 +529,12 @@ a Google sitemap of your site.</p>
lastUpdated => 1149394665,
},
'page.parent.rank' => {
message => q|The rank of the mother of this page.|,
lastUpdated => 1153314572,
},
'1097' => {
message => q|<p>These variables are available in Navigation Templates:</p>
|,