diff --git a/docs/upgrades/upgrade_5.2.6-5.3.0.pl b/docs/upgrades/upgrade_5.2.6-5.3.0.pl
index 3cfa0bcdc..724ddc03e 100644
--- a/docs/upgrades/upgrade_5.2.6-5.3.0.pl
+++ b/docs/upgrades/upgrade_5.2.6-5.3.0.pl
@@ -61,10 +61,10 @@ unlink("../../lib/WebGUI/Wobject/MailForm.pm");
unlink("../../www/extras/floatCheck.js");
unlink("../../www/extras/numberCheck.js");
+WebGUI::Session::open("../..",$configFile);
print "\tMigrating Mail Form to Data Form.\n" unless ($quiet);
-WebGUI::Session::open("../..",$configFile);
#renaming namespace
my @sql = (
@@ -146,6 +146,25 @@ foreach my $query (@sql) {
WebGUI::SQL->write($query);
}
+print "\tSetting up new global template structure.\n" unless ($quiet);
+
+WebGUI::SQL->write("alter table wobject add column templateId int not null default 1");
+foreach (qw(Article DataForm EventsCalendar FAQ FileManager Item LinkList MessageBoard Product SiteMap SyndicatedContent USS)) {
+ my $sth = WebGUI::SQL->read("select templateId,wobjectId from $_ where templateId<>1");
+ while (my @data = $sth->array) {
+ WebGUI::SQL->write("update wobject set templateId=$data[0] where wobjectId=$data[1]");
+ }
+ $sth->finish;
+ WebGUI::SQL->write("alter table $_ drop column templateId");
+}
+WebGUI::SQL->write("alter table WobjectProxy add column proxiedNamespace varchar(35)");
+my $sth = WebGUI::SQL->read("select wobject.namespace,wobject.wobjectId from WobjectProxy left join wobject
+ on WobjectProxy.proxiedWobjectId=wobject.wobjectId");
+while (my @data = $sth->array) {
+ WebGUI::SQL->write("update WobjectProxy set proxiedNamespace=".quote($data[0])." where proxiedWobjectId=$data[1]");
+}
+$sth->finish;
+
WebGUI::Session::close();
diff --git a/docs/upgrades/upgrade_5.2.6-5.3.0.sql b/docs/upgrades/upgrade_5.2.6-5.3.0.sql
index 1cc47a6f3..47709ed15 100644
--- a/docs/upgrades/upgrade_5.2.6-5.3.0.sql
+++ b/docs/upgrades/upgrade_5.2.6-5.3.0.sql
@@ -523,14 +523,40 @@ delete from settings where name='sharedTrash';
insert into settings (name,value) values ('sharedTrash','0');
delete from international where languageId=1 and namespace='WebGUI' and internationalId=629;
INSERT INTO international (internationalId,languageId,namespace,message,lastUpdated) VALUES (629,1,'WebGUI','Use shared clipboard?
\r\nEnables a single, system-wide clipboard shared by all users. Default is user separated clipboards.\r\n
\r\n\r\nUse shared trash?
\r\nEnables a single, system-wide trash shared by all users. Default is user separated trash.\r\n
\r\n\r\nPrevent Proxy Caching
\r\nSome companies have proxy servers that cause problems with WebGUI. If you\'re experiencing problems with WebGUI, and you have a proxy server, you may want to set this setting to Yes. Beware that WebGUI\'s URLs will not be as user-friendly after this feature is turned on.\r\n
\r\n\r\nShow debugging?
\r\nShow debugging information in WebGUI\'s output. This is primarily useful for WebGUI developers, but can also be interesting for Administrators trying to troubleshoot a problem.\r\n
\r\n\r\nTrack page statistics?
\r\nWebGUI can track some statistical information for your site. However, this will add a little extra strain on your processor and will make your database grow much more quickly. Enable this only if you do not have an external web statistics program.\r\n
\r\n\r\nNOTES: You can also use the special case ^a(linkonly); to return only the URL to the account page and nothing more. Also, the .myAccountLink style sheet class is tied to this macro.\r\n
\r\n\r\n\r\n^AdminText();
\r\nDisplays a small text message to a user who is in admin mode. Example: ^AdminText("You are in admin mode!");\r\n
\r\n\r\n^AdminToggle; or ^AdminToggle();
\r\nPlaces a link on the page which is only visible to content managers and adminstrators. The link toggles on/off admin mode. You can optionally specify other messages to display like this: ^AdminToggle("Edit On","Edit Off");\r\n
\r\n\r\n^CanEditText();
\r\nDisplay a message to a user that can edit the current page.\r\n
\r\nExample: ^CanEditText(^AdminToggle;);\r\n
\r\n\r\n^EditableToggle; or ^EditableToggle();
\r\nExactly the same as AdminToggle, except that the toggle is only displayed if the user has the rights to edit the current page.\r\n
\r\n\r\n^GroupText();
\r\nDisplays a small text message to the user if they belong to the specified group. And you can specify an alternate message to those who are not in the group.\r\n
\r\nExample: ^GroupText("Visitors","You need an account to do anything cool on this site!","We value our registered users!");\r\n
\r\n\r\n^L; or ^L(); - Login Box
\r\nA small login form. You can also configure this macro. You can set the width of the login box like this ^L(20);. You can also set the message displayed after the user is logged in like this ^L(20,Hi ^a(^@;);. Click %here% if you wanna log out!)\r\n
\r\n\r\nNOTE: The .loginBox style sheet class is tied to this macro.\r\n
\r\n\r\n^LoginToggle; or ^LoginToggle();
\r\nDisplays a "Login" or "Logout" message depending upon whether the user is logged in or not. You can optionally specify other labels like this: ^LoginToggle("Click here to log in.","Click here to log out.");. You can also use the special case ^LoginToggle(linkonly); to return only the URL with no label.\r\n
\r\n\r\n^@; - Username
\r\nThe username of the currently logged in user.\r\n
\r\n\r\n\r\n^#; - User ID
\r\nThe user id of the currently logged in user.\r\n
\r\n\r\n', 1053114197,NULL); -INSERT INTO style VALUES (-10,'htmlArea Image Manager','\r\n','\r\n\r\n\r\n\r\n\r\n
\r\n^-;\r\n'); - - - - - - diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index b9573b30c..e3f9e0ec8 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -68,6 +68,7 @@ sub _generatePage { .moveBottomIcon('func=moveBottom&wid='.${$wobject}{wobjectId}) .cutIcon('func=cut&wid='.${$wobject}{wobjectId}) .copyIcon('func=copy&wid='.${$wobject}{wobjectId}) + .shortcutIcon('func=createShortcut&wid='.${$wobject}{wobjectId}) .'
';
+ return $output;
+}
+
+#-------------------------------------------------------------------
+
+=head2 pasteIcon ( urlParameters [, pageURL ] )
+
+
#-------------------------------------------------------------------
=head2 viewIcon ( urlParameters [, pageURL ] )
diff --git a/lib/WebGUI/Wobject.pm b/lib/WebGUI/Wobject.pm
index 315609b9c..f6d625090 100644
--- a/lib/WebGUI/Wobject.pm
+++ b/lib/WebGUI/Wobject.pm
@@ -622,7 +622,13 @@ NOTE: This is used to define the wobject and should only be passed in by a wobje
=item -useDiscussion
- Defaults to "0". If set to "1" this will add a discussion properties tab to this wobject to enable content managers to set the properties of a discussion attached to this wobject.
+Defaults to "0". If set to "1" this will add a discussion properties tab to this wobject to enable content managers to set the properties of a discussion attached to this wobject.
+
+NOTE: This is used to define the wobject and should only be passed in by a wobject subclass.
+
+=item -useTemplate
+
+Defaults to "0". If set to "1" this will add a template field to the wobject to enable content managers to select a template to layout this wobject.
NOTE: This is used to define the wobject and should only be passed in by a wobject subclass.
@@ -632,14 +638,15 @@ NOTE: This is used to define the wobject and should only be passed in by a wobje
sub new {
my ($self, @p) = @_;
- my ($properties, $extendedProperties, $useDiscussion);
+ my ($properties, $extendedProperties, $useTemplate, $useDiscussion);
if (ref $_[1] eq "HASH") {
$properties = $_[1]; # reverse compatibility prior to 5.2
} else {
- ($properties, $extendedProperties, $useDiscussion) =
- rearrange([qw(properties extendedProperties useDiscussion)], @p);
+ ($properties, $extendedProperties, $useDiscussion, $useTemplate) =
+ rearrange([qw(properties extendedProperties useDiscussion useTemplate)], @p);
}
$useDiscussion = 0 unless ($useDiscussion);
+ $useTemplate = 0 unless ($useDiscussion);
my $wobjectProperties = {
userDefined1=>{
fieldType=>"text"
@@ -657,13 +664,13 @@ sub new {
fieldType=>"text"
},
bufferUserId=>{
- fieldType=>"integer"
+ fieldType=>"hidden"
},
bufferDate=>{
- fieldType=>"integer"
+ fieldType=>"hidden"
},
bufferPrevId=>{
- fieldType=>"integer"
+ fieldType=>"hidden"
},
allowDiscussion=>{
fieldType=>"yesNo",
@@ -698,8 +705,13 @@ sub new {
defaultValue=>1,
},
title=>{
- fieldType=>"text"
+ fieldType=>"text",
+ defaultValue=>$_[0]->get("namespace")
},
+ templateId=>{
+ fieldType=>"template",
+ defaultValue=>1
+ },
displayTitle=>{
fieldType=>"yesNo",
defaultValue=>1
@@ -709,7 +721,7 @@ sub new {
fieldType=>"HTMLArea"
},
pageId=>{
- fieldType=>"integer",
+ fieldType=>"hidden",
defaultValue=>$session{page}{pageId}
},
templatePosition=>{
@@ -725,7 +737,7 @@ sub new {
fieldType=>"date"
},
sequenceNumber=>{
- fieldType=>"integer"
+ fieldType=>"hidden"
}
};
bless({
@@ -1065,12 +1077,35 @@ NOTE: Should never need to be overridden or extended.
=cut
sub www_copy {
- if (WebGUI::Privilege::canEditPage()) {
- $_[0]->duplicate;
- return "";
- } else {
- return WebGUI::Privilege::insufficient();
- }
+ return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
+ $_[0]->duplicate;
+ return "";
+}
+
+#-------------------------------------------------------------------
+
+=head2 www_createShortcut ( )
+
+Creates a shortcut (using the wobject proxy) of this wobject on the clipboard.
+
+NOTE: Should never need to be overridden or extended.
+
+=cut
+
+sub www_createShortcut {
+ return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
+ my $w = WebGUI::Wobject::WobjectProxy->new({wobjectId=>"new",namespace=>"WobjectProxy"});
+ $w->set({
+ pageId=>2,
+ templatePosition=>1,
+ title=>$_[0]->getValue("title"),
+ proxiedNamespace=>$_[0]->get("namespace"),
+ proxiedWobjectId=>$_[0]->get("wobjectId"),
+ bufferUserId=>$session{user}{userId},
+ bufferDate=>time(),
+ bufferPrevId=>$session{page}{pageId}
+ });
+ return "";
}
#-------------------------------------------------------------------
@@ -1082,16 +1117,16 @@ Moves this instance to the clipboard.
=cut
sub www_cut {
- if (WebGUI::Privilege::canEditPage()) {
- $_[0]->set({pageId=>2, templatePosition=>1,
- bufferUserId=>$session{user}{userId},
- bufferDate=>time(),
- bufferPrevId=>$session{page}{pageId}});
- _reorderWobjects($session{page}{pageId});
- return "";
- } else {
- return WebGUI::Privilege::insufficient();
- }
+ return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
+ $_[0]->set({
+ pageId=>2,
+ templatePosition=>1,
+ bufferUserId=>$session{user}{userId},
+ bufferDate=>time(),
+ bufferPrevId=>$session{page}{pageId}
+ });
+ _reorderWobjects($session{page}{pageId});
+ return "";
}
#-------------------------------------------------------------------
@@ -1302,6 +1337,13 @@ sub www_edit {
-value=>$displayTitle,
-uiLevel=>5
);
+ if ($_[0]->{_useTemplate}) {
+ $f->getTab("layout")->template(
+ -value=>$_[0]->getValue("templateId"),
+ -namespace=>$_[0]->get("namespace"),
+ -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
+ );
+ }
$f->getTab("layout")->select(
-name=>"templatePosition",
-label=>WebGUI::International::get(363),
diff --git a/lib/WebGUI/Wobject/Article.pm b/lib/WebGUI/Wobject/Article.pm
index edecb620c..b21cf2521 100644
--- a/lib/WebGUI/Wobject/Article.pm
+++ b/lib/WebGUI/Wobject/Article.pm
@@ -51,9 +51,6 @@ sub new {
-properties=>$property,
-extendedProperties=>{
image=>{ },
- templateId=>{
- defaultValue=>1
- },
linkTitle=>{ },
linkURL=>{ },
attachment=>{ },
@@ -61,7 +58,8 @@ sub new {
defaultValue=>0
}
},
- -useDiscussion=>1
+ -useDiscussion=>1,
+ -useTemplate=>1
);
bless $self, $class;
}
@@ -70,13 +68,6 @@ sub new {
sub www_edit {
my $properties = WebGUI::HTMLForm->new;
my $layout = WebGUI::HTMLForm->new;
- $layout->template(
- -name=>"templateId",
- -value=>$_[0]->getValue("templateId"),
- -namespace=>$_[0]->get("namespace"),
- -label=>WebGUI::International::get(356),
- -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
- );
$properties->raw(
-value=>$_[0]->fileProperty("image",6),
-uiLevel=>3
diff --git a/lib/WebGUI/Wobject/DataForm.pm b/lib/WebGUI/Wobject/DataForm.pm
index 50ebbdf14..72120dfd3 100644
--- a/lib/WebGUI/Wobject/DataForm.pm
+++ b/lib/WebGUI/Wobject/DataForm.pm
@@ -179,9 +179,6 @@ sub new {
-properties=>$property,
-extendedProperties=>{
acknowledgement=>{},
- templateId=>{
- defaultValue=>1
- },
emailTemplateId=>{
defaultValue=>2
},
@@ -190,8 +187,9 @@ sub new {
},
mailData=>{
defaultValue=>0
- },
- }
+ }
+ },
+ -useTemplate=>1
);
bless $self, $class;
}
@@ -269,13 +267,6 @@ sub www_deleteFieldConfirm {
#-------------------------------------------------------------------
sub www_edit {
my $layout = WebGUI::HTMLForm->new;
- $layout->template(
- -name=>"templateId",
- -value=>$_[0]->getValue("templateId"),
- -namespace=>$_[0]->get("namespace"),
- -label=>WebGUI::International::get(78,$_[0]->get("namespace")),
- -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
- );
$layout->template(
-name=>"emailTemplateId",
-value=>$_[0]->getValue("emailTemplateId"),
diff --git a/lib/WebGUI/Wobject/EventsCalendar.pm b/lib/WebGUI/Wobject/EventsCalendar.pm
index f447a5b27..103a27fd7 100644
--- a/lib/WebGUI/Wobject/EventsCalendar.pm
+++ b/lib/WebGUI/Wobject/EventsCalendar.pm
@@ -165,9 +165,6 @@ sub new {
my $self = WebGUI::Wobject->new(
-properties=>$property,
-extendedProperties=>{
- templateId=>{
- defaultValue=>1
- },
eventTemplateId=>{
defaultValue=>1
},
@@ -183,7 +180,8 @@ sub new {
paginateAfter=>{
defaultValue=>50
}
- }
+ },
+ -useTemplate=>1
);
bless $self, $class;
}
@@ -227,13 +225,6 @@ sub www_edit {
my $afterEdit = 'func=edit&wid='.$_[0]->get("wobjectId") if ($_[0]->get("wobjectId") ne "new");
my $layout = WebGUI::HTMLForm->new;
my $properties = WebGUI::HTMLForm->new;
- $layout->template(
- -name=>"templateId",
- -value=>$_[0]->getValue("templateId"),
- -namespace=>$_[0]->get("namespace"),
- -label=>WebGUI::International::get(79,$_[0]->get("namespace")),
- -afterEdit=>$afterEdit
- );
$layout->template(
-name=>"eventTemplateId",
-value=>$_[0]->getValue("eventTemplateId"),
diff --git a/lib/WebGUI/Wobject/FAQ.pm b/lib/WebGUI/Wobject/FAQ.pm
index 6552de6f7..4c8ee7ba3 100644
--- a/lib/WebGUI/Wobject/FAQ.pm
+++ b/lib/WebGUI/Wobject/FAQ.pm
@@ -49,11 +49,8 @@ sub new {
my $property = shift;
my $self = WebGUI::Wobject->new(
-properties=>$property,
- -extendedProperties=>{
- templateId=>{
- defaultValue=>1
- }
- }
+ -extendedProperties=>{},
+ -useTemplate=>1
);
bless $self, $class;
}
@@ -82,14 +79,6 @@ sub www_deleteQuestionConfirm {
#-------------------------------------------------------------------
sub www_edit {
my $properties = WebGUI::HTMLForm->new;
- my $layout = WebGUI::HTMLForm->new;
- $layout->template(
- -name=>"templateId",
- -value=>$_[0]->getValue("templateId"),
- -namespace=>$_[0]->get("namespace"),
- -label=>WebGUI::International::get(74,$_[0]->get("namespace")),
- -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
- );
if ($_[0]->get("wobjectId") eq "new") {
$properties->whatNext(
-options=>{
@@ -101,7 +90,6 @@ sub www_edit {
}
return $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
- -layout=>$layout->printRowsOnly,
-headingId=>8,
-helpId=>1
);
diff --git a/lib/WebGUI/Wobject/FileManager.pm b/lib/WebGUI/Wobject/FileManager.pm
index 76f3d29ae..ff6927e68 100644
--- a/lib/WebGUI/Wobject/FileManager.pm
+++ b/lib/WebGUI/Wobject/FileManager.pm
@@ -73,11 +73,9 @@ sub new {
-extendedProperties=>{
paginateAfter=>{
defaultValue=>50,
- },
- templateId=>{
- defaultValue=>1
}
- }
+ },
+ -useTemplate=>1
);
bless $self, $class;
}
@@ -149,12 +147,6 @@ sub www_download {
sub www_edit {
my $properties = WebGUI::HTMLForm->new;
my $layout = WebGUI::HTMLForm->new;
- $layout->template(
- -name=>"templateId",
- -value=>$_[0]->getValue("templateId"),
- -namespace=>$_[0]->get("namespace"),
- -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
- );
$layout->integer(
-name=>"paginateAfter",
-label=>WebGUI::International::get(20,$_[0]->get("namespace")),
diff --git a/lib/WebGUI/Wobject/Item.pm b/lib/WebGUI/Wobject/Item.pm
index 513c56c46..f5ca735af 100644
--- a/lib/WebGUI/Wobject/Item.pm
+++ b/lib/WebGUI/Wobject/Item.pm
@@ -46,11 +46,9 @@ sub new {
-properties=>$property,
-extendedProperties=>{
linkURL=>{},
- attachment=>{},
- templateId=>{
- defaultValue=>1
- }
- }
+ attachment=>{}
+ },
+ -useTemplate=>1
);
bless $self, $class;
}
@@ -58,22 +56,13 @@ sub new {
#-------------------------------------------------------------------
sub www_edit {
my $properties = WebGUI::HTMLForm->new;
- my $layout = WebGUI::HTMLForm->new;
$properties->url(
-name=>"linkURL",
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
-value=>$_[0]->getValue("linkURL"));
$properties->raw($_[0]->fileProperty("attachment",2));
- $layout->template(
- -name=>"templateId",
- -value=>$_[0]->getValue("templateId"),
- -namespace=>$_[0]->get("namespace"),
- -label=>WebGUI::International::get(72,$_[0]->get("namespace")),
- -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
- );
return $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
- -layout=>$layout->printRowsOnly,
-headingId=>6,
-helpId=>1
);
diff --git a/lib/WebGUI/Wobject/LinkList.pm b/lib/WebGUI/Wobject/LinkList.pm
index a62efebb2..e000125b2 100644
--- a/lib/WebGUI/Wobject/LinkList.pm
+++ b/lib/WebGUI/Wobject/LinkList.pm
@@ -49,11 +49,8 @@ sub new {
my $property = shift;
my $self = WebGUI::Wobject->new(
-properties=>$property,
- -extendedProperties=>{
- templateId=>{
- defaultValue=>1
- }
- }
+ -extendedProperties=>{},
+ -useTemplate=>1,
);
bless $self, $class;
}
@@ -82,14 +79,7 @@ sub www_deleteLinkConfirm {
#-------------------------------------------------------------------
sub www_edit {
- my $layout = WebGUI::HTMLForm->new;
my $properties = WebGUI::HTMLForm->new;
- $layout->template(
- -name=>"templateId",
- -value=>$_[0]->getValue("templateId"),
- -namespace=>$_[0]->get("namespace"),
- -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
- );
if ($_[0]->get("wobjectId") eq "new") {
$properties->whatNext(
-options=>{
@@ -101,7 +91,6 @@ sub www_edit {
}
return $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
- -layout=>$layout->printRowsOnly,
-headingId=>10,
-helpId=>1
);
diff --git a/lib/WebGUI/Wobject/MessageBoard.pm b/lib/WebGUI/Wobject/MessageBoard.pm
index 9fc58be39..5d8928d33 100644
--- a/lib/WebGUI/Wobject/MessageBoard.pm
+++ b/lib/WebGUI/Wobject/MessageBoard.pm
@@ -40,13 +40,11 @@ sub new {
my $self = WebGUI::Wobject->new(
-properties=>$property,
-extendedProperties=>{
- templateId=>{
- defaultValue=>1
- },
messagesPerPage=>{
defaultValue=>50
}
- }
+ },
+ -useTemplate=>1
);
bless $self, $class;
}
@@ -71,13 +69,6 @@ sub www_edit {
-label=>WebGUI::International::get(4,$_[0]->get("namespace")),
-value=>$_[0]->getValue("messagesPerPage")
);
- $layout->template(
- -name=>"templateId",
- -value=>$_[0]->getValue("templateId"),
- -namespace=>$_[0]->get("namespace"),
- -label=>WebGUI::International::get(72,$_[0]->get("namespace")),
- -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
- );
$properties->raw($_[0]->SUPER::discussionProperties);
return $_[0]->SUPER::www_edit(
-layout=>$layout->printRowsOnly,
diff --git a/lib/WebGUI/Wobject/Poll.pm b/lib/WebGUI/Wobject/Poll.pm
index a73f6f839..3a8ff6b82 100644
--- a/lib/WebGUI/Wobject/Poll.pm
+++ b/lib/WebGUI/Wobject/Poll.pm
@@ -95,7 +95,8 @@ sub new {
a18=>{},
a19=>{},
a20=>{}
- }
+ },
+ -useTemplate=>1
);
bless $self, $class;
}
diff --git a/lib/WebGUI/Wobject/Product.pm b/lib/WebGUI/Wobject/Product.pm
index d03a70672..d518dff90 100644
--- a/lib/WebGUI/Wobject/Product.pm
+++ b/lib/WebGUI/Wobject/Product.pm
@@ -87,9 +87,6 @@ sub new {
-properties=>$property,
-extendedProperties=>{
price=>{},
- templateId=>{
- defaultValue=>1
- },
productNumber=>{},
image1=>{},
image2=>{},
@@ -97,7 +94,8 @@ sub new {
manual=>{},
brochure=>{},
warranty=>{}
- }
+ },
+ -useTemplate=>1
);
bless $self, $class;
}
@@ -274,15 +272,7 @@ sub www_deleteSpecificationConfirm {
#-------------------------------------------------------------------
sub www_edit {
- my $layout = WebGUI::HTMLForm->new;
my $properties = WebGUI::HTMLForm->new;
- $layout->template(
- -name=>"templateId",
- -value=>$_[0]->getValue("template"),
- -namespace=>$_[0]->get("namespace"),
- -label=>WebGUI::International::get(61,$_[0]->get("namespace")),
- -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
- );
$properties->text(
-name=>"price",
-label=>WebGUI::International::get(10,$_[0]->get("namespace")),
@@ -301,7 +291,6 @@ sub www_edit {
$properties->raw($_[0]->fileProperty("warranty",15));
return $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
- -layout=>$layout->printRowsOnly,
-helpId=>1,
-headingId=>6
);
diff --git a/lib/WebGUI/Wobject/SiteMap.pm b/lib/WebGUI/Wobject/SiteMap.pm
index b6b1222b2..d5ed0e9fe 100644
--- a/lib/WebGUI/Wobject/SiteMap.pm
+++ b/lib/WebGUI/Wobject/SiteMap.pm
@@ -75,13 +75,11 @@ sub new {
indent=>{
defaultValue=>5
},
- templateId=>{
- defaultValue=>1
- },
depth=>{
defaultValue=>0
}
- }
+ },
+ -useTemplate=>1
);
bless $self, $class;
}
@@ -93,12 +91,6 @@ sub www_edit {
and (pageId=1 or pageId>999) order by title");
my $layout = WebGUI::HTMLForm->new;
my $properties = WebGUI::HTMLForm->new;
- $layout->template(
- -name=>"templateId",
- -value=>$_[0]->getValue("templateId"),
- -namespace=>$_[0]->get("namespace"),
- -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
- );
$properties->select(
-name=>"startAtThisLevel",
-label=>WebGUI::International::get(3,$_[0]->get("namespace")),
diff --git a/lib/WebGUI/Wobject/SyndicatedContent.pm b/lib/WebGUI/Wobject/SyndicatedContent.pm
index b23ce8759..310f1eaa8 100644
--- a/lib/WebGUI/Wobject/SyndicatedContent.pm
+++ b/lib/WebGUI/Wobject/SyndicatedContent.pm
@@ -39,11 +39,9 @@ sub new {
my $self = WebGUI::Wobject->new(
-properties=>$property,
-extendedProperties=>{
- rssUrl=>{},
- templateId=>{
- defaultValue=>1
- }
- }
+ rssUrl=>{}
+ },
+ -useTemplate=>1
);
bless $self, $class;
}
@@ -57,21 +55,13 @@ sub uiLevel {
#-------------------------------------------------------------------
sub www_edit {
my $properties = WebGUI::HTMLForm->new;
- my $layout = WebGUI::HTMLForm->new;
$properties->url(
-name=>"rssUrl",
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
-value=>$_[0]->getValue("rssUrl")
);
- $layout->template(
- -name=>"templateId",
- -value=>$_[0]->getValue("templateId"),
- -namespace=>$_[0]->get("namespace"),
- -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
- );
return $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
- -layout=>$layout->printRowsOnly,
-headingId=>4,
-helpId=>1
);
diff --git a/lib/WebGUI/Wobject/USS.pm b/lib/WebGUI/Wobject/USS.pm
index ac9ae0f9c..1455b744a 100644
--- a/lib/WebGUI/Wobject/USS.pm
+++ b/lib/WebGUI/Wobject/USS.pm
@@ -81,16 +81,14 @@ sub new {
submissionTemplateId=>{
defaultValue=>1
},
- templateId=>{
- defaultValue=>1
- },
karmaPerSubmission=>{
defaultValue=>0
},
filterContent=>{
defaultValue=>"javascript"
}
- }
+ },
+ -useTemplate=>1
);
bless $self, $class;
}
@@ -187,13 +185,6 @@ sub www_edit {
my $layout = WebGUI::HTMLForm->new;
my $privileges = WebGUI::HTMLForm->new;
my $properties = WebGUI::HTMLForm->new;
- $layout->template(
- -name=>"templateId",
- -value=>$_[0]->getValue("templateId"),
- -namespace=>$_[0]->get("namespace"),
- -label=>WebGUI::International::get(72,$_[0]->get("namespace")),
- -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
- );
$layout->template(
-name=>"submissionTemplateId",
-value=>$_[0]->getValue("submissionTemplateId"),
diff --git a/lib/WebGUI/Wobject/WobjectProxy.pm b/lib/WebGUI/Wobject/WobjectProxy.pm
index d5b249b78..27d92a29f 100644
--- a/lib/WebGUI/Wobject/WobjectProxy.pm
+++ b/lib/WebGUI/Wobject/WobjectProxy.pm
@@ -38,7 +38,32 @@ sub new {
my $self = WebGUI::Wobject->new(
-properties=>$property,
-extendedProperties=>{
- proxiedWobjectId=>{ }
+ proxiedWobjectId=>{
+ fieldType=>"hidden"
+ },
+ proxiedNamespace=>{
+ fieldType=>"hidden"
+ },
+ overrideTitle=>{
+ fieldType=>"yesNo",
+ defaultValue=>0
+ },
+ overrideTemplate=>{
+ fieldType=>"yesNo",
+ defaultValue=>0
+ },
+ overrideDisplayTitle=>{
+ fieldType=>"yesNo",
+ defaultValue=>0
+ },
+ overrideDescription=>{
+ fieldType=>"yesNo",
+ defaultValue=>0
+ },
+ proxiedTemplateId=>{
+ fieldType=>"template",
+ defaultValue=>1
+ }
}
);
bless $self, $class;
@@ -47,80 +72,51 @@ sub new {
#-------------------------------------------------------------------
sub uiLevel {
- return 8;
+ return 999;
}
#-------------------------------------------------------------------
sub www_edit {
- return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
- my ($output, $f, %wobjects, %page, %wobject, $a, $b);
- tie %wobject, 'Tie::CPHash';
- tie %page, 'Tie::CPHash';
- tie %wobjects, 'Tie::IxHash';
- $output = helpIcon(1,$_[0]->get("namespace"));
- $output .= '