Adding new wobject proxy features.

This commit is contained in:
JT Smith 2003-05-18 20:20:45 +00:00
parent 5ec7c67b66
commit a716541e0c
4 changed files with 36 additions and 12 deletions

View file

@ -538,6 +538,7 @@ alter table WobjectProxy add column overrideTitle int not null default 0;
alter table WobjectProxy add column overrideDescription int not null default 0;
alter table WobjectProxy add column overrideTemplate int not null default 0;
alter table WobjectProxy add column overrideDisplayTitle int not null default 0;
alter table WobjectProxy add column proxiedTemplateId int not null default 1;
delete from international where languageId=1 and namespace='WobjectProxy' and internationalId=10;
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (10,1,'WobjectProxy','Override template?', 1053183837,'Asking the user if s/he would like to use the template specified in the wobject proxy or the original template of the original wobject.');

View file

@ -67,20 +67,35 @@ sub _generatePage {
.moveTopIcon('func=moveTop&wid='.${$wobject}{wobjectId})
.moveBottomIcon('func=moveBottom&wid='.${$wobject}{wobjectId})
.cutIcon('func=cut&wid='.${$wobject}{wobjectId})
.copyIcon('func=copy&wid='.${$wobject}{wobjectId})
.shortcutIcon('func=createShortcut&wid='.${$wobject}{wobjectId})
.'<br>';
.copyIcon('func=copy&wid='.${$wobject}{wobjectId});
if (${$wobject}{namespace} ne "WobjectProxy" && isIn("WobjectProxy",@{$session{config}{wobjects}})) {
$contentHash{"page.position".${$wobject}{templatePosition}} .=
shortcutIcon('func=createShortcut&wid='.${$wobject}{wobjectId})
}
$contentHash{"page.position".${$wobject}{templatePosition}} .= '<br>';
}
if (${$wobject}{namespace} eq "WobjectProxy") {
$originalWobject = $wobject;
($wobject) = WebGUI::SQL->quickArray("select proxiedWobjectId from WobjectProxy
my ($wobjectProxy) = WebGUI::SQL->quickHashRef("select * from WobjectProxy
where wobjectId=".${$wobject}{wobjectId});
$wobject = WebGUI::SQL->quickHashRef("select * from wobject where wobject.wobjectId=".$wobject);
$wobject = WebGUI::SQL->quickHashRef("select * from wobject where wobject.wobjectId=".$wobjectProxy->{proxiedWobjectId});
if (${$wobject}{namespace} eq "") {
$wobject = $originalWobject;
} else {
${$wobject}{templatePosition} = ${$originalWobject}{templatePosition};
${$wobject}{_WobjectProxy} = ${$originalWobject}{wobjectId};
if ($wobjectProxy->{overrideTitle}) {
${$wobject}{title} = ${$originalWobject}{title};
}
if ($wobjectProxy->{overrideDisplayTitle}) {
${$wobject}{displayTitle} = ${$originalWobject}{displayTitle};
}
if ($wobjectProxy->{overrideDescription}) {
${$wobject}{description} = ${$originalWobject}{description};
}
if ($wobjectProxy->{overrideTemplate}) {
${$wobject}{templateId} = $wobjectProxy->{proxiedTemplateId};
}
}
}
my $sql = "select * from ".$wobject->{namespace}." where wobjectId=".$wobject->{wobjectId};

View file

@ -430,7 +430,7 @@ sub shortcutIcon {
my ($output, $pageURL);
$pageURL = $_[1] || $session{page}{urlizedTitle};
$output = '<a href="'.WebGUI::URL::gateway($pageURL,$_[0]).'">';
$output .= '<img src="'.$session{config}{extrasURL}.'/toolbar/'.$session{language}{toolbar}.'/shortcut.gif" align="middle" border="0" alt="Shortcut" title="Shortcut" /></a>';
$output .= '<img src="'.$session{config}{extrasURL}.'/toolbar/'.$session{language}{toolbar}.'/shortcut.gif" align="middle" border="0" alt="Shortcut" title="Create Shortcut" /></a>';
return $output;
}

View file

@ -79,9 +79,17 @@ sub uiLevel {
sub www_edit {
my $properties = WebGUI::HTMLForm->new;
my $layout = WebGUI::HTMLForm->new;
$properties->hidden(
-name=>"proxiedNamespace",
-value=>$_[0]->get("proxiedNamespace")
);
$properties->hidden(
-name=>"proxiedWobjectId",
-value=>$_[0]->get("proxiedWobjectId")
);
$layout->template(
-name=>"proxiedTemplateId",
-value=>[$_[0]->getValue("proxiedTemplateId")],
-value=>$_[0]->getValue("proxiedTemplateId"),
-namespace=>$_[0]->get("proxiedNamespace")
);
$properties->yesNo(
@ -96,19 +104,19 @@ sub www_edit {
);
$properties->yesNo(
-name=>"overrideDescription",
-value=>$_[0]->getValue("overrideTitle"),
-value=>$_[0]->getValue("overrideDescription"),
-label=>WebGUI::International::get(9,$_[0]->get("namespace"))
);
$layout->yesNo(
-name=>"overrideTemplate",
-value=>$_[0]->getValue("overrideTitle"),
-value=>$_[0]->getValue("overrideTemplate"),
-label=>WebGUI::International::get(10,$_[0]->get("namespace"))
);
my @data = WebGUI::SQL->read("select page.urlizedTitle,wobject.title from wobject left join page on wobject.pageId=page.pageId
my @data = WebGUI::SQL->quickArray("select page.urlizedTitle,wobject.title from wobject left join page on wobject.pageId=page.pageId
where wobject.wobjectId=".$_[0]->get("proxiedWobjectId"));
$properties->readonly(
$properties->readOnly(
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
-value=>'<a href="'.WebGUI::URL::gateway($data[0]).'">'.$data[1].'</a>'
-value=>'<a href="'.WebGUI::URL::gateway($data[0]).'">'.$data[1].'</a> ('.$_[0]->get("proxiedWobjectId").')'
);
return $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,