From e531f3166518dcb8db48902c45c5e1195573e53e Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 16 Apr 2003 01:07:51 +0000 Subject: [PATCH] added the WebGUI theme manager --- docs/upgrades/upgrade_5.2.4-5.3.0.sql | 211 ++++++++++- lib/WebGUI/Macro/AdminBar.pm | 16 +- lib/WebGUI/Operation.pm | 1 + lib/WebGUI/Operation/Theme.pm | 525 ++++++++++++++++++++++++++ lib/WebGUI/Session.pm | 1 - www/extras/doubleSelect.js | 55 +++ 6 files changed, 802 insertions(+), 7 deletions(-) create mode 100644 lib/WebGUI/Operation/Theme.pm create mode 100644 www/extras/doubleSelect.js diff --git a/docs/upgrades/upgrade_5.2.4-5.3.0.sql b/docs/upgrades/upgrade_5.2.4-5.3.0.sql index 395cf1de6..9f04a876f 100644 --- a/docs/upgrades/upgrade_5.2.4-5.3.0.sql +++ b/docs/upgrades/upgrade_5.2.4-5.3.0.sql @@ -56,7 +56,216 @@ insert into international (internationalId,languageId,namespace,message,lastUpda delete from international where languageId=1 and namespace='Poll' and internationalId=12; insert into international (internationalId,languageId,namespace,message,lastUpdated) values (12,1,'Poll','Total Votes', 1050182699); INSERT INTO template VALUES (1,'Default Poll','\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n
\r\n\r\n\r\n\r\n \r\n \r\n
\r\n
\r\n

\r\n \r\n \r\n\r\n\r\n\r\n \r\n



\r\n \r\n \r\n \r\n
\" class=\"pollColor\">  % ()
\r\n \r\n
:
\r\n\r\n
\r\n\r\n','Poll'); - +insert into groups (groupId,groupName,description) values (9,"Theme Managers","Users in this group can use the theme manager to create new themes and install themes from other systems."); +create table theme ( themeId int not null, name varchar(255), designer varchar(255), designerURL text, original int not null default 1); +create table themeComponent ( themeId int not null, themeComponentId int not null, type varchar(35), id int not null); +insert into incrementer values ("themeId",1000); +insert into incrementer values ("themeComponentId",1000); +alter table theme add column webguiVersion varchar(10); +alter table theme add column versionNumber int not null default 0; +alter table themeComponent change id id varchar(255); +delete from help where helpId=20 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (20, 'WebGUI', 670, 625, '49,WebGUI;'); +delete from help where helpId=1 and namespace='FileManager'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'FileManager', 61, 71, '3,FileManager;2,FileManager;21,WebGUI;'); +delete from help where helpId=28 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (28, 'WebGUI', 678, 633, '1,WebGUI;3,WebGUI;'); +delete from help where helpId=31 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (31, 'WebGUI', 681, 636, '30,WebGUI;1,WebGUI;3,WebGUI;'); +delete from help where helpId=30 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (30, 'WebGUI', 680, 635, '31,WebGUI;'); +delete from help where helpId=25 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (25, 'WebGUI', 675, 630, '60,WebGUI;'); +delete from help where helpId=1 and namespace='Item'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Item', 61, 71, '2,Item;21,WebGUI;'); +delete from help where helpId=6 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (6, 'WebGUI', 656, 611, '12,WebGUI;'); +delete from help where helpId=46 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (46, 'WebGUI', 696, 651, NULL); +delete from help where helpId=22 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (22, 'WebGUI', 672, 627, '12,WebGUI;'); +delete from help where helpId=1 and namespace='USS'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'USS', 61, 71, '3,USS;2,USS;21,WebGUI;'); +delete from help where helpId=24 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (24, 'WebGUI', 674, 629, '12,WebGUI;'); +delete from help where helpId=1 and namespace='FAQ'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'FAQ', 61, 71, '3,FAQ;2,FAQ;21,WebGUI;'); +delete from help where helpId=13 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (13, 'WebGUI', 663, 618, '12,WebGUI;'); +delete from help where helpId=1 and namespace='SyndicatedContent'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'SyndicatedContent', 61, 71, '2,SyndicatedContent;21,WebGUI;'); +delete from help where helpId=1 and namespace='EventsCalendar'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'EventsCalendar', 61, 71, '2,EventsCalendar;3,EventsCalendar;21,WebGUI;'); +delete from help where helpId=1 and namespace='MessageBoard'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'MessageBoard', 61, 71, '2,MessageBoard;21,WebGUI;'); +delete from help where helpId=1 and namespace='LinkList'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'LinkList', 61, 71, '3,LinkList;2,LinkList;21,WebGUI;'); +delete from help where helpId=21 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (21, 'WebGUI', 671, 626, '19,WebGUI;18,WebGUI;27,WebGUI;14,WebGUI;'); +delete from help where helpId=1 and namespace='Article'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Article', 61, 71, '2,Article;21,WebGUI;'); +delete from help where helpId=1 and namespace='ExtraColumn'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'ExtraColumn', 61, 71, '21,WebGUI;'); +delete from help where helpId=27 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (27, 'WebGUI', 677, 632, '1,Article;1,EventsCalendar;1,ExtraColumn;1,FAQ;1,FileManager;1,HttpProxy;1,Item;1,LinkList;1,MailForm;1,MessageBoard;1,Poll;1,Product;1,SiteMap;1,SQLReport;1,Survey;1,SyndicatedContent;1,USS;1,WobjectProxy;21,WebGUI;'); +delete from help where helpId=1 and namespace='Poll'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Poll', 61, 71, '2,Poll;21,WebGUI;'); +delete from help where helpId=1 and namespace='SiteMap'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'SiteMap', 61, 71, '2,SiteMap;21,WebGUI;'); +delete from help where helpId=1 and namespace='SQLReport'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'SQLReport', 61, 71, '21,WebGUI;'); +delete from help where helpId=18 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (18, 'WebGUI', 668, 623, NULL); +delete from help where helpId=17 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (17, 'WebGUI', 667, 622, '10,WebGUI;'); +delete from help where helpId=2 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'WebGUI', 652, 607, '12,WebGUI;'); +delete from help where helpId=15 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (15, 'WebGUI', 665, 620, '10,WebGUI;'); +delete from help where helpId=16 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (16, 'WebGUI', 666, 621, '60,WebGUI;9,WebGUI;'); +delete from help where helpId=14 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (14, 'WebGUI', 664, 619, '21,WebGUI;'); +delete from help where helpId=12 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (12, 'WebGUI', 662, 617, '6,WebGUI;29,WebGUI;13,WebGUI;24,WebGUI;22,WebGUI;2,WebGUI;'); +delete from help where helpId=10 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (10, 'WebGUI', 660, 615, '17,WebGUI;15,WebGUI;8,WebGUI;'); +delete from help where helpId=8 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (8, 'WebGUI', 658, 613, '10,WebGUI;32,WebGUI;5,WebGUI;7,WebGUI;'); +delete from help where helpId=9 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (9, 'WebGUI', 659, 614, '19,WebGUI;61,WebGUI;18,WebGUI;16,WebGUI;4,WebGUI;'); +delete from help where helpId=7 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (7, 'WebGUI', 657, 612, '8,WebGUI;'); +delete from help where helpId=32 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (32, 'WebGUI', 682, 637, '8,WebGUI;'); +delete from help where helpId=5 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (5, 'WebGUI', 655, 610, '8,WebGUI;'); +delete from help where helpId=3 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'WebGUI', 653, 608, '1,WebGUI;'); +delete from help where helpId=4 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (4, 'WebGUI', 654, 609, '9,WebGUI;'); +delete from help where helpId=1 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'WebGUI', 642, 606, '52,WebGUI;3,WebGUI;'); +delete from help where helpId=29 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (29, 'WebGUI', 679, 634, '12,WebGUI;'); +delete from help where helpId=33 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (33, 'WebGUI', 683, 638, '61,WebGUI;34,WebGUI;35,WebGUI;50,WebGUI;'); +delete from help where helpId=34 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (34, 'WebGUI', 684, 639, '33,WebGUI;'); +delete from help where helpId=35 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (35, 'WebGUI', 685, 640, '33,WebGUI;'); +delete from help where helpId=19 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (19, 'WebGUI', 669, 624, '53,WebGUI;58,WebGUI;57,WebGUI;60,WebGUI;59,WebGUI;'); +delete from help where helpId=1 and namespace='MailForm'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'MailForm', 61, 71, '21,WebGUI;'); +delete from help where helpId=2 and namespace='MailForm'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'MailForm', 62, 72, '1,MailForm;'); +delete from help where helpId=2 and namespace='FileManager'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'FileManager', 72, 73, '1,FileManager;'); +delete from help where helpId=2 and namespace='EventsCalendar'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'EventsCalendar', 72, 73, '4,EventsCalendar;1,EventsCalendar;'); +delete from help where helpId=2 and namespace='FAQ'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'FAQ', 72, 73, '1,FAQ;'); +delete from help where helpId=2 and namespace='LinkList'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'LinkList', 72, 73, '1,LinkList;'); +delete from help where helpId=47 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (47, 'WebGUI', 697, 698, '1,Article;17,WebGUI;1,MessageBoard;1,Poll;2,WebGUI;1,USS;'); +delete from help where helpId=1 and namespace='WobjectProxy'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'WobjectProxy', 5, 6, '21,WebGUI;'); +delete from help where helpId=1 and namespace='Product'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Product', 38, 39, '5,Product;4,Product;6,Product;2,Product;3,Product;7,Product;21,WebGUI;'); +delete from help where helpId=2 and namespace='Product'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'Product', 40, 41, '6,Product;1,Product;'); +delete from help where helpId=3 and namespace='Product'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'Product', 42, 43, '1,Product;'); +delete from help where helpId=4 and namespace='Product'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (4, 'Product', 44, 45, '1,Product;'); +delete from help where helpId=5 and namespace='Product'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (5, 'Product', 46, 47, '1,Product;'); +delete from help where helpId=6 and namespace='Product'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (6, 'Product', 49, 50, '2,Product;1,Product;'); +delete from help where helpId=7 and namespace='Product'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (7, 'Product', 62, 63, '1,Product;51,WebGUI;'); +delete from help where helpId=1 and namespace='Survey'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Survey', 3, 4, '21,WebGUI;'); +delete from help where helpId=49 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (49, 'WebGUI', 785, 786, '53,WebGUI;54,WebGUI;56,WebGUI;20,WebGUI;61,WebGUI;55,WebGUI;'); +delete from help where helpId=50 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (50, 'WebGUI', 825, 826, '33,WebGUI;'); +delete from help where helpId=2 and namespace='Article'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'Article', 72, 73, '1,Article;51,WebGUI;'); +delete from help where helpId=51 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (51, 'WebGUI', 827, 828, '2,Article;3,EventsCalendar;3,FAQ;3,FileManager;2,Item;3,LinkList;2,MessageBoard;7,Product;2,SiteMap;2,SyndicatedContent;33,WebGUI;2,USS;'); +delete from help where helpId=3 and namespace='EventsCalendar'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'EventsCalendar', 94, 95, '1,EventsCalendar;51,WebGUI;'); +delete from help where helpId=3 and namespace='FAQ'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'FAQ', 76, 77, '1,FAQ;51,WebGUI;'); +delete from help where helpId=3 and namespace='FileManager'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'FileManager', 75, 76, '1,FileManager;51,WebGUI;'); +delete from help where helpId=4 and namespace='EventsCalendar'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (4, 'EventsCalendar', 96, 97, '2,EventsCalendar;51,WebGUI;'); +delete from help where helpId=2 and namespace='Item'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'Item', 73, 74, '1,Item;51,WebGUI;'); +delete from help where helpId=3 and namespace='LinkList'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'LinkList', 75, 76, '1,LinkList;51,WebGUI;'); +delete from help where helpId=2 and namespace='MessageBoard'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'MessageBoard', 73, 74, '1,MessageBoard;51,WebGUI;'); +delete from help where helpId=2 and namespace='SiteMap'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'SiteMap', 72, 73, '1,SiteMap;51,WebGUI;'); +delete from help where helpId=2 and namespace='USS'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'USS', 74, 75, '1,USS;51,WebGUI;'); +delete from help where helpId=3 and namespace='USS'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'USS', 76, 77, '1,USS;51,WebGUI;'); +delete from help where helpId=52 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (52, 'WebGUI', 829, 830, '1,WebGUI;33,WebGUI;'); +delete from help where helpId=53 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (53, 'WebGUI', 831, 832, '49,WebGUI;19,WebGUI;'); +delete from help where helpId=54 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (54, 'WebGUI', 833, 834, '49,WebGUI;'); +delete from help where helpId=55 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (55, 'WebGUI', 835, 836, '49,WebGUI;'); +delete from help where helpId=56 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (56, 'WebGUI', 837, 838, '49,WebGUI;'); +delete from help where helpId=57 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (57, 'WebGUI', 839, 840, '19,WebGUI;'); +delete from help where helpId=58 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (58, 'WebGUI', 841, 842, '19,WebGUI;'); +delete from help where helpId=59 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (59, 'WebGUI', 843, 844, '19,WebGUI;'); +delete from help where helpId=60 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (60, 'WebGUI', 845, 846, '19,WebGUI;16,WebGUI;'); +delete from help where helpId=2 and namespace='SyndicatedContent'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'SyndicatedContent', 72, 73, '1,SyndicatedContent;'); +delete from help where helpId=1 and namespace='HttpProxy'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'HttpProxy', 10, 11, '21,WebGUI;'); +delete from help where helpId=2 and namespace='Poll'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'Poll', 73, 74, '1,Poll;51,WebGUI;'); +delete from help where helpId=61 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (61, 'WebGUI', 931, 932, '49,WebGUI;9,WebGUI;33,WebGUI;64,WebGUI;62,WebGUI;63,WebGUI;'); +delete from help where helpId=62 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (62, 'WebGUI', 933, 934, '61,WebGUI;'); +delete from help where helpId=63 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (63, 'WebGUI', 936, 937, '61,WebGUI;'); +delete from help where helpId=64 and namespace='WebGUI'; +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (64, 'WebGUI', 938, 939, '61,WebGUI;'); +delete from international where languageId=1 and namespace='WebGUI' and internationalId=931; +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (931,1,'WebGUI','Themes, Manage', 1050437240); +delete from international where languageId=1 and namespace='WebGUI' and internationalId=932; +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (932,1,'WebGUI','Themes are a mechanism to quickly install new styles, templates, and collateral into a WebGUI site. They are also great for moving those same items from one site to another.\r\n

\r\nTIP: When building a theme, be sure to name the components (styles, templates collateral) in the theme with some name that is unique to the theme. This is useful so that your users can find the components in your theme, as well as to avoid name conflicts.', 1050437240); +delete from international where languageId=1 and namespace='WebGUI' and internationalId=938; +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (938,1,'WebGUI','Theme, Delete', 1050437207); +delete from international where languageId=1 and namespace='WebGUI' and internationalId=939; +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (939,1,'WebGUI','When you delete a theme you\'ve created all you\'re actually deleting is the basic properties for the theme. However, when you delete a theme you\'ve imported, you\'ll also be deleting all of its components (styles, templates, and collateral) as well. Be careful that you are no longer using any of those components before deleting them.', 1050437207); +delete from international where languageId=1 and namespace='WebGUI' and internationalId=936; +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (936,1,'WebGUI','Theme, Import', 1050436484); +delete from international where languageId=1 and namespace='WebGUI' and internationalId=937; +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (937,1,'WebGUI','In order to import a theme you need a valid theme file exported from another WebGUI site. Just select the theme from your hard drive and click the "Import" button. You\'ll then get a confirmation screen asking whether this is the theme you wanted to import. If you agree, click on the "Import" button again and you\'ll have your new theme. You can then start to apply the theme to your site as you would any normal style, template, or collateral data.\r\n

\r\nYou cannot import a theme twice. If you wish to import a new version of a theme, then you must first delete the previous version of the theme. \r\n

\r\nYou also cannot import a theme from a version of WebGUI that is newer than the one you\'re using. Therefore if you are using WebGUI 5.2.4 and a theme was created with WebGUI 6.0.0, then you will not be allowed to import the theme until you upgrade.\r\n', 1050436484); +delete from international where languageId=1 and namespace='WebGUI' and internationalId=935; +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (935,1,'WebGUI','The file you uploaded does not appear to be a valid theme file.', 1050431137); +delete from international where languageId=1 and namespace='WebGUI' and internationalId=933; +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (933,1,'WebGUI','Theme, Edit', 1050430737); +delete from international where languageId=1 and namespace='WebGUI' and internationalId=934; +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (934,1,'WebGUI','Creating and editing themes is a fairly simple process. First you set up some basic properties for the theme, and then you start adding components to the theme. \r\n

\r\nThe basic properties of a theme cannot be changed by anyone except the site that the theme was created on. The following are the definitions of the basic properties of a theme:\r\n

\r\nTheme ID
\r\nThe unique ID for this theme within this WebGUI site. This ID will change if this theme is imported into another site.\r\n

\r\n\r\nTheme Name
\r\nThis is the unique name of the theme. It must be unique in every site that the theme will be imported into. This name will not change across sites.\r\n

\r\n\r\nTheme Designer
\r\nThe name of the person or company that created this theme. \r\n

\r\n\r\nDesigner URL
\r\nThe URL of the web site for this theme\'s designer. If you are in the business of creating themes for WebGUI, then this is your place to attract attention to your offerings.\r\n

\r\n\r\n', 1050430737); diff --git a/lib/WebGUI/Macro/AdminBar.pm b/lib/WebGUI/Macro/AdminBar.pm index 83880ea2d..2e1e8537d 100644 --- a/lib/WebGUI/Macro/AdminBar.pm +++ b/lib/WebGUI/Macro/AdminBar.pm @@ -66,7 +66,7 @@ sub process { }); #--admin functions %hash = (); - if (WebGUI::Privilege::isInGroup(3,$session{user}{userId})) { + if (WebGUI::Privilege::isInGroup(3)) { %hash = ( WebGUI::URL::page('op=listGroups')=>WebGUI::International::get(5), WebGUI::URL::page('op=manageSettings')=>WebGUI::International::get(4), @@ -77,7 +77,7 @@ sub process { WebGUI::URL::page('op=viewStatistics')=>WebGUI::International::get(144) ); } - if (WebGUI::Privilege::isInGroup(4,$session{user}{userId})) { + if (WebGUI::Privilege::isInGroup(4)) { %hash = ( 'http://validator.w3.org/check?uri=http%3A%2F%2F'.$session{env}{SERVER_NAME}. WebGUI::URL::page()=>WebGUI::International::get(399), @@ -86,24 +86,30 @@ sub process { %hash ); } - if (WebGUI::Privilege::isInGroup(5,$session{user}{userId})) { + if (WebGUI::Privilege::isInGroup(5)) { %hash = ( WebGUI::URL::page('op=listStyles')=>WebGUI::International::get(6), %hash ); } - if (WebGUI::Privilege::isInGroup(6,$session{user}{userId})) { + if (WebGUI::Privilege::isInGroup(6)) { %hash = ( WebGUI::URL::gateway('packages')=>WebGUI::International::get(374), %hash ); } - if (WebGUI::Privilege::isInGroup(8,$session{user}{userId})) { + if (WebGUI::Privilege::isInGroup(8)) { %hash = ( WebGUI::URL::page('op=listTemplates')=>WebGUI::International::get(508), %hash ); } + if (WebGUI::Privilege::isInGroup(9)) { + %hash = ( + WebGUI::URL::page('op=listThemes')=>WebGUI::International::get(900), + %hash + ); + } %hash = ( WebGUI::URL::page('op=viewHelpIndex')=>WebGUI::International::get(13), %hash diff --git a/lib/WebGUI/Operation.pm b/lib/WebGUI/Operation.pm index 53d5e29d6..bfe13e5ca 100644 --- a/lib/WebGUI/Operation.pm +++ b/lib/WebGUI/Operation.pm @@ -26,6 +26,7 @@ use WebGUI::Operation::Settings; use WebGUI::Operation::Statistics; use WebGUI::Operation::Style; use WebGUI::Operation::Template; +use WebGUI::Operation::Theme; use WebGUI::Operation::Trash; use WebGUI::Operation::User; diff --git a/lib/WebGUI/Operation/Theme.pm b/lib/WebGUI/Operation/Theme.pm new file mode 100644 index 000000000..1304e44bf --- /dev/null +++ b/lib/WebGUI/Operation/Theme.pm @@ -0,0 +1,525 @@ +package WebGUI::Operation::Theme; + +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2003 Plain Black LLC. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use Exporter; +use strict; +use Tie::IxHash; +use Tie::CPHash; +use WebGUI::Attachment; +use WebGUI::Collateral; +use WebGUI::HTMLForm; +use WebGUI::Icon; +use WebGUI::International; +use WebGUI::Node; +use WebGUI::Operation::Shared; +use WebGUI::Paginator; +use WebGUI::Privilege; +use WebGUI::Session; +use WebGUI::SQL; +use WebGUI::URL; +use WebGUI::Utility; + +our @ISA = qw(Exporter); +our @EXPORT = qw(&www_viewTheme &www_deleteThemeComponent &www_deleteThemeComponentConfirm &www_importTheme &www_importThemeValidate &www_importThemeSave &www_exportTheme &www_addThemeComponent &www_addThemeComponentSave &www_deleteTheme &www_deleteThemeConfirm &www_editTheme &www_editThemeSave &www_listThemes); + +#------------------------------------------------------------------- +sub _getComponentTypes { + my %components; + tie %components, 'Tie::IxHash'; + %components = ( + file=>WebGUI::International::get(915), + image=>WebGUI::International::get(914), + snippet=>WebGUI::International::get(916), + style=>WebGUI::International::get(912), + template=>WebGUI::International::get(913) + ); + return \%components; +} + + +#------------------------------------------------------------------- +sub _submenu { + my (%menu); + tie %menu, 'Tie::IxHash'; + $menu{WebGUI::URL::page('op=editTheme&themeId=new')} = WebGUI::International::get(901); + $menu{WebGUI::URL::page('op=importTheme')} = WebGUI::International::get(924); + unless (isIn($session{form}{op}, qw(editTheme deleteThemeConfirm viewTheme listThemes)) || $session{form}{themeId} ne "new") { + $menu{WebGUI::URL::page('op=editTheme&themeId='.$session{form}{themeId})} = WebGUI::International::get(919); + $menu{WebGUI::URL::page('op=deleteTheme&themeId='.$session{form}{themeId})} = WebGUI::International::get(918); + $menu{WebGUI::URL::page('op=exportTheme&themeId='.$session{form}{themeId})} = WebGUI::International::get(920); + } + $menu{WebGUI::URL::page('op=listThemes')} = WebGUI::International::get(900); + return menuWrapper($_[0],\%menu); +} + +#------------------------------------------------------------------- +sub www_addThemeComponent { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + my (@q, $output, $defaultList, $component, $f); + my $types = _getComponentTypes(); + push(@q,{query=>"select collateralId,name from collateral where collateralType='file' order by name",type=>"file"}); + push(@q,{query=>"select collateralId,name from collateral where collateralType='image' order by name",type=>"image"}); + push(@q,{query=>"select collateralId,name from collateral where collateralType='snippet' order by name",type=>"snippet"}); + push(@q,{query=>"select styleId,name from style order by name",type=>"style"}); + push(@q,{query=>"select templateId,namespace,name from template order by name",type=>"template"}); + $output .= '

'.WebGUI::International::get(909).'

'; + $output .= ' '; + $f = WebGUI::HTMLForm->new; + $f->hidden("op","addThemeComponentSave"); + $f->hidden("themeId",$session{form}{themeId}); + $f->selectList( + -name=>"type", + -value=>["style"], + -options=>$types, + -label=>WebGUI::International::get(910), + -extras=>'onChange="relate(this.form.type,this.form.id)"' + ); + $f->selectList( + -name=>"id", + -label=>WebGUI::International::get(911), + -options=>$defaultList + ); + $f->submit; + $output .= $f->print; + return _submenu($output); +} + +#------------------------------------------------------------------- +sub www_addThemeComponentSave { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + my $componentId = getNextId("themeComponentId"); + WebGUI::SQL->write("insert into themeComponent (themeId,themeComponentId,type,id) + values ($session{form}{themeId}, $componentId, ".quote($session{form}{type}).", + ".quote($session{form}{id}).")"); + return www_editTheme(); +} + +#------------------------------------------------------------------- +sub www_deleteTheme { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + return WebGUI::Privilege::vitalComponent() if ($session{form}{themeId} < 1000 && $session{form}{themeId} > 0); + my $output = helpIcon(64); + $output .= '

'.WebGUI::International::get(42).'

'; + $output .= WebGUI::International::get(907).'

'; + $output .= '

'.WebGUI::International::get(44).''; + $output .= '    '.WebGUI::International::get(45).'
'; + return _submenu($output); +} + +#------------------------------------------------------------------- +sub www_deleteThemeConfirm { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + return WebGUI::Privilege::vitalComponent() if ($session{form}{themeId} < 1000 && $session{form}{themeId} > 0); + my $theme = WebGUI::SQL->quickHashRef("select * from theme where themeId=".$session{form}{themeId}); + unless ($theme->{original}) { + WebGUI::SQL->write("delete from collateralFolder where name=".quote($theme->{name})); + my $sth = WebGUI::SQL->read("select type,Id from themeComponent where themeId=".$session{form}{themeId}); + while (my $component = $sth->hashRef) { + if ($component->{type} eq "style") { + WebGUI::SQL->write("delete from style where styleId=".$component->{id}); + } elsif ($component->{type} eq "template") { + my ($id,$namespace) = split("_",$component->{id}); + WebGUI::SQL->write("delete from template where templateId=".$id + ." and namespace=".quote($namespace)); + } else { + my $c = WebGUI::Collateral->new($component->{id}); + $c->delete; + } + } + $sth->finish; + } + WebGUI::SQL->write("delete from theme where themeId=".$session{form}{themeId}); + WebGUI::SQL->write("delete from themeComponent where themeId=".$session{form}{themeId}); + return www_listThemes(); +} + +#------------------------------------------------------------------- +sub www_deleteThemeComponent { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + return WebGUI::Privilege::vitalComponent() if ($session{form}{themeId} < 1000 && $session{form}{themeId} > 0); + my $output = helpIcon(4); + $output .= '

'.WebGUI::International::get(42).'

'; + $output .= WebGUI::International::get(908).'

'; + $output .= '

'.WebGUI::International::get(44).''; + $output .= '    '.WebGUI::International::get(45).'
'; + return _submenu($output); +} + +#------------------------------------------------------------------- +sub www_deleteThemeComponentConfirm { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + return WebGUI::Privilege::vitalComponent() if ($session{form}{themeId} < 1000 && $session{form}{themeId} > 0); + WebGUI::SQL->write("delete from themeComponent where themeComponentId=".$session{form}{themeComponentId}); + return www_editTheme(); +} + +#------------------------------------------------------------------- +sub www_editTheme { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + my ($output, $theme, $f); + unless($session{form}{themeId} eq "new") { + $theme = WebGUI::SQL->quickHashRef("select * from theme where themeId=$session{form}{themeId}"); + } + $output .= helpIcon(62); + $output .= '

'.WebGUI::International::get(902).'

'; + $f = WebGUI::HTMLForm->new; + $f->hidden("op","editThemeSave"); + $f->hidden("themeId",$session{form}{themeId}); + $f->readOnly($session{form}{themeId},WebGUI::International::get(903)); + $f->text("name",WebGUI::International::get(904),$theme->{name}); + $f->text("designer",WebGUI::International::get(905),$theme->{designer}); + $f->url( + -name=>"designerURL", + -label=>WebGUI::International::get(906), + -value=>$theme->{designerURL} + ); + if ($session{form}{themeId} eq "new") { + $f->whatNext( + -value=>"addComponent", + -options=>{ + listThemes=>WebGUI::International::get(900), + addComponent=>WebGUI::International::get(917) + } + ); + } + $f->submit; + $output .= $f->print; + unless ($session{form}{themeId} eq "new") { + $output .= '

' + .WebGUI::International::get(917).'

'; + my $componentTypes = _getComponentTypes(); + my @queries = ( + "select style.name as name, themeComponent.themeComponentId as componentId, 'style' as componentType + from themeComponent, style + where style.styleId=themeComponent.id and themeComponent.type='style' order by name", + "select collateral.name as name, themeComponent.themeComponentId as componentId, + collateral.collateralType as componentType from themeComponent, collateral + where collateral.collateralId=themeComponent.id and themeComponent.type=collateral.collateralType + order by name" + ); + foreach my $query (@queries) { + my $sth = WebGUI::SQL->read($query); + while (my $component = $sth->hashRef) { + $output .= deleteIcon('op=deleteThemeComponent&themeId='.$session{form}{themeId} + .'&themeComponentId='.$component->{componentId}) + .' '.$component->{name}.' ('.$componentTypes->{$component->{componentType}}.')
'; + } + $sth->finish; + } + my $sth = WebGUI::SQL->read("select themeComponentId,id from themeComponent + where type='template' and themeId=".$session{form}{themeId}); + while (my $data = $sth->hashRef) { + my ($templateId,$namespace) = split("_",$data->{id}); + my ($name) = WebGUI::SQL->quickArray("select name from template where + templateId=".$templateId." and namespace=".quote($namespace)); + $output .= deleteIcon('op=deleteThemeComponent&themeId='.$session{form}{themeId} + .'&themeComponentId='.$data->{themeComponentId}) + .' '.$name.' ('.$componentTypes->{template}.')
'; + } + $sth->finish; + } + return _submenu($output); +} + +#------------------------------------------------------------------- +sub www_editThemeSave { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + if ($session{form}{themeId} eq "new") { + $session{form}{themeId} = getNextId("themeId"); + WebGUI::SQL->write("insert into theme (themeId,webguiVersion,original,versionNumber) + values ($session{form}{themeId},".quote($WebGUI::VERSION).",1,0)"); + } + WebGUI::SQL->write("update theme set name=".quote($session{form}{name}).", designer=".quote($session{form}{designer}).", + designerURL=".quote($session{form}{designerURL})." where themeId=".$session{form}{themeId}); + if ($session{form}{proceed} eq "addComponent") { + return www_addThemeComponent(); + } + return www_listThemes(); +} + + + +#------------------------------------------------------------------- +sub www_exportTheme { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + my $tempId = "theme".$session{form}{themeId}; + my $propertyFile = WebGUI::Attachment->new("_theme.properties","temp",$tempId); + WebGUI::SQL->write("update theme set versionNumber=versionNumber+1, webguiVersion=".quote($WebGUI::VERSION) + ." where themeId=".$session{form}{themeId}); + my $theme = WebGUI::SQL->quickHashRef("select * from theme where themeId=".$session{form}{themeId}); + my $sth = WebGUI::SQL->read("select * from themeComponent where themeId=".$session{form}{themeId}); + while (my $component = $sth->hashRef) { + my $key = $component->{themeComponentId}; + $theme->{components}{$key}{type} = $component->{type}; + if ($component->{type} eq "image") { + my $c = WebGUI::Collateral->new($component->{id}); + $theme->{components}{$key}{properties} = $c->get; + $c->copy("temp",$tempId); + my $a = WebGUI::Attachment->new($c->getFilename,"temp",$tempId); + $theme->{components}{$key}{properties}{filename} = WebGUI::URL::makeCompliant($c->get("name")) + .".".$a->getType; + $a->rename($theme->{components}{$key}{properties}{filename}); + } elsif ($component->{type} eq "file") { + my $c = WebGUI::Collateral->new($component->{id}); + $theme->{components}{$key}{properties} = $c->get; + $c->copy("temp",$tempId); + my $a = WebGUI::Attachment->new($c->getFilename,"temp",$tempId); + $theme->{components}{$key}{properties}{filename} = WebGUI::URL::makeCompliant($c->get("name")) + .".".$a->getType; + $a->rename($theme->{components}{$key}{properties}{filename}); + } elsif ($component->{type} eq "snippet") { + my $c = WebGUI::Collateral->new($component->{id}); + $theme->{components}{$key}{properties} = $c->get; + } elsif ($component->{type} eq "style") { + $theme->{components}{$key}{properties} = WebGUI::SQL->quickHashRef("select * from style + where styleId=".$component->{id}); + } elsif ($component->{type} eq "template") { + my ($id, $namespace) = split("_",$component->{id}); + $theme->{components}{$key}{properties} = WebGUI::SQL->quickHashRef("select * from template + where templateId=".$id." and namespace=".quote($namespace)); + } + } + $sth->finish; + $propertyFile->saveFromHashref($theme); + my $packageName = WebGUI::URL::makeCompliant($theme->{name}).".theme"; + $propertyFile->getNode->tar($packageName); + my $export = WebGUI::Attachment->new($packageName,"temp"); + $session{header}{redirect} = WebGUI::Session::httpRedirect($export->getURL); + return ""; +} + + +#------------------------------------------------------------------- +sub www_importTheme { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + my $output = helpIcon(63); + $output .= '

'.WebGUI::International::get(927).'

'; + my $f = WebGUI::HTMLForm->new; + $f->hidden( + -name=>"op", + -value=>"importThemeValidate" + ); + $f->file( + -name=>"themePackage", + -label=>WebGUI::International::get(921) + ); + $f->submit(WebGUI::International::get(929)); + $output .= $f->print; + return _submenu($output); +} + +#------------------------------------------------------------------- +sub www_importThemeValidate { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + my $output = helpIcon(63); + $output .= '

'.WebGUI::International::get(927).'

'; + my $a = WebGUI::Attachment->new("","temp"); + my $filename = $a->save("themePackage"); + return $output.WebGUI::International::get(935) unless ($filename =~ /\.theme$/); + my $subnode = time(); + my $extracted = WebGUI::Node->new("temp",$subnode); + $extracted->untar($filename); + my $propertiesFile = WebGUI::Attachment->new("_theme.properties","temp",$subnode); + my $theme = $propertiesFile->getHashref; + my $f = WebGUI::HTMLForm->new; + $f->hidden( + -name=>"op", + -value=>"importThemeSave" + ); + $f->readOnly( + -label=>WebGUI::International::get(904), + -value=>$theme->{name} + ); + $f->readOnly( + -label=>WebGUI::International::get(905), + -value=>$theme->{designer} + ); + $f->readOnly( + -label=>WebGUI::International::get(906), + -value=>$theme->{designerURL} + ); + $f->hidden( + -name=>"extractionPoint", + -value=>$subnode + ); + $f->readOnly( + -label=>WebGUI::International::get(922), + -value=>"WebGUI ".$theme->{webguiVersion} + ); + $f->readOnly( + -label=>WebGUI::International::get(923), + -value=>$theme->{versionNumber} + ); + if ($theme->{webguiVersion} > $WebGUI::VERSION) { + $output .= WebGUI::International::get(926); + } elsif (0) { + $output .= WebGUI::International::get(925); + } else { + $output .= WebGUI::International::get(928); + $f->submit(WebGUI::International::get(929)); + } + $output .= "

".$f->print; + return _submenu($output); +} + +#------------------------------------------------------------------- +sub www_importThemeSave { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + my $propertiesFile = WebGUI::Attachment->new("_theme.properties","temp",$session{form}{extractionPoint}); + my $theme = $propertiesFile->getHashref; + my $themeId = getNextId("themeId"); + WebGUI::SQL->write("insert into theme (themeId,name,designer,designerURL,webguiVersion,versionNumber,original) values + ($themeId, ".quote($theme->{name}).", ".quote($theme->{designer}).", ".quote($theme->{designerURL}) + .", ".quote($theme->{webguiVersion}).", $theme->{versionNumber}, 0)"); + my $collateralFolderId = getNextId("collateralFolderId"); + WebGUI::SQL->write("insert into collateralFolder (collateralFolderId,name,parentId) values ($collateralFolderId, + ".quote($theme->{name}).", 0)"); + foreach my $key (keys %{$theme->{components}}) { + my $type = $theme->{components}{$key}{type}; + if (isIn($type, qw(style template))) { + $theme->{components}{$key}{properties}{$type."Id"} = getNextId($type."Id"); + my (@fields, @values); + foreach my $property (keys %{$theme->{components}{$key}{properties}}) { + push(@fields,$property); + push(@values,quote($theme->{components}{$key}{properties}{$property})); + } + WebGUI::SQL->write("insert into ".$type." (".join(",",@fields).") values (".join(",",@values).")"); + my $id = $theme->{components}{$key}{properties}{$type."Id"}; + $id .= "_".$theme->{components}{$key}{properties}{namespace} if ($type eq "template"); + WebGUI::SQL->write("insert into themeComponent (themeId,themeComponentId,type,id) + values ($themeId, ".getNextId("themeComponentId").", ".quote($type).", ".quote($id).")"); + } elsif (isIn($type, qw(image file snippet))) { + $theme->{components}{$key}{properties}{collateralFolderId} = $collateralFolderId; + my $c = WebGUI::Collateral->new("new"); + $c->set($theme->{components}{$key}{properties}); + $c->saveFromFilesystem($propertiesFile->getNode->getPath.$session{os}{slash} + .$theme->{components}{$key}{properties}{filename}); + WebGUI::SQL->write("insert into themeComponent (themeId,themeComponentId,type,id) + values ($themeId, ".getNextId("themeComponentId").", ".quote($type).", " + .quote($c->get("collateralId")).")"); + } + } + return www_listThemes(); +} + +#------------------------------------------------------------------- +sub www_listThemes { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + my (@data, @row, $i, $p); + my $output = helpIcon(61); + $output .= '

'.WebGUI::International::get(899).'

'; + my $sth = WebGUI::SQL->read("select themeId,name,original from theme order by name"); + while (@data = $sth->array) { + $row[$i] = ''.deleteIcon('op=deleteTheme&themeId='.$data[0]); + if ($data[2]) { + $row[$i] .= editIcon('op=editTheme&themeId='.$data[0]); + } else { + $row[$i] .= viewIcon('op=viewTheme&themeId='.$data[0]); + } + $row[$i] .= ''; + $row[$i] .= ''.$data[1].''; + $i++; + } + $sth->finish; + $p = WebGUI::Paginator->new(WebGUI::URL::page('op=listThemes'),\@row); + $output .= ''; + $output .= $p->getPage($session{form}{pn}); + $output .= '
'; + $output .= $p->getBarTraditional($session{form}{pn}); + return _submenu($output); +} + +#------------------------------------------------------------------- +sub www_viewTheme { + return WebGUI::Privilege::insufficient unless (WebGUI::Privilege::isInGroup(9)); + my ($output, $theme, $f); + $theme = WebGUI::SQL->quickHashRef("select * from theme where themeId=$session{form}{themeId}"); + $output .= '

'.WebGUI::International::get(930).'

'; + $f = WebGUI::HTMLForm->new; + my $f = WebGUI::HTMLForm->new; + $f->readOnly( + -value=>$session{form}{themeId}, + -label=>WebGUI::International::get(903) + ); + $f->readOnly( + -label=>WebGUI::International::get(904), + -value=>$theme->{name} + ); + $f->readOnly( + -label=>WebGUI::International::get(905), + -value=>$theme->{designer} + ); + $f->readOnly( + -label=>WebGUI::International::get(906), + -value=>$theme->{designerURL} + ); + $f->readOnly( + -label=>WebGUI::International::get(922), + -value=>"WebGUI ".$theme->{webguiVersion} + ); + $f->readOnly( + -label=>WebGUI::International::get(923), + -value=>$theme->{versionNumber} + ); + $output .= $f->print; + my $componentTypes = _getComponentTypes(); + my @queries = ( + "select style.name as name, themeComponent.themeComponentId as componentId, 'style' as componentType + from themeComponent, style + where style.styleId=themeComponent.id and themeComponent.type='style' order by name", + "select collateral.name as name, themeComponent.themeComponentId as componentId, + collateral.collateralType as componentType from themeComponent, collateral + where collateral.collateralId=themeComponent.id and themeComponent.type=collateral.collateralType + order by name" + ); + foreach my $query (@queries) { + my $sth = WebGUI::SQL->read($query); + while (my $component = $sth->hashRef) { + $output .= $component->{name}.' ('.$componentTypes->{$component->{componentType}}.')
'; + } + $sth->finish; + } + my $sth = WebGUI::SQL->read("select themeComponentId,id from themeComponent + where type='template' and themeId=".$session{form}{themeId}); + while (my $data = $sth->hashRef) { + my ($templateId,$namespace) = split("_",$data->{id}); + my ($name) = WebGUI::SQL->quickArray("select name from template where + templateId=".$templateId." and namespace=".quote($namespace)); + $output .= $name.' ('.$componentTypes->{template}.')
'; + } + $sth->finish; + return _submenu($output); +} + +1; diff --git a/lib/WebGUI/Session.pm b/lib/WebGUI/Session.pm index 49182f6e7..6f65ab0a6 100644 --- a/lib/WebGUI/Session.pm +++ b/lib/WebGUI/Session.pm @@ -302,7 +302,6 @@ The URL to redirect to. =cut sub httpRedirect { - return $session{cgi}->redirect($_[0]); } diff --git a/www/extras/doubleSelect.js b/www/extras/doubleSelect.js new file mode 100644 index 000000000..bcfbea64c --- /dev/null +++ b/www/extras/doubleSelect.js @@ -0,0 +1,55 @@ +var a=new Array(22); + +function getFormNum (formName) { + var formNum =-1; + for (i=0;i0;i--) list2.options[i] = null; // null out in reverse order (bug workarnd) + for(i=0;i