bug fixes
This commit is contained in:
parent
d61701698c
commit
29a5edc3c6
7 changed files with 34 additions and 39 deletions
|
|
@ -258,8 +258,7 @@ sub build {
|
|||
$pageData->{"page.relDepth"} = $pageData->{"page.absDepth"} - $startPageDepth;
|
||||
$pageData->{"page.isCurrent"} = ($page->{'pageId'} == $session{page}{pageId});
|
||||
$pageData->{"page.isHidden"} = $page->{'hideFromNavigation'};
|
||||
$pageData->{"page.isSystem"} = ($page->{'pageId'} =~ /^\d+$/ &&
|
||||
($page->{'pageId'} < 1000 && $page->{'pageId'} >= 0));
|
||||
$pageData->{"page.isSystem"} = $page->{isSystem};
|
||||
|
||||
# indent
|
||||
my $indent = 0;
|
||||
|
|
@ -287,7 +286,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}));
|
||||
|
|
@ -347,7 +346,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};
|
||||
|
|
|
|||
|
|
@ -193,41 +193,36 @@ The depth the tree should start with. Defaults to zero.
|
|||
|
||||
=cut
|
||||
sub _traversePageTree {
|
||||
my ($top, $initialDepth, %wobject, $output, $spacer, $page, $currentPage, $options, $currentPageId, $currentUrlizedTitle, $wobjects);
|
||||
($top, $initialDepth) = @_;
|
||||
my (%wobject, $output, $spacer, $page, $currentPage, $options, $currentPageId, $currentUrlizedTitle, $wobjects);
|
||||
my ($parentId, $initialDepth) = @_;
|
||||
|
||||
tie %wobject, 'Tie::CPHash';
|
||||
$spacer = '<img src="'.$session{config}{extrasURL}.'/spacer.gif" width=12>';
|
||||
$page = WebGUI::Page->getPage($top);
|
||||
|
||||
$page->traversePreOrder(
|
||||
sub {
|
||||
($currentPage, $options) = @_;
|
||||
$currentPageId = $currentPage->get('pageId');
|
||||
$currentUrlizedTitle = $currentPage->get('urlizedTitle');
|
||||
if ($currentPageId < 2 || $currentPageId > 999) {
|
||||
$output .= $spacer x $options->{_depth}
|
||||
.pageIcon()
|
||||
.deleteIcon('op=deletePage',$currentUrlizedTitle)
|
||||
.moveLeftIcon(sprintf('op=moveTreePageLeft&pageId=%s',$currentPageId), $currentUrlizedTitle)
|
||||
.moveUpIcon(sprintf('op=moveTreePageUp&pageId=%s',$currentPageId), $currentUrlizedTitle)
|
||||
.moveDownIcon(sprintf('op=moveTreePageDown&pageId=%s',$currentPageId), $currentUrlizedTitle)
|
||||
.moveRightIcon(sprintf('op=moveTreePageRight&pageId=%s',$currentPageId), $currentUrlizedTitle)
|
||||
.editIcon('op=editPage', $currentUrlizedTitle)
|
||||
.' <a href="'.WebGUI::URL::gateway($currentUrlizedTitle).'">'.$currentPage->get('title').'</a><br>';
|
||||
$wobjects = WebGUI::SQL->read("select * from wobject where pageId=".quote($currentPageId));
|
||||
while (%wobject = $wobjects->hash) {
|
||||
$output .= $spacer x $options->{_depth} . $spacer
|
||||
.wobjectIcon()
|
||||
.deleteIcon('func=delete&wid='.$wobject{wobjectId},$currentUrlizedTitle)
|
||||
.editIcon('func=edit&wid='.$wobject{wobjectId},$currentUrlizedTitle)
|
||||
.' '. $wobject{title}.'<br>';
|
||||
}
|
||||
$wobjects->finish;
|
||||
my $sth = WebGUI::SQL->read("select pageId,isSystem,urlizedTitle,title from page where parentId=".$parentId);
|
||||
while (my ($pageId,$isSystem,$url,$title) = $sth->array) {
|
||||
unless ($isSystem) {
|
||||
$output .= $spacer x $options->{_depth}
|
||||
.pageIcon()
|
||||
.deleteIcon('op=deletePage',$url)
|
||||
.moveLeftIcon(sprintf('op=moveTreePageLeft&pageId=%s',$pageId), $url)
|
||||
.moveUpIcon(sprintf('op=moveTreePageUp&pageId=%s',$pageId), $url)
|
||||
.moveDownIcon(sprintf('op=moveTreePageDown&pageId=%s',$pageId), $url)
|
||||
.moveRightIcon(sprintf('op=moveTreePageRight&pageId=%s',$pageId), $url)
|
||||
.editIcon('op=editPage', $url)
|
||||
.' <a href="'.WebGUI::URL::gateway($url).'">'.$title.'</a><br>';
|
||||
$wobjects = WebGUI::SQL->read("select wobjectId,title from wobject where pageId=".quote($pageId));
|
||||
while (%wobject = $wobjects->hash) {
|
||||
$output .= $spacer x $options->{_depth} . $spacer
|
||||
.wobjectIcon()
|
||||
.deleteIcon('func=delete&wid='.$wobject{wobjectId},$url)
|
||||
.editIcon('func=edit&wid='.$wobject{wobjectId},$url)
|
||||
.' '. $wobject{title}.'<br>';
|
||||
}
|
||||
$wobjects->finish;
|
||||
$output .= _traversePageTree($pageId,$initialDepth+1);
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
$sth->finish;
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,12 +90,12 @@ Some OO style methods
|
|||
|
||||
@array = $page->ancestors;
|
||||
@array = $page->daughters;
|
||||
@array = $page->decendants;
|
||||
@array = $page->descendants;
|
||||
@array = $page->generation;
|
||||
@array = $page->leaves_under;
|
||||
@array = $page->pedigree;
|
||||
@array = $page->self_and_ancesters;
|
||||
@array = $page->self_and_decendants;
|
||||
@array = $page->self_and_descendants;
|
||||
@array = $page->self_and_sisters;
|
||||
@array = $page->self_and_sisters_splitted;
|
||||
@array = $page->sisters;
|
||||
|
|
|
|||
|
|
@ -632,6 +632,7 @@ sub www_editSubmissionSave {
|
|||
delete $pageVars{parentId};
|
||||
delete $pageVars{sequenceNumber};
|
||||
$pageVars{hideFromNavigation} = 1;
|
||||
$pageVars{isSystem} = 1;
|
||||
$pageVars{subroutine} = "viewSubmissionAsPage";
|
||||
$pageVars{subroutinePackage} = "WebGUI::Wobject::USS";
|
||||
$pageVars{subroutineParams} = "{wobjectId=>'".$_[0]->wid."',submissionId=>'".$session{form}{sid}."'}";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue