Updated the package system to work with wobjects.
This commit is contained in:
parent
ea23644278
commit
e27419d23b
1 changed files with 13 additions and 8 deletions
|
|
@ -22,14 +22,19 @@ our @ISA = qw(Exporter);
|
||||||
our @EXPORT = qw(&www_deployPackage &www_selectPackageToDeploy);
|
our @EXPORT = qw(&www_deployPackage &www_selectPackageToDeploy);
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub _duplicateWidgets {
|
sub _duplicateWobjects {
|
||||||
my ($b, $widgetId, $widgetType, $func);
|
my ($sth, $wobject, $cmd, %hash, $extra, $w);
|
||||||
$b = WebGUI::SQL->read("select widgetId, namespace from widget where pageId=$_[0]");
|
$sth = WebGUI::SQL->read("select * from wobject where pageId=$_[0]");
|
||||||
while (($widgetId,$widgetType) = $b->array) {
|
while ($wobject = $sth->hashRef) {
|
||||||
$func = "WebGUI::Widget::".$widgetType."::duplicate";
|
$extra = WebGUI::SQL->quickHashRef("select * from ${$wobject}{namespace} where wobjectId=${$wobject}{wobjectId}");
|
||||||
&$func($widgetId,$_[1]);
|
tie %hash, 'Tie::CPHash';
|
||||||
|
%hash = (%{$wobject},%{$extra});
|
||||||
|
$wobject = \%hash;
|
||||||
|
$cmd = "WebGUI::Wobject::".${$wobject}{namespace};
|
||||||
|
$w = $cmd->new($wobject);
|
||||||
|
$w->duplicate($_[1]);
|
||||||
}
|
}
|
||||||
$b->finish;
|
$sth->finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -38,7 +43,7 @@ sub _recursePageTree {
|
||||||
tie %newParent, 'Tie::CPHash';
|
tie %newParent, 'Tie::CPHash';
|
||||||
tie %package, 'Tie::CPHash';
|
tie %package, 'Tie::CPHash';
|
||||||
%newParent = WebGUI::SQL->quickHash("select * from page where pageId=$_[1]");
|
%newParent = WebGUI::SQL->quickHash("select * from page where pageId=$_[1]");
|
||||||
_duplicateWidgets($_[0],$_[1]);
|
_duplicateWobjects($_[0],$_[1]);
|
||||||
$a = WebGUI::SQL->read("select * from page where parentId=$_[0]");
|
$a = WebGUI::SQL->read("select * from page where parentId=$_[0]");
|
||||||
while (%package = $a->hash) {
|
while (%package = $a->hash) {
|
||||||
$newPageId = getNextId("pageId");
|
$newPageId = getNextId("pageId");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue