Converting wobjects to use new global template mechanism.
This commit is contained in:
parent
50f9aa9171
commit
5ec7c67b66
20 changed files with 253 additions and 250 deletions
|
|
@ -61,10 +61,10 @@ unlink("../../lib/WebGUI/Wobject/MailForm.pm");
|
||||||
unlink("../../www/extras/floatCheck.js");
|
unlink("../../www/extras/floatCheck.js");
|
||||||
unlink("../../www/extras/numberCheck.js");
|
unlink("../../www/extras/numberCheck.js");
|
||||||
|
|
||||||
|
WebGUI::Session::open("../..",$configFile);
|
||||||
|
|
||||||
print "\tMigrating Mail Form to Data Form.\n" unless ($quiet);
|
print "\tMigrating Mail Form to Data Form.\n" unless ($quiet);
|
||||||
|
|
||||||
WebGUI::Session::open("../..",$configFile);
|
|
||||||
|
|
||||||
#renaming namespace
|
#renaming namespace
|
||||||
my @sql = (
|
my @sql = (
|
||||||
|
|
@ -146,6 +146,25 @@ foreach my $query (@sql) {
|
||||||
WebGUI::SQL->write($query);
|
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();
|
WebGUI::Session::close();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -523,14 +523,40 @@ delete from settings where name='sharedTrash';
|
||||||
insert into settings (name,value) values ('sharedTrash','0');
|
insert into settings (name,value) values ('sharedTrash','0');
|
||||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=629;
|
delete from international where languageId=1 and namespace='WebGUI' and internationalId=629;
|
||||||
INSERT INTO international (internationalId,languageId,namespace,message,lastUpdated) VALUES (629,1,'WebGUI','<b>Use shared clipboard?</b><br>\r\nEnables a single, system-wide clipboard shared by all users. Default is user separated clipboards.\r\n<p>\r\n\r\n<b>Use shared trash?</b><br>\r\nEnables a single, system-wide trash shared by all users. Default is user separated trash.\r\n<p>\r\n\r\n<b>Prevent Proxy Caching</b><br>\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 <i>Yes</i>. Beware that WebGUI\'s URLs will not be as user-friendly after this feature is turned on.\r\n<p>\r\n\r\n<b>Show debugging?</b><br>\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<p>\r\n\r\n<b>Track page statistics?</b><br/>\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<p/>\r\n',1052850265);
|
INSERT INTO international (internationalId,languageId,namespace,message,lastUpdated) VALUES (629,1,'WebGUI','<b>Use shared clipboard?</b><br>\r\nEnables a single, system-wide clipboard shared by all users. Default is user separated clipboards.\r\n<p>\r\n\r\n<b>Use shared trash?</b><br>\r\nEnables a single, system-wide trash shared by all users. Default is user separated trash.\r\n<p>\r\n\r\n<b>Prevent Proxy Caching</b><br>\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 <i>Yes</i>. Beware that WebGUI\'s URLs will not be as user-friendly after this feature is turned on.\r\n<p>\r\n\r\n<b>Show debugging?</b><br>\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<p>\r\n\r\n<b>Track page statistics?</b><br/>\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<p/>\r\n',1052850265);
|
||||||
alter table HttpProxy change ProxiedUrl proxiedUrl text;
|
|
||||||
|
alter table HttpProxy change ProxiedUrl proxiedUrl varchar(255);
|
||||||
|
|
||||||
|
|
||||||
|
delete from international where namespace='DataForm' and internationalId=78;
|
||||||
|
delete from international where namespace='EventsCalendar' and internationalId=79;
|
||||||
|
delete from international where namespace='FAQ' and internationalId=74;
|
||||||
|
delete from international where namespace='Item' and internationalId=72;
|
||||||
|
delete from international where namespace='MessageBoard' and internationalId=72;
|
||||||
|
delete from international where namespace='Product' and internationalId=61;
|
||||||
|
delete from international where namespace='USS' and internationalId=72;
|
||||||
|
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;
|
||||||
|
|
||||||
|
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.');
|
||||||
|
delete from international where languageId=1 and namespace='WobjectProxy' and internationalId=9;
|
||||||
|
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (9,1,'WobjectProxy','Override description?', 1053183804,'Asking the user if s/he would like to use the description specified in the wobject proxy or the original description of the original wobject.');
|
||||||
|
delete from international where languageId=1 and namespace='WobjectProxy' and internationalId=8;
|
||||||
|
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (8,1,'WobjectProxy','Override display title?', 1053183719,'Asking the user if s/he would like to use the "display title" setting specified in the wobject proxy or the original display title setting of the original wobject.');
|
||||||
|
delete from international where languageId=1 and namespace='WobjectProxy' and internationalId=7;
|
||||||
|
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (7,1,'WobjectProxy','Override title?', 1053183682,'Asking the user if s/he would like to use the title specified in the wobject proxy or the original title of the original wobject.');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO style VALUES (-10,'htmlArea Image Manager','<style type=\"text/css\">\r\nTD { font: 8pt \'MS Shell Dlg\', Helvetica, sans-serif; }\r\nTD.delete { font: italic 7pt \'MS Shell Dlg\', Helvetica, sans-serif; }\r\nTD.label { font: 8pt \'MS Shell Dlg\', Helvetica, sans-serif; background-color: #c0c0c0; }\r\nTD.none { font: italic 12pt \'MS Shell Dlg\', Helvetica, sans-serif; }\r\n\r\n</style>\r\n','<script language=\"javascript\">\r\nfunction findAncestor(element, name, type) {\r\n while(element != null && (element.name != name || element.tagName != type))\r\n element = element.parentElement;\r\n return element;\r\n}\r\n</script>\r\n<script language=\"javascript\">\r\n\r\nfunction actionComplete(action, path, error, info) {\r\n var manager = findAncestor(window.frameElement, \'manager\', \'TABLE\');\r\n var wrapper = findAncestor(window.frameElement, \'wrapper\', \'TABLE\');\r\n\r\n if(manager) {\r\n if(error.length < 1) {\r\n manager.all.actions.reset();\r\n if(action == \'upload\') {\r\n manager.all.actions.image.value = \'\';\r\n manager.all.actions.name.value = \'\';\r\n manager.all.actions.thumbnailSize.value = \'\';\r\n\r\n }\r\n if(action == \'create\')\r\n manager.all.actions.folder.value = \'\';\r\n if(action == \'delete\')\r\n manager.all.txtFileName.value = \'\';\r\n }\r\n manager.all.actions.DPI.value = 96;\r\n manager.all.actions.path.value = path;\r\n }\r\n if(wrapper)\r\n wrapper.all.viewer.contentWindow.navigate(\'/?op=htmlAreaviewCollateral\');\r\n if(error.length > 0)\r\n alert(error);\r\n else if(info.length > 0)\r\n alert(info);\r\n}\r\n</script>\r\n\r\n<script language=\"javascript\">\r\nfunction deleteCollateral(options) {\r\n var lister = findAncestor(window.frameElement, \'lister\', \'IFRAME\');\r\n\r\n if(lister && confirm(\"Are you sure you want to delete this item ?\"))\r\n lister.contentWindow.navigate(\'^/;?op=htmlAreaDelete&\' + options);\r\n}\r\n</script>\r\n</head>\r\n<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\r\n^-;\r\n</body>');
|
||||||
|
|
||||||
|
|
||||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=844;
|
delete from international where languageId=1 and namespace='WebGUI' and internationalId=844;
|
||||||
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (844,1,'WebGUI','These macros have to do with users and logins.\r\n<p/>\r\n\r\n<b>^a; or ^a(); - My Account Link</b><br>\r\nA link to your account information. In addition you can change the link text by creating a macro like this <b>^a("Account Info");</b>. \r\n<p>\r\n\r\n<b>NOTES:</b> 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<p>\r\n\r\n\r\n<b>^AdminText();</b><br>\r\nDisplays a small text message to a user who is in admin mode. Example: ^AdminText("You are in admin mode!");\r\n<p>\r\n\r\n<b>^AdminToggle; or ^AdminToggle();</b><br>\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<p>\r\n\r\n<b>^CanEditText();</b><br>\r\nDisplay a message to a user that can edit the current page.\r\n<p>\r\n<i>Example:</i> ^CanEditText(^AdminToggle;);\r\n<p>\r\n\r\n<b>^EditableToggle; or ^EditableToggle();</b><br>\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<p>\r\n\r\n<b>^GroupText();</b><br>\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<p>\r\n<i>Example:</i> ^GroupText("Visitors","You need an account to do anything cool on this site!","We value our registered users!");\r\n<p>\r\n\r\n<b>^L; or ^L(); - Login Box</b><br>\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<p>\r\n\r\n<b>NOTE:</b> The .loginBox style sheet class is tied to this macro.\r\n<p>\r\n\r\n<b>^LoginToggle; or ^LoginToggle();</b><br>\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<p>\r\n\r\n<b>^@; - Username</b><br>\r\nThe username of the currently logged in user.\r\n<p>\r\n\r\n\r\n<b>^#; - User ID</b><br>\r\nThe user id of the currently logged in user.\r\n<p>\r\n\r\n', 1053114197,NULL);
|
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (844,1,'WebGUI','These macros have to do with users and logins.\r\n<p/>\r\n\r\n<b>^a; or ^a(); - My Account Link</b><br>\r\nA link to your account information. In addition you can change the link text by creating a macro like this <b>^a("Account Info");</b>. \r\n<p>\r\n\r\n<b>NOTES:</b> 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<p>\r\n\r\n\r\n<b>^AdminText();</b><br>\r\nDisplays a small text message to a user who is in admin mode. Example: ^AdminText("You are in admin mode!");\r\n<p>\r\n\r\n<b>^AdminToggle; or ^AdminToggle();</b><br>\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<p>\r\n\r\n<b>^CanEditText();</b><br>\r\nDisplay a message to a user that can edit the current page.\r\n<p>\r\n<i>Example:</i> ^CanEditText(^AdminToggle;);\r\n<p>\r\n\r\n<b>^EditableToggle; or ^EditableToggle();</b><br>\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<p>\r\n\r\n<b>^GroupText();</b><br>\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<p>\r\n<i>Example:</i> ^GroupText("Visitors","You need an account to do anything cool on this site!","We value our registered users!");\r\n<p>\r\n\r\n<b>^L; or ^L(); - Login Box</b><br>\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<p>\r\n\r\n<b>NOTE:</b> The .loginBox style sheet class is tied to this macro.\r\n<p>\r\n\r\n<b>^LoginToggle; or ^LoginToggle();</b><br>\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<p>\r\n\r\n<b>^@; - Username</b><br>\r\nThe username of the currently logged in user.\r\n<p>\r\n\r\n\r\n<b>^#; - User ID</b><br>\r\nThe user id of the currently logged in user.\r\n<p>\r\n\r\n', 1053114197,NULL);
|
||||||
|
|
||||||
INSERT INTO style VALUES (-10,'htmlArea Image Manager','<style type=\"text/css\">\r\nTD { font: 8pt \'MS Shell Dlg\', Helvetica, sans-serif; }\r\nTD.delete { font: italic 7pt \'MS Shell Dlg\', Helvetica, sans-serif; }\r\nTD.label { font: 8pt \'MS Shell Dlg\', Helvetica, sans-serif; background-color: #c0c0c0; }\r\nTD.none { font: italic 12pt \'MS Shell Dlg\', Helvetica, sans-serif; }\r\n\r\n</style>\r\n','<script language=\"javascript\">\r\nfunction findAncestor(element, name, type) {\r\n while(element != null && (element.name != name || element.tagName != type))\r\n element = element.parentElement;\r\n return element;\r\n}\r\n</script>\r\n<script language=\"javascript\">\r\n\r\nfunction actionComplete(action, path, error, info) {\r\n var manager = findAncestor(window.frameElement, \'manager\', \'TABLE\');\r\n var wrapper = findAncestor(window.frameElement, \'wrapper\', \'TABLE\');\r\n\r\n if(manager) {\r\n if(error.length < 1) {\r\n manager.all.actions.reset();\r\n if(action == \'upload\') {\r\n manager.all.actions.image.value = \'\';\r\n manager.all.actions.name.value = \'\';\r\n manager.all.actions.thumbnailSize.value = \'\';\r\n\r\n }\r\n if(action == \'create\')\r\n manager.all.actions.folder.value = \'\';\r\n if(action == \'delete\')\r\n manager.all.txtFileName.value = \'\';\r\n }\r\n manager.all.actions.DPI.value = 96;\r\n manager.all.actions.path.value = path;\r\n }\r\n if(wrapper)\r\n wrapper.all.viewer.contentWindow.navigate(\'/?op=htmlAreaviewCollateral\');\r\n if(error.length > 0)\r\n alert(error);\r\n else if(info.length > 0)\r\n alert(info);\r\n}\r\n</script>\r\n\r\n<script language=\"javascript\">\r\nfunction deleteCollateral(options) {\r\n var lister = findAncestor(window.frameElement, \'lister\', \'IFRAME\');\r\n\r\n if(lister && confirm(\"Are you sure you want to delete this item ?\"))\r\n lister.contentWindow.navigate(\'^/;?op=htmlAreaDelete&\' + options);\r\n}\r\n</script>\r\n</head>\r\n<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\r\n^-;\r\n</body>');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ sub _generatePage {
|
||||||
.moveBottomIcon('func=moveBottom&wid='.${$wobject}{wobjectId})
|
.moveBottomIcon('func=moveBottom&wid='.${$wobject}{wobjectId})
|
||||||
.cutIcon('func=cut&wid='.${$wobject}{wobjectId})
|
.cutIcon('func=cut&wid='.${$wobject}{wobjectId})
|
||||||
.copyIcon('func=copy&wid='.${$wobject}{wobjectId})
|
.copyIcon('func=copy&wid='.${$wobject}{wobjectId})
|
||||||
|
.shortcutIcon('func=createShortcut&wid='.${$wobject}{wobjectId})
|
||||||
.'<br>';
|
.'<br>';
|
||||||
}
|
}
|
||||||
if (${$wobject}{namespace} eq "WobjectProxy") {
|
if (${$wobject}{namespace} eq "WobjectProxy") {
|
||||||
|
|
|
||||||
|
|
@ -1243,7 +1243,7 @@ Returns a select list of templates.
|
||||||
|
|
||||||
=item name
|
=item name
|
||||||
|
|
||||||
The name field for this form element.
|
The name field for this form element. Defaults to "templateId".
|
||||||
|
|
||||||
=item value
|
=item value
|
||||||
|
|
||||||
|
|
@ -1258,10 +1258,10 @@ The namespace for the list of templates to return. If this is omitted, all templ
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub template {
|
sub template {
|
||||||
my ($templateId, $where);
|
my $templateId = $_[0]->{value} || 1;
|
||||||
$templateId = $_[0]->{value} || 1;
|
my $name = $_[0]->{name} || "templateId";
|
||||||
return selectList({
|
return selectList({
|
||||||
name=>$_[0]->{name},
|
name=>$name,
|
||||||
options=>WebGUI::Template::getList($_[0]->{namespace}),
|
options=>WebGUI::Template::getList($_[0]->{namespace}),
|
||||||
value=>[$templateId]
|
value=>[$templateId]
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ use WebGUI::URL;
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon ©Icon &deleteIcon &editIcon
|
our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon ©Icon &deleteIcon &editIcon
|
||||||
&moveBottomIcon &moveDownIcon &moveLeftIcon &moveRightIcon &moveTopIcon &moveUpIcon
|
&moveBottomIcon &moveDownIcon &moveLeftIcon &moveRightIcon &moveTopIcon &moveUpIcon
|
||||||
&pageIcon &pasteIcon &wobjectIcon &viewIcon);
|
&pageIcon &shortcutIcon &pasteIcon &wobjectIcon &viewIcon);
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
|
|
@ -48,6 +48,7 @@ A package for generating user interface buttons. The subroutines found herein do
|
||||||
$html = moveUpIcon('op=something');
|
$html = moveUpIcon('op=something');
|
||||||
$html = pageIcon();
|
$html = pageIcon();
|
||||||
$html = pasteIcon('op=something');
|
$html = pasteIcon('op=something');
|
||||||
|
$html = shortcutIcon('op=something');
|
||||||
$html = viewIcon('op=something');
|
$html = viewIcon('op=something');
|
||||||
$html = wobjectIcon();
|
$html = wobjectIcon();
|
||||||
|
|
||||||
|
|
@ -405,6 +406,39 @@ sub pasteIcon {
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 shortcutIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
||||||
|
Generates a button with a shortcut symbol printed on it, similar to the shortcut icon in Microsoft Windows or the link Icon in Gnome.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item urlParameters
|
||||||
|
|
||||||
|
Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
|
||||||
|
|
||||||
|
=item pageURL
|
||||||
|
|
||||||
|
The URL to any page. Defaults to the current page.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
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>';
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 pasteIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 viewIcon ( urlParameters [, pageURL ] )
|
=head2 viewIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
|
||||||
|
|
@ -622,7 +622,13 @@ NOTE: This is used to define the wobject and should only be passed in by a wobje
|
||||||
|
|
||||||
=item -useDiscussion
|
=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.
|
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 {
|
sub new {
|
||||||
my ($self, @p) = @_;
|
my ($self, @p) = @_;
|
||||||
my ($properties, $extendedProperties, $useDiscussion);
|
my ($properties, $extendedProperties, $useTemplate, $useDiscussion);
|
||||||
if (ref $_[1] eq "HASH") {
|
if (ref $_[1] eq "HASH") {
|
||||||
$properties = $_[1]; # reverse compatibility prior to 5.2
|
$properties = $_[1]; # reverse compatibility prior to 5.2
|
||||||
} else {
|
} else {
|
||||||
($properties, $extendedProperties, $useDiscussion) =
|
($properties, $extendedProperties, $useDiscussion, $useTemplate) =
|
||||||
rearrange([qw(properties extendedProperties useDiscussion)], @p);
|
rearrange([qw(properties extendedProperties useDiscussion useTemplate)], @p);
|
||||||
}
|
}
|
||||||
$useDiscussion = 0 unless ($useDiscussion);
|
$useDiscussion = 0 unless ($useDiscussion);
|
||||||
|
$useTemplate = 0 unless ($useDiscussion);
|
||||||
my $wobjectProperties = {
|
my $wobjectProperties = {
|
||||||
userDefined1=>{
|
userDefined1=>{
|
||||||
fieldType=>"text"
|
fieldType=>"text"
|
||||||
|
|
@ -657,13 +664,13 @@ sub new {
|
||||||
fieldType=>"text"
|
fieldType=>"text"
|
||||||
},
|
},
|
||||||
bufferUserId=>{
|
bufferUserId=>{
|
||||||
fieldType=>"integer"
|
fieldType=>"hidden"
|
||||||
},
|
},
|
||||||
bufferDate=>{
|
bufferDate=>{
|
||||||
fieldType=>"integer"
|
fieldType=>"hidden"
|
||||||
},
|
},
|
||||||
bufferPrevId=>{
|
bufferPrevId=>{
|
||||||
fieldType=>"integer"
|
fieldType=>"hidden"
|
||||||
},
|
},
|
||||||
allowDiscussion=>{
|
allowDiscussion=>{
|
||||||
fieldType=>"yesNo",
|
fieldType=>"yesNo",
|
||||||
|
|
@ -698,8 +705,13 @@ sub new {
|
||||||
defaultValue=>1,
|
defaultValue=>1,
|
||||||
},
|
},
|
||||||
title=>{
|
title=>{
|
||||||
fieldType=>"text"
|
fieldType=>"text",
|
||||||
|
defaultValue=>$_[0]->get("namespace")
|
||||||
},
|
},
|
||||||
|
templateId=>{
|
||||||
|
fieldType=>"template",
|
||||||
|
defaultValue=>1
|
||||||
|
},
|
||||||
displayTitle=>{
|
displayTitle=>{
|
||||||
fieldType=>"yesNo",
|
fieldType=>"yesNo",
|
||||||
defaultValue=>1
|
defaultValue=>1
|
||||||
|
|
@ -709,7 +721,7 @@ sub new {
|
||||||
fieldType=>"HTMLArea"
|
fieldType=>"HTMLArea"
|
||||||
},
|
},
|
||||||
pageId=>{
|
pageId=>{
|
||||||
fieldType=>"integer",
|
fieldType=>"hidden",
|
||||||
defaultValue=>$session{page}{pageId}
|
defaultValue=>$session{page}{pageId}
|
||||||
},
|
},
|
||||||
templatePosition=>{
|
templatePosition=>{
|
||||||
|
|
@ -725,7 +737,7 @@ sub new {
|
||||||
fieldType=>"date"
|
fieldType=>"date"
|
||||||
},
|
},
|
||||||
sequenceNumber=>{
|
sequenceNumber=>{
|
||||||
fieldType=>"integer"
|
fieldType=>"hidden"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
bless({
|
bless({
|
||||||
|
|
@ -1065,12 +1077,35 @@ NOTE: Should never need to be overridden or extended.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub www_copy {
|
sub www_copy {
|
||||||
if (WebGUI::Privilege::canEditPage()) {
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
$_[0]->duplicate;
|
$_[0]->duplicate;
|
||||||
return "";
|
return "";
|
||||||
} else {
|
}
|
||||||
return WebGUI::Privilege::insufficient();
|
|
||||||
}
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=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
|
=cut
|
||||||
|
|
||||||
sub www_cut {
|
sub www_cut {
|
||||||
if (WebGUI::Privilege::canEditPage()) {
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
$_[0]->set({pageId=>2, templatePosition=>1,
|
$_[0]->set({
|
||||||
bufferUserId=>$session{user}{userId},
|
pageId=>2,
|
||||||
bufferDate=>time(),
|
templatePosition=>1,
|
||||||
bufferPrevId=>$session{page}{pageId}});
|
bufferUserId=>$session{user}{userId},
|
||||||
_reorderWobjects($session{page}{pageId});
|
bufferDate=>time(),
|
||||||
return "";
|
bufferPrevId=>$session{page}{pageId}
|
||||||
} else {
|
});
|
||||||
return WebGUI::Privilege::insufficient();
|
_reorderWobjects($session{page}{pageId});
|
||||||
}
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -1302,6 +1337,13 @@ sub www_edit {
|
||||||
-value=>$displayTitle,
|
-value=>$displayTitle,
|
||||||
-uiLevel=>5
|
-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(
|
$f->getTab("layout")->select(
|
||||||
-name=>"templatePosition",
|
-name=>"templatePosition",
|
||||||
-label=>WebGUI::International::get(363),
|
-label=>WebGUI::International::get(363),
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,6 @@ sub new {
|
||||||
-properties=>$property,
|
-properties=>$property,
|
||||||
-extendedProperties=>{
|
-extendedProperties=>{
|
||||||
image=>{ },
|
image=>{ },
|
||||||
templateId=>{
|
|
||||||
defaultValue=>1
|
|
||||||
},
|
|
||||||
linkTitle=>{ },
|
linkTitle=>{ },
|
||||||
linkURL=>{ },
|
linkURL=>{ },
|
||||||
attachment=>{ },
|
attachment=>{ },
|
||||||
|
|
@ -61,7 +58,8 @@ sub new {
|
||||||
defaultValue=>0
|
defaultValue=>0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
-useDiscussion=>1
|
-useDiscussion=>1,
|
||||||
|
-useTemplate=>1
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
}
|
}
|
||||||
|
|
@ -70,13 +68,6 @@ sub new {
|
||||||
sub www_edit {
|
sub www_edit {
|
||||||
my $properties = WebGUI::HTMLForm->new;
|
my $properties = WebGUI::HTMLForm->new;
|
||||||
my $layout = 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(
|
$properties->raw(
|
||||||
-value=>$_[0]->fileProperty("image",6),
|
-value=>$_[0]->fileProperty("image",6),
|
||||||
-uiLevel=>3
|
-uiLevel=>3
|
||||||
|
|
|
||||||
|
|
@ -179,9 +179,6 @@ sub new {
|
||||||
-properties=>$property,
|
-properties=>$property,
|
||||||
-extendedProperties=>{
|
-extendedProperties=>{
|
||||||
acknowledgement=>{},
|
acknowledgement=>{},
|
||||||
templateId=>{
|
|
||||||
defaultValue=>1
|
|
||||||
},
|
|
||||||
emailTemplateId=>{
|
emailTemplateId=>{
|
||||||
defaultValue=>2
|
defaultValue=>2
|
||||||
},
|
},
|
||||||
|
|
@ -190,8 +187,9 @@ sub new {
|
||||||
},
|
},
|
||||||
mailData=>{
|
mailData=>{
|
||||||
defaultValue=>0
|
defaultValue=>0
|
||||||
},
|
}
|
||||||
}
|
},
|
||||||
|
-useTemplate=>1
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
}
|
}
|
||||||
|
|
@ -269,13 +267,6 @@ sub www_deleteFieldConfirm {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_edit {
|
sub www_edit {
|
||||||
my $layout = WebGUI::HTMLForm->new;
|
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(
|
$layout->template(
|
||||||
-name=>"emailTemplateId",
|
-name=>"emailTemplateId",
|
||||||
-value=>$_[0]->getValue("emailTemplateId"),
|
-value=>$_[0]->getValue("emailTemplateId"),
|
||||||
|
|
|
||||||
|
|
@ -165,9 +165,6 @@ sub new {
|
||||||
my $self = WebGUI::Wobject->new(
|
my $self = WebGUI::Wobject->new(
|
||||||
-properties=>$property,
|
-properties=>$property,
|
||||||
-extendedProperties=>{
|
-extendedProperties=>{
|
||||||
templateId=>{
|
|
||||||
defaultValue=>1
|
|
||||||
},
|
|
||||||
eventTemplateId=>{
|
eventTemplateId=>{
|
||||||
defaultValue=>1
|
defaultValue=>1
|
||||||
},
|
},
|
||||||
|
|
@ -183,7 +180,8 @@ sub new {
|
||||||
paginateAfter=>{
|
paginateAfter=>{
|
||||||
defaultValue=>50
|
defaultValue=>50
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
-useTemplate=>1
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
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 $afterEdit = 'func=edit&wid='.$_[0]->get("wobjectId") if ($_[0]->get("wobjectId") ne "new");
|
||||||
my $layout = WebGUI::HTMLForm->new;
|
my $layout = WebGUI::HTMLForm->new;
|
||||||
my $properties = 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(
|
$layout->template(
|
||||||
-name=>"eventTemplateId",
|
-name=>"eventTemplateId",
|
||||||
-value=>$_[0]->getValue("eventTemplateId"),
|
-value=>$_[0]->getValue("eventTemplateId"),
|
||||||
|
|
|
||||||
|
|
@ -49,11 +49,8 @@ sub new {
|
||||||
my $property = shift;
|
my $property = shift;
|
||||||
my $self = WebGUI::Wobject->new(
|
my $self = WebGUI::Wobject->new(
|
||||||
-properties=>$property,
|
-properties=>$property,
|
||||||
-extendedProperties=>{
|
-extendedProperties=>{},
|
||||||
templateId=>{
|
-useTemplate=>1
|
||||||
defaultValue=>1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
}
|
}
|
||||||
|
|
@ -82,14 +79,6 @@ sub www_deleteQuestionConfirm {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_edit {
|
sub www_edit {
|
||||||
my $properties = WebGUI::HTMLForm->new;
|
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") {
|
if ($_[0]->get("wobjectId") eq "new") {
|
||||||
$properties->whatNext(
|
$properties->whatNext(
|
||||||
-options=>{
|
-options=>{
|
||||||
|
|
@ -101,7 +90,6 @@ sub www_edit {
|
||||||
}
|
}
|
||||||
return $_[0]->SUPER::www_edit(
|
return $_[0]->SUPER::www_edit(
|
||||||
-properties=>$properties->printRowsOnly,
|
-properties=>$properties->printRowsOnly,
|
||||||
-layout=>$layout->printRowsOnly,
|
|
||||||
-headingId=>8,
|
-headingId=>8,
|
||||||
-helpId=>1
|
-helpId=>1
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -73,11 +73,9 @@ sub new {
|
||||||
-extendedProperties=>{
|
-extendedProperties=>{
|
||||||
paginateAfter=>{
|
paginateAfter=>{
|
||||||
defaultValue=>50,
|
defaultValue=>50,
|
||||||
},
|
|
||||||
templateId=>{
|
|
||||||
defaultValue=>1
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
-useTemplate=>1
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
}
|
}
|
||||||
|
|
@ -149,12 +147,6 @@ sub www_download {
|
||||||
sub www_edit {
|
sub www_edit {
|
||||||
my $properties = WebGUI::HTMLForm->new;
|
my $properties = WebGUI::HTMLForm->new;
|
||||||
my $layout = 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(
|
$layout->integer(
|
||||||
-name=>"paginateAfter",
|
-name=>"paginateAfter",
|
||||||
-label=>WebGUI::International::get(20,$_[0]->get("namespace")),
|
-label=>WebGUI::International::get(20,$_[0]->get("namespace")),
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,9 @@ sub new {
|
||||||
-properties=>$property,
|
-properties=>$property,
|
||||||
-extendedProperties=>{
|
-extendedProperties=>{
|
||||||
linkURL=>{},
|
linkURL=>{},
|
||||||
attachment=>{},
|
attachment=>{}
|
||||||
templateId=>{
|
},
|
||||||
defaultValue=>1
|
-useTemplate=>1
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
}
|
}
|
||||||
|
|
@ -58,22 +56,13 @@ sub new {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_edit {
|
sub www_edit {
|
||||||
my $properties = WebGUI::HTMLForm->new;
|
my $properties = WebGUI::HTMLForm->new;
|
||||||
my $layout = WebGUI::HTMLForm->new;
|
|
||||||
$properties->url(
|
$properties->url(
|
||||||
-name=>"linkURL",
|
-name=>"linkURL",
|
||||||
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
|
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
|
||||||
-value=>$_[0]->getValue("linkURL"));
|
-value=>$_[0]->getValue("linkURL"));
|
||||||
$properties->raw($_[0]->fileProperty("attachment",2));
|
$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(
|
return $_[0]->SUPER::www_edit(
|
||||||
-properties=>$properties->printRowsOnly,
|
-properties=>$properties->printRowsOnly,
|
||||||
-layout=>$layout->printRowsOnly,
|
|
||||||
-headingId=>6,
|
-headingId=>6,
|
||||||
-helpId=>1
|
-helpId=>1
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -49,11 +49,8 @@ sub new {
|
||||||
my $property = shift;
|
my $property = shift;
|
||||||
my $self = WebGUI::Wobject->new(
|
my $self = WebGUI::Wobject->new(
|
||||||
-properties=>$property,
|
-properties=>$property,
|
||||||
-extendedProperties=>{
|
-extendedProperties=>{},
|
||||||
templateId=>{
|
-useTemplate=>1,
|
||||||
defaultValue=>1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
}
|
}
|
||||||
|
|
@ -82,14 +79,7 @@ sub www_deleteLinkConfirm {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_edit {
|
sub www_edit {
|
||||||
my $layout = WebGUI::HTMLForm->new;
|
|
||||||
my $properties = 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") {
|
if ($_[0]->get("wobjectId") eq "new") {
|
||||||
$properties->whatNext(
|
$properties->whatNext(
|
||||||
-options=>{
|
-options=>{
|
||||||
|
|
@ -101,7 +91,6 @@ sub www_edit {
|
||||||
}
|
}
|
||||||
return $_[0]->SUPER::www_edit(
|
return $_[0]->SUPER::www_edit(
|
||||||
-properties=>$properties->printRowsOnly,
|
-properties=>$properties->printRowsOnly,
|
||||||
-layout=>$layout->printRowsOnly,
|
|
||||||
-headingId=>10,
|
-headingId=>10,
|
||||||
-helpId=>1
|
-helpId=>1
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -40,13 +40,11 @@ sub new {
|
||||||
my $self = WebGUI::Wobject->new(
|
my $self = WebGUI::Wobject->new(
|
||||||
-properties=>$property,
|
-properties=>$property,
|
||||||
-extendedProperties=>{
|
-extendedProperties=>{
|
||||||
templateId=>{
|
|
||||||
defaultValue=>1
|
|
||||||
},
|
|
||||||
messagesPerPage=>{
|
messagesPerPage=>{
|
||||||
defaultValue=>50
|
defaultValue=>50
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
-useTemplate=>1
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
}
|
}
|
||||||
|
|
@ -71,13 +69,6 @@ sub www_edit {
|
||||||
-label=>WebGUI::International::get(4,$_[0]->get("namespace")),
|
-label=>WebGUI::International::get(4,$_[0]->get("namespace")),
|
||||||
-value=>$_[0]->getValue("messagesPerPage")
|
-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);
|
$properties->raw($_[0]->SUPER::discussionProperties);
|
||||||
return $_[0]->SUPER::www_edit(
|
return $_[0]->SUPER::www_edit(
|
||||||
-layout=>$layout->printRowsOnly,
|
-layout=>$layout->printRowsOnly,
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,8 @@ sub new {
|
||||||
a18=>{},
|
a18=>{},
|
||||||
a19=>{},
|
a19=>{},
|
||||||
a20=>{}
|
a20=>{}
|
||||||
}
|
},
|
||||||
|
-useTemplate=>1
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,9 +87,6 @@ sub new {
|
||||||
-properties=>$property,
|
-properties=>$property,
|
||||||
-extendedProperties=>{
|
-extendedProperties=>{
|
||||||
price=>{},
|
price=>{},
|
||||||
templateId=>{
|
|
||||||
defaultValue=>1
|
|
||||||
},
|
|
||||||
productNumber=>{},
|
productNumber=>{},
|
||||||
image1=>{},
|
image1=>{},
|
||||||
image2=>{},
|
image2=>{},
|
||||||
|
|
@ -97,7 +94,8 @@ sub new {
|
||||||
manual=>{},
|
manual=>{},
|
||||||
brochure=>{},
|
brochure=>{},
|
||||||
warranty=>{}
|
warranty=>{}
|
||||||
}
|
},
|
||||||
|
-useTemplate=>1
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
}
|
}
|
||||||
|
|
@ -274,15 +272,7 @@ sub www_deleteSpecificationConfirm {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_edit {
|
sub www_edit {
|
||||||
my $layout = WebGUI::HTMLForm->new;
|
|
||||||
my $properties = 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(
|
$properties->text(
|
||||||
-name=>"price",
|
-name=>"price",
|
||||||
-label=>WebGUI::International::get(10,$_[0]->get("namespace")),
|
-label=>WebGUI::International::get(10,$_[0]->get("namespace")),
|
||||||
|
|
@ -301,7 +291,6 @@ sub www_edit {
|
||||||
$properties->raw($_[0]->fileProperty("warranty",15));
|
$properties->raw($_[0]->fileProperty("warranty",15));
|
||||||
return $_[0]->SUPER::www_edit(
|
return $_[0]->SUPER::www_edit(
|
||||||
-properties=>$properties->printRowsOnly,
|
-properties=>$properties->printRowsOnly,
|
||||||
-layout=>$layout->printRowsOnly,
|
|
||||||
-helpId=>1,
|
-helpId=>1,
|
||||||
-headingId=>6
|
-headingId=>6
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -75,13 +75,11 @@ sub new {
|
||||||
indent=>{
|
indent=>{
|
||||||
defaultValue=>5
|
defaultValue=>5
|
||||||
},
|
},
|
||||||
templateId=>{
|
|
||||||
defaultValue=>1
|
|
||||||
},
|
|
||||||
depth=>{
|
depth=>{
|
||||||
defaultValue=>0
|
defaultValue=>0
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
-useTemplate=>1
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
}
|
}
|
||||||
|
|
@ -93,12 +91,6 @@ sub www_edit {
|
||||||
and (pageId=1 or pageId>999) order by title");
|
and (pageId=1 or pageId>999) order by title");
|
||||||
my $layout = WebGUI::HTMLForm->new;
|
my $layout = WebGUI::HTMLForm->new;
|
||||||
my $properties = 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(
|
$properties->select(
|
||||||
-name=>"startAtThisLevel",
|
-name=>"startAtThisLevel",
|
||||||
-label=>WebGUI::International::get(3,$_[0]->get("namespace")),
|
-label=>WebGUI::International::get(3,$_[0]->get("namespace")),
|
||||||
|
|
|
||||||
|
|
@ -39,11 +39,9 @@ sub new {
|
||||||
my $self = WebGUI::Wobject->new(
|
my $self = WebGUI::Wobject->new(
|
||||||
-properties=>$property,
|
-properties=>$property,
|
||||||
-extendedProperties=>{
|
-extendedProperties=>{
|
||||||
rssUrl=>{},
|
rssUrl=>{}
|
||||||
templateId=>{
|
},
|
||||||
defaultValue=>1
|
-useTemplate=>1
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
}
|
}
|
||||||
|
|
@ -57,21 +55,13 @@ sub uiLevel {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_edit {
|
sub www_edit {
|
||||||
my $properties = WebGUI::HTMLForm->new;
|
my $properties = WebGUI::HTMLForm->new;
|
||||||
my $layout = WebGUI::HTMLForm->new;
|
|
||||||
$properties->url(
|
$properties->url(
|
||||||
-name=>"rssUrl",
|
-name=>"rssUrl",
|
||||||
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
|
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
|
||||||
-value=>$_[0]->getValue("rssUrl")
|
-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(
|
return $_[0]->SUPER::www_edit(
|
||||||
-properties=>$properties->printRowsOnly,
|
-properties=>$properties->printRowsOnly,
|
||||||
-layout=>$layout->printRowsOnly,
|
|
||||||
-headingId=>4,
|
-headingId=>4,
|
||||||
-helpId=>1
|
-helpId=>1
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -81,16 +81,14 @@ sub new {
|
||||||
submissionTemplateId=>{
|
submissionTemplateId=>{
|
||||||
defaultValue=>1
|
defaultValue=>1
|
||||||
},
|
},
|
||||||
templateId=>{
|
|
||||||
defaultValue=>1
|
|
||||||
},
|
|
||||||
karmaPerSubmission=>{
|
karmaPerSubmission=>{
|
||||||
defaultValue=>0
|
defaultValue=>0
|
||||||
},
|
},
|
||||||
filterContent=>{
|
filterContent=>{
|
||||||
defaultValue=>"javascript"
|
defaultValue=>"javascript"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
-useTemplate=>1
|
||||||
);
|
);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
}
|
}
|
||||||
|
|
@ -187,13 +185,6 @@ sub www_edit {
|
||||||
my $layout = WebGUI::HTMLForm->new;
|
my $layout = WebGUI::HTMLForm->new;
|
||||||
my $privileges = WebGUI::HTMLForm->new;
|
my $privileges = WebGUI::HTMLForm->new;
|
||||||
my $properties = 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(
|
$layout->template(
|
||||||
-name=>"submissionTemplateId",
|
-name=>"submissionTemplateId",
|
||||||
-value=>$_[0]->getValue("submissionTemplateId"),
|
-value=>$_[0]->getValue("submissionTemplateId"),
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,32 @@ sub new {
|
||||||
my $self = WebGUI::Wobject->new(
|
my $self = WebGUI::Wobject->new(
|
||||||
-properties=>$property,
|
-properties=>$property,
|
||||||
-extendedProperties=>{
|
-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;
|
bless $self, $class;
|
||||||
|
|
@ -47,80 +72,51 @@ sub new {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub uiLevel {
|
sub uiLevel {
|
||||||
return 8;
|
return 999;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_edit {
|
sub www_edit {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
my $properties = WebGUI::HTMLForm->new;
|
||||||
my ($output, $f, %wobjects, %page, %wobject, $a, $b);
|
my $layout = WebGUI::HTMLForm->new;
|
||||||
tie %wobject, 'Tie::CPHash';
|
$layout->template(
|
||||||
tie %page, 'Tie::CPHash';
|
-name=>"proxiedTemplateId",
|
||||||
tie %wobjects, 'Tie::IxHash';
|
-value=>[$_[0]->getValue("proxiedTemplateId")],
|
||||||
$output = helpIcon(1,$_[0]->get("namespace"));
|
-namespace=>$_[0]->get("proxiedNamespace")
|
||||||
$output .= '<h1>'.WebGUI::International::get(2,$_[0]->get("namespace")).'</h1>';
|
|
||||||
my %tabs;
|
|
||||||
tie %tabs, 'Tie::IxHash';
|
|
||||||
%tabs = (
|
|
||||||
properties=>{
|
|
||||||
label=>WebGUI::International::get(893)
|
|
||||||
},
|
|
||||||
layout=>{
|
|
||||||
label=>WebGUI::International::get(105),
|
|
||||||
uiLevel=>5
|
|
||||||
},
|
|
||||||
privileges=>{
|
|
||||||
label=>WebGUI::International::get(107),
|
|
||||||
uiLevel=>9
|
|
||||||
}
|
|
||||||
);
|
|
||||||
$f = WebGUI::TabForm->new(\%tabs);
|
|
||||||
$f->hidden({name=>"wid",value=>$_[0]->get("wobjectId")});
|
|
||||||
$f->hidden({name=>"namespace",value=>$_[0]->get("namespace")}) if ($_[0]->get("wobjectId") eq "new");
|
|
||||||
$f->hidden({name=>"func",value=>"editSave"});
|
|
||||||
$f->getTab("properties")->readOnly(
|
|
||||||
-value=>$_[0]->get("wobjectId"),
|
|
||||||
-label=>WebGUI::International::get(499)
|
|
||||||
);
|
);
|
||||||
$f->hidden({name=>"title",value=>$_[0]->name});
|
$properties->yesNo(
|
||||||
$f->hidden({name=>"displayTitle",value=>$_[0]->getValue("displayTitle")});
|
-name=>"overrideTitle",
|
||||||
$f->getTab("layout")->select(
|
-value=>$_[0]->getValue("overrideTitle"),
|
||||||
-name=>"templatePosition",
|
-label=>WebGUI::International::get(7,$_[0]->get("namespace"))
|
||||||
-label=>WebGUI::International::get(363),
|
|
||||||
-value=>[$_[0]->getValue("templatePosition")],
|
|
||||||
-uiLevel=>5,
|
|
||||||
-options=>WebGUI::Page::getTemplatePositions($session{page}{templateId}),
|
|
||||||
-subtext=>WebGUI::Page::drawTemplate($session{page}{templateId})
|
|
||||||
);
|
|
||||||
$f->getTab("privileges")->date(
|
|
||||||
-name=>"startDate",
|
|
||||||
-label=>WebGUI::International::get(497),
|
|
||||||
-value=>$_[0]->getValue("startDate")
|
|
||||||
);
|
);
|
||||||
$f->getTab("privileges")->date(
|
$layout->yesNo(
|
||||||
-name=>"endDate",
|
-name=>"overrideDisplayTitle",
|
||||||
-label=>WebGUI::International::get(498),
|
-value=>$_[0]->getValue("overrideDisplayTitle"),
|
||||||
-value=>$_[0]->getValue("endDate")
|
-label=>WebGUI::International::get(8,$_[0]->get("namespace"))
|
||||||
);
|
);
|
||||||
$a = WebGUI::SQL->read("select pageId,menuTitle from page where pageId<2 or pageId>25 order by menuTitle");
|
$properties->yesNo(
|
||||||
while (%page = $a->hash) {
|
-name=>"overrideDescription",
|
||||||
$b = WebGUI::SQL->read("select wobjectId,title from wobject
|
-value=>$_[0]->getValue("overrideTitle"),
|
||||||
where pageId=".$page{pageId}." and namespace<>'WobjectProxy' and
|
-label=>WebGUI::International::get(9,$_[0]->get("namespace"))
|
||||||
namespace<>'ExtraColumn' and endDate>=".time()." and pageId<>3 order by sequenceNumber");
|
);
|
||||||
while (%wobject = $b->hash) {
|
$layout->yesNo(
|
||||||
$wobjects{$wobject{wobjectId}} = $page{menuTitle}." / ".$wobject{title}." (".$wobject{wobjectId}.")";
|
-name=>"overrideTemplate",
|
||||||
}
|
-value=>$_[0]->getValue("overrideTitle"),
|
||||||
$b->finish;
|
-label=>WebGUI::International::get(10,$_[0]->get("namespace"))
|
||||||
}
|
);
|
||||||
$a->finish;
|
my @data = WebGUI::SQL->read("select page.urlizedTitle,wobject.title from wobject left join page on wobject.pageId=page.pageId
|
||||||
$f->getTab("properties")->select(
|
where wobject.wobjectId=".$_[0]->get("proxiedWobjectId"));
|
||||||
-name=>"proxiedWobjectId",
|
$properties->readonly(
|
||||||
-options=>\%wobjects,
|
|
||||||
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
|
-label=>WebGUI::International::get(1,$_[0]->get("namespace")),
|
||||||
-value=>[$_[0]->getValue("proxiedWobjectId")]
|
-value=>'<a href="'.WebGUI::URL::gateway($data[0]).'">'.$data[1].'</a>'
|
||||||
);
|
);
|
||||||
$output .= $f->print;
|
return $_[0]->SUPER::www_edit(
|
||||||
return $output;
|
-properties=>$properties->printRowsOnly,
|
||||||
|
-layout=>$layout->printRowsOnly,
|
||||||
|
-headingId=>2,
|
||||||
|
-helpId=>1
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue