fix: content handler and redirects
This commit is contained in:
parent
c776703568
commit
fb434a8b3a
26 changed files with 74 additions and 542 deletions
|
|
@ -192,16 +192,19 @@ sub editSave {
|
|||
if ($self->session->form->process("saveAndCommit") ne "") {
|
||||
if ($self->session->setting->get("skipCommitComments")) {
|
||||
$self->session->http->setRedirect($self->getUrl("op=commitVersionTagConfirm;tagId=".WebGUI::VersionTag->getWorking($self->session)->getId));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$self->session->http->setRedirect($self->getUrl("op=commitVersionTag;tagId=".WebGUI::VersionTag->getWorking($self->session)->getId));
|
||||
}
|
||||
return "1";
|
||||
return undef;
|
||||
}
|
||||
if ($self->session->setting->get("autoRequestCommit")) {
|
||||
if ($self->session->setting->get("skipCommitComments")) {
|
||||
WebGUI::VersionTag->getWorking($self->session)->requestCommit;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$self->session->http->setRedirect($self->getUrl("op=commitVersionTag;tagId=".WebGUI::VersionTag->getWorking($self->session)->getId));
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ sub www_viewRSS {
|
|||
$session->http->setRedirect($self->getRssUrl);
|
||||
}
|
||||
|
||||
return "";
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -115,24 +115,24 @@ A web executable method that redirects the user to the specified page, or displa
|
|||
=cut
|
||||
|
||||
sub www_view {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->noAccess() unless $self->canView;
|
||||
my $self = shift;
|
||||
return $self->session->privilege->noAccess() unless $self->canView;
|
||||
my $i18n = WebGUI::International->new($self->session, "Asset_Redirect");
|
||||
my $url = $self->get("redirectUrl");
|
||||
WebGUI::Macro::process($self->session, \$url);
|
||||
if ($self->session->var->isAdminOn() && $self->canEdit) {
|
||||
return $self->getAdminConsole->render($i18n->get("what do you want to do with this redirect").'
|
||||
<ul>
|
||||
<li><a href="'.$url.'">'.$i18n->get("go to the redirect url").'</a></li>
|
||||
<li><a href="'.$self->getUrl("func=edit").'">'.$i18n->get("edit the redirect properties").'</a></li>
|
||||
<li><a href="'.$self->getParent->getUrl.'">'.$i18n->get("go to the redirect parent page").'</a></li>
|
||||
</ul>',$i18n->get("assetName"));
|
||||
}
|
||||
unless ($url eq $self->get("url")) {
|
||||
$self->session->http->setRedirect($url);
|
||||
return 1;
|
||||
my $url = $self->get("redirectUrl");
|
||||
WebGUI::Macro::process($self->session, \$url);
|
||||
if ($self->session->var->isAdminOn() && $self->canEdit) {
|
||||
return $self->getAdminConsole->render($i18n->get("what do you want to do with this redirect").'
|
||||
<ul>
|
||||
<li><a href="'.$url.'">'.$i18n->get("go to the redirect url").'</a></li>
|
||||
<li><a href="'.$self->getUrl("func=edit").'">'.$i18n->get("edit the redirect properties").'</a></li>
|
||||
<li><a href="'.$self->getParent->getUrl.'">'.$i18n->get("go to the redirect parent page").'</a></li>
|
||||
</ul>',$i18n->get("assetName"));
|
||||
}
|
||||
unless ($url eq $self->get("url")) {
|
||||
$self->session->http->setRedirect($url);
|
||||
return undef;
|
||||
}
|
||||
return $i18n->get('self_referential');
|
||||
return $i18n->get('self_referential');
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ sub www_edit {
|
|||
sub www_goBackToPage {
|
||||
my $self = shift;
|
||||
$self->session->http->setRedirect($self->session->form->get("returnUrl")) if ($self->session->form->get("returnUrl"));
|
||||
return "";
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -348,10 +348,10 @@ sub www_view {
|
|||
return $self->session->privilege->noAccess();
|
||||
} elsif ($self->session->var->get("adminOn") && $self->get("state") =~ /^trash/) { # show em trash
|
||||
$self->session->http->setRedirect($self->getUrl("func=manageTrash"));
|
||||
return "";
|
||||
return undef;
|
||||
} elsif ($self->session->var->get("adminOn") && $self->get("state") =~ /^clipboard/) { # show em clipboard
|
||||
$self->session->http->setRedirect($self->getUrl("func=manageClipboard"));
|
||||
return "";
|
||||
return undef;
|
||||
} else { # tell em it doesn't exist anymore
|
||||
$self->session->http->setStatus("410");
|
||||
return WebGUI::Asset->getNotFound($self->session)->www_view;
|
||||
|
|
|
|||
|
|
@ -267,10 +267,11 @@ sub www_click {
|
|||
my $listing = $self->session->db->getRow("Matrix_listing","listingId",$self->session->form->process("listingId"));
|
||||
if ($self->session->form->process("m")) {
|
||||
$self->session->http->setRedirect($listing->{manufacturerUrl});
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$self->session->http->setRedirect($listing->{productUrl});
|
||||
}
|
||||
return "";
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ sub view {
|
|||
sub www_goBackToPage {
|
||||
my $self = shift;
|
||||
$self->session->http->setRedirect($self->session->form->process("returnUrl")) if ($self->session->form->process("returnUrl"));
|
||||
return "";
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -509,6 +509,7 @@ sub view {
|
|||
# webgui flow. This feature currently requires a patched WebGUI.pm file.
|
||||
if ($self->session->form->process('redirectURL')) {
|
||||
$self->session->http->setRedirect($self->session->form->process('redirectURL'));
|
||||
return undef;
|
||||
}
|
||||
|
||||
$var{'results'} = \@result;
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ sub www_view {
|
|||
return $self->getContainer->www_view;
|
||||
}
|
||||
$self->session->http->setRedirect($self->getFileUrl($self->getValue("showPage")));
|
||||
return "";
|
||||
return undef;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue