Added proxying by alternate criteria to WobjectProxy

This commit is contained in:
Len Kranendonk 2004-07-22 18:51:07 +00:00
parent d7171e5d49
commit 02d24c4e4c
13 changed files with 515 additions and 31 deletions

View file

@ -31,6 +31,7 @@ use WebGUI::Style;
use WebGUI::Template;
use WebGUI::Utility;
use DBIx::Tree::NestedSet;
use WebGUI::MetaData;
our @ISA = qw(DBIx::Tree::NestedSet);
@ -478,7 +479,10 @@ sub generate {
if (${$wobject}{namespace} eq "WobjectProxy") {
my $originalWobject = $wobject;
my ($wobjectProxy) = WebGUI::SQL->quickHashRef("select * from WobjectProxy where wobjectId=".${$wobject}{wobjectId},WebGUI::SQL->getSlave);
$wobject = WebGUI::SQL->quickHashRef("select * from wobject where wobject.wobjectId=".$wobjectProxy->{proxiedWobjectId},WebGUI::SQL->getSlave);
if($wobjectProxy->{proxyByCriteria}) {
$wobjectProxy->{proxiedWobjectId} = WebGUI::MetaData::getWobjectByCriteria($wobjectProxy) || $wobjectProxy->{proxiedWobjectId};
}
$wobject = WebGUI::SQL->quickHashRef("select * from wobject where wobject.wobjectId=".$wobjectProxy->{proxiedWobjectId},WebGUI::SQL->getSlave);
if (${$wobject}{namespace} eq "") {
$wobject = $originalWobject;
} else {