fixed some bugs related to guids
This commit is contained in:
parent
407c13495d
commit
e570009912
2 changed files with 10 additions and 14 deletions
|
|
@ -248,7 +248,6 @@ sub build {
|
|||
|
||||
foreach my $page (@pages) {
|
||||
my $pageData = {};
|
||||
|
||||
# Initial page info
|
||||
$pageData->{"page.url"} = WebGUI::URL::gateway($page->{'urlizedTitle'});
|
||||
if ($page->{'encryptPage'}) {
|
||||
|
|
@ -256,7 +255,7 @@ sub build {
|
|||
}
|
||||
$pageData->{"page.absDepth"} = $page->{'depth'} + 1;
|
||||
$pageData->{"page.relDepth"} = $pageData->{"page.absDepth"} - $startPageDepth;
|
||||
$pageData->{"page.isCurrent"} = ($page->{'pageId'} == $session{page}{pageId});
|
||||
$pageData->{"page.isCurrent"} = ($page->{'pageId'} eq $session{page}{pageId});
|
||||
$pageData->{"page.isHidden"} = $page->{'hideFromNavigation'};
|
||||
$pageData->{"page.isSystem"} = $page->{isSystem};
|
||||
|
||||
|
|
@ -286,7 +285,7 @@ sub build {
|
|||
next if ($pageData->{"page.absDepth"} < $self->{_stopAtLevel});
|
||||
|
||||
# Check showSystemPages
|
||||
# next if (! $self->{_showSystemPages} && $pageData->{"page.isSystem"});
|
||||
next if (! $self->{_showSystemPages} && $pageData->{"page.isSystem"});
|
||||
|
||||
# Deal with hidden pages, don't ever hide pages if admin mode is on
|
||||
next if(($page->{'hideFromNavigation'} && ! $self->{_showHiddenPages}) && (! $session{var}{adminOn}));
|
||||
|
|
@ -298,17 +297,15 @@ sub build {
|
|||
$pageData->{"page.isRoot"} = (! $page->{'parentId'});
|
||||
$pageData->{"page.isTop"} = ($pageData->{"page.absDepth"} == 2);
|
||||
$pageData->{"page.hasDaughter"} = ($page->{'nestedSetRight'} - $page->{'nestedSetLeft'} > 1);
|
||||
$pageData->{"page.isMyDaughter"} = ($page->{'parentId'} ==
|
||||
$currentPage->get('pageId'));
|
||||
$pageData->{"page.isMyMother"} = ($page->{'pageId'} ==
|
||||
$currentPage->get('parentId'));
|
||||
$pageData->{"page.isMyDaughter"} = ($page->{'parentId'} eq $currentPage->get('pageId'));
|
||||
$pageData->{"page.isMyMother"} = ($page->{'pageId'} eq $currentPage->get('parentId'));
|
||||
$pageData->{"page.inCurrentRoot"} =
|
||||
(($page->{'nestedSetLeft'} > $currentPage->get('nestedSetLeft')) && ($page->{'nestedSetRight'} < $currentPage->get('nestedSetRight'))) ||
|
||||
(($page->{'nestedSetLeft'} < $currentPage->get('nestedSetLeft')) && ($page->{'nestedSetRight'} > $currentPage->get('nestedSetRight')));
|
||||
|
||||
# Anchestor info
|
||||
foreach my $ancestor ($currentPage->ancestors) {
|
||||
$pageData->{"page.isMyAncestor"} += ($ancestor->{'pageId'} == $page->{'pageId'});
|
||||
$pageData->{"page.isMyAncestor"} += ($ancestor->{'pageId'} eq $page->{'pageId'});
|
||||
}
|
||||
|
||||
# Some information about my mother
|
||||
|
|
@ -346,7 +343,7 @@ sub build {
|
|||
}
|
||||
|
||||
# We had a cache miss, so let's put the data in cache
|
||||
# $cache->set(\@page_loop, 3600*24) unless $session{var}{adminOn};
|
||||
$cache->set(\@page_loop, 3600*24) unless $session{var}{adminOn};
|
||||
} else {
|
||||
# We had a cache hit
|
||||
@page_loop = @{$cacheContent};
|
||||
|
|
@ -355,7 +352,6 @@ sub build {
|
|||
# Do the user-dependent checks (which cannot be cached globally)
|
||||
foreach my $pageData (@page_loop) {
|
||||
$pageData->{"page.isViewable"} = WebGUI::Page::canView($pageData->{'page.pageId'});
|
||||
|
||||
# Check privileges
|
||||
if ($pageData->{"page.isViewable"} || $self->{_showUnprivilegedPages}) {
|
||||
push (@{$var->{page_loop}}, $pageData);
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ sub _processWobjectFunctions {
|
|||
and WobjectProxy.proxiedWobjectId=".quote(${$wobject}{wobjectId}),WebGUI::SQL->getSlave);
|
||||
${$wobject}{_WobjectProxy} = $proxyWobjectId;
|
||||
}
|
||||
unless (${$wobject}{pageId} == $session{page}{pageId}
|
||||
unless (${$wobject}{pageId} eq $session{page}{pageId}
|
||||
|| ${$wobject}{pageId} == 2
|
||||
|| ${$wobject}{pageId} == 3
|
||||
|| ${$wobject}{_WobjectProxy} ne "") {
|
||||
|
|
@ -261,7 +261,7 @@ sub canEdit {
|
|||
} else {
|
||||
%page = %{$session{page}};
|
||||
}
|
||||
if ($session{user}{userId} == $page{ownerId}) {
|
||||
if ($session{user}{userId} eq $page{ownerId}) {
|
||||
return 1;
|
||||
} else {
|
||||
return WebGUI::Grouping::isInGroup($page{groupIdEdit});
|
||||
|
|
@ -355,7 +355,7 @@ sub canView {
|
|||
} else {
|
||||
%page = WebGUI::SQL->quickHash("select ownerId,groupIdView,startDate,endDate from page where pageId=".quote($pageId),WebGUI::SQL->getSlave);
|
||||
}
|
||||
if ($session{user}{userId} == $page{ownerId}) {
|
||||
if ($session{user}{userId} eq $page{ownerId}) {
|
||||
return 1;
|
||||
} elsif ($page{startDate} < WebGUI::DateTime::time() && $page{endDate} > WebGUI::DateTime::time() && WebGUI::Grouping::isInGroup($page{groupIdView})) {
|
||||
return 1;
|
||||
|
|
@ -1533,7 +1533,7 @@ sub self_and_sisters_splitted {
|
|||
|
||||
$haveAllLeftSisters = 0;
|
||||
foreach ($self->self_and_sisters) {
|
||||
if ($_->{pageId} == $self->get('pageId')) {
|
||||
if ($_->{pageId} eq $self->get('pageId')) {
|
||||
$currentPage = $_;
|
||||
$haveAllLeftSisters = 1;
|
||||
} elsif ($haveAllLeftSisters) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue