Converting wobjects to use new global template mechanism.

This commit is contained in:
JT Smith 2003-05-18 00:22:31 +00:00
parent 50f9aa9171
commit 5ec7c67b66
20 changed files with 253 additions and 250 deletions

View file

@ -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();

View file

@ -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','<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;
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>&#94;a; or &#94;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>&#94;a("Account Info");</b>. \r\n<p>\r\n\r\n<b>NOTES:</b> You can also use the special case &#94;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>&#94;AdminText();</b><br>\r\nDisplays a small text message to a user who is in admin mode. Example: &#94;AdminText("You are in admin mode!");\r\n<p>\r\n\r\n<b>&#94;AdminToggle; or &#94;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: &#94;AdminToggle("Edit On","Edit Off");\r\n<p>\r\n\r\n<b>&#94;CanEditText();</b><br>\r\nDisplay a message to a user that can edit the current page.\r\n<p>\r\n<i>Example:</i> &#94;CanEditText(^AdminToggle;);\r\n<p>\r\n\r\n<b>&#94;EditableToggle; or &#94;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>&#94;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> &#94;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>&#94;L; or &#94;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 &#94;L(20);. You can also set the message displayed after the user is logged in like this &#94;L(20,Hi &#94;a(&#94;@;);. 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>&#94;LoginToggle; or &#94;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: &#94;LoginToggle("Click here to log in.","Click here to log out.");. You can also use the special case &#94;LoginToggle(linkonly); to return only the URL with no label.\r\n<p>\r\n\r\n<b>&#94;@; - Username</b><br>\r\nThe username of the currently logged in user.\r\n<p>\r\n\r\n\r\n<b>&#94;#; - 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>');