From a287beda581ad770ba404ab9ce82a83f514aaf40 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 28 Dec 2004 05:01:04 +0000 Subject: [PATCH] converting nav and more asset manager fixes --- docs/previousVersion.sql | 13 - docs/upgrades/upgrade_6.2.9-6.3.0.pl | 493 ++++++++++++++++-- docs/upgrades/upgrade_6.2.9-6.3.0.sql | 2 +- lib/WebGUI/Asset.pm | 88 ++-- lib/WebGUI/Asset/FilePile.pm | 10 +- lib/WebGUI/Asset/Wobject.pm | 34 +- lib/WebGUI/Asset/Wobject/Article.pm | 26 +- lib/WebGUI/Asset/Wobject/Navigation.pm | 469 +++++++++++++++++ lib/WebGUI/Asset/Wobject/SyndicatedContent.pm | 2 +- lib/WebGUI/Asset/Wobject/USS.pm | 18 +- lib/WebGUI/SQL.pm | 16 +- lib/WebGUI/i18n/English/Navigation.pm | 151 ------ lib/WebGUI/i18n/English/WebGUI.pm | 27 +- www/extras/assetManager/Asset.js | 15 +- www/extras/assetManager/AssetManager.js | 53 +- www/extras/assetManager/Display.js | 249 ++++----- www/extras/assetManager/EventManager.js | 33 +- www/extras/assetManager/Tools.js | 6 - www/extras/assetManager/assetManager.css | 57 +- 19 files changed, 1206 insertions(+), 556 deletions(-) create mode 100644 lib/WebGUI/Asset/Wobject/Navigation.pm diff --git a/docs/previousVersion.sql b/docs/previousVersion.sql index abc9742e4..b175fcae7 100644 --- a/docs/previousVersion.sql +++ b/docs/previousVersion.sql @@ -2511,10 +2511,6 @@ CREATE TABLE page ( INSERT INTO page VALUES ('1','0','Home','1001','3',0,'','home',1,'Home',NULL,'1',946710000,2082783600,NULL,NULL,NULL,NULL,NULL,NULL,'English','7','3',0,0,NULL,NULL,NULL,60,600,'3',0,1,22,0,'generate','WebGUI::Page',NULL,0,0); -INSERT INTO page VALUES ('4','0','Page Not Found','-6','3',21,'','page_not_found',0,'Page Not Found',NULL,'1',946710000,2082783600,NULL,NULL,NULL,NULL,NULL,NULL,'English','7','3',1,0,NULL,NULL,NULL,60,600,'3',0,23,24,0,'generate','WebGUI::Page',NULL,0,1); -INSERT INTO page VALUES ('3','0','Trash','5','3',22,'','trash',0,'Trash',NULL,'1',946710000,2082783600,NULL,NULL,NULL,NULL,NULL,NULL,'English','3','3',1,0,NULL,NULL,NULL,60,600,'3',0,25,26,0,'generate','WebGUI::Page',NULL,0,1); -INSERT INTO page VALUES ('2','0','Clipboard','4','3',23,'','clipboard',0,'Clipboard',NULL,'1',946710000,2082783600,NULL,NULL,NULL,NULL,NULL,NULL,'English','4','4',1,0,NULL,NULL,NULL,60,600,'3',0,27,28,0,'generate','WebGUI::Page',NULL,0,1); -INSERT INTO page VALUES ('5','0','Packages','2','3',24,'','packages',0,'Packages',NULL,'1',946710000,2082783600,NULL,NULL,NULL,NULL,NULL,NULL,'English','6','6',1,0,NULL,NULL,NULL,60,600,'3',0,29,30,0,'generate','WebGUI::Page',NULL,0,1); INSERT INTO page VALUES ('1000','1','Getting Started','1001','3',1,'','getting_started',1,'Getting Started','','1',946710000,2082783600,'',NULL,NULL,NULL,NULL,NULL,'English','7','3',0,0,NULL,NULL,NULL,60,600,'3',0,2,3,1,'generate','WebGUI::Page',NULL,0,0); INSERT INTO page VALUES ('1001','1','What should you do next?','1001','3',2,'','your_next_step',1,'Your Next Step','','1',946710000,2082783600,'',NULL,NULL,NULL,NULL,NULL,'English','7','3',0,0,NULL,NULL,NULL,60,600,'3',0,4,15,1,'generate','WebGUI::Page',NULL,0,0); INSERT INTO page VALUES ('1002','1','The Latest News','1001','3',3,'','the_latest_news',1,'The Latest News','','1',946710000,2082783600,'',NULL,NULL,NULL,NULL,NULL,'English','7','3',0,0,NULL,NULL,NULL,60,600,'3',0,16,17,1,'generate','WebGUI::Page',NULL,0,0); @@ -2775,10 +2771,7 @@ INSERT INTO template VALUES ('1','Default Messsage Log Display Template','

\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','Operation/MessageLog/Message',1,1); INSERT INTO template VALUES ('1','Default Edit Profile Template','\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\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
','Operation/Profile/Edit',1,1); INSERT INTO template VALUES ('1','Default Profile Display Template','\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
','Operation/Profile/View',1,1); -INSERT INTO template VALUES ('1','HTMLArea','^JavaScript(\"/textFix.js\");\r\n\r\n \r\n \r\n \r\n ^JavaScript(\"/htmlArea/editor.js\");\r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n','richEditor',1,1); INSERT INTO template VALUES ('5','lastResort','^JavaScript(\"/textFix.js\");\r\n\r\n\r\n\r\n\r\n\r\n','richEditor',1,1); -INSERT INTO template VALUES ('2','EditOnPro2','^JavaScript(\"/textFix.js\");\r\n\r\n','richEditor',1,1); -INSERT INTO template VALUES ('6','HTMLArea 3 (Mozilla / IE)','^JavaScript(\"/textFix.js\");\r\n \r\n\r\n^RawHeadTags(\r\n \r\n\r\n \r\n\r\n \r\n);\r\n\r\n \r\n\r\n \r\n\r\n ','richEditor',1,1); INSERT INTO template VALUES ('1','Default Overview Report','

\n\n\n \"> \n •\n \"> \n •\n \"> \n
\n \"> \n •\n \"> \n •\n \"> \n •\n \"> \n
\n\n

\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \">\n \n \n \n \n
\');\">
\n \n

\n \n

\n
\n
\n \n
\n \');\">\n
\n
\">\n \n

\n \n

\n \n
\n \n
\n
\n
\n
\n
\n


\n\n
\n\n\n\n
\n · · \n
\n
\n\n','Survey/Overview',1,1); INSERT INTO template VALUES ('1','Default Gradebook Report','

\n\n\n \"> \n •\n \"> \n •\n \"> \n
\n \"> \n •\n \"> \n •\n \"> \n •\n \"> \n
\n\n

\n\n\n\n \n \n\n\n \n \n \n\n\n
\">/%
\n\n\n\n
\n · · \n
\n
\n','Survey/Gradebook',1,1); INSERT INTO template VALUES ('1','Default Survey','\n

\n
\n\n\n\n

\n\n\n\n\n \n \n \n \n \n

\n : / \n
\n :% \n
\n
\n \n

\">\n
\n \n \n \n \n \n \n \n \n
\n \n

\n
\n
\n
\n \n
\n
\n
\n
\n
\n : /
\n \n : /
\n :% / 100%
\n
\n
\n
\n \n \n \">\n
\n \n\n \n \n \n \n \n\n
\n
\n\n \"> \n •\n \"> \n •\n \"> \n
\n \"> \n •\n \"> \n •\n \"> \n •\n \"> \n
\n\n\n\n

\n \">\n

\n \n \n \n
\n
\n
\n','Survey',1,1); @@ -2796,7 +2789,6 @@ INSERT INTO template VALUES ('5','Tabs','\r\n/Navigation/dtree/dtree.css\");\r\n^JavaScript(\"/Navigation/dtree/dtree.js\");\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n
','Navigation',1,1); INSERT INTO template VALUES ('1','Calendar Month (Big)','\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\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

 
HeaderData\" width=\"14%\" valign=\"top\" align=\"left\">

\n \n \n ·\">
\n
\n
\n
 
\n
\n\n\n\n

\n · · \n
\n
\n','EventsCalendar',1,1); INSERT INTO template VALUES ('7','Cool Menus','\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n^JavaScript(\"/coolmenus/coolmenus4.js\");\r\n','Navigation',1,1); -INSERT INTO template VALUES ('3','Midas','^JavaScript(\"/textFix.js\");\r\n\r\n\r\n \r\n \r\n\r\n\r\n\r\n','richEditor',1,1); INSERT INTO template VALUES ('2','Advanced Search','\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 \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
Search for:\' name=\"query\">in\r\n \r\n \r\n
Content in language:\r\n \r\n \" \r\n checked=\"1\" >
\r\n
\r\n
Created by:\r\n \r\n
Type of content:\r\n \r\n Number of Results:\r\n \r\n
\r\n
\r\n\r\n

\r\n\r\n

Results - of about \r\n containing \"\". Search took seconds.

\r\n
\r\n
    \">\r\n\r\n\r\n
  1. \r\n \">\r\n No Title\r\n \r\n by \">\r\n \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
  2. \r\n
    \r\n\r\n
\r\n\n\n\n\n
\n · · \n
\n
\n','IndexedSearch',1,1); INSERT INTO template VALUES ('3','Search in Help','\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 \r\n \r\n \r\n \r\n \r\n
\r\n \' name=\"query\">\r\n
In namespace: \r\n \r\n
\r\n
\r\n\r\n

\r\n\r\n

Results - of about \r\n containing \"\". Search took seconds.

\r\n
\r\n
    \">\r\n\r\n\r\n
  1. \r\n \">\r\n No Title\r\n
    \r\n \r\n
    \r\n
    \r\n Namespace: \r\n
    \r\n
    \r\n
    \r\n
  2. \r\n
    \r\n\r\n
\r\n\n\n\n\n
\n · · \n
\n
\n','IndexedSearch',1,1); INSERT INTO template VALUES ('1','Default Search','\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 \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \' name=\"query\">\r\n
\r\n \r\n \" \r\n \r\n \r\n \r\n checked=\"1\"\r\n \r\n \r\n checked=\"1\"\r\n \r\n \r\n checked=\"1\"\r\n \r\n >\r\n
\r\n
\r\n
\r\n \r\n \r\n \"\r\n \r\n \r\n \r\n checked=\"1\"\r\n \r\n \r\n checked=\"1\"\r\n \r\n \r\n checked=\"1\"\r\n \r\n >\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n

\r\n\r\n

Results - of about \r\n containing \"\". Search took seconds.

\r\n
    \">\r\n \r\n
  1. \r\n \">\r\n No Title\r\n
    \r\n \r\n
    \r\n
    \r\n Location: \r\n
    \r\n
    \r\n
    \r\n
  2. \r\n
    \r\n
\r\n
\n\n\n\n
\n · · \n
\n
\n','IndexedSearch',1,1); @@ -2818,11 +2810,8 @@ INSERT INTO template VALUES ('1','Default SMB Anonymous Registration Template',' INSERT INTO template VALUES ('1','Default WebGUI Yes/No Prompt','

\n\n

\n\n

\n\n
\n\n\">\n\n          \n\n\">\n\n
\n','prompt',1,1); INSERT INTO template VALUES ('1','Fail Safe','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \n \n ^AdminBar;\n\n\r\n^H; / ^Navigation(TopLevelMenuHorizontal_1000); / ^Navigation(currentMenuHorizontal_1001); / ^a;\r\n
\n\n\n \n \n\n
\r\n^H; / ^Navigation(TopLevelMenuHorizontal_1000); / ^Navigation(currentMenuHorizontal_1001); / ^a;\r\n\n \n ','style',0,0); INSERT INTO template VALUES ('1000','WebGUI 6 Admin Style','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \r\n \r\n\r\n\r\n\n \n \r\n\r\n^AdminBar(2);

\r\n\r\n
\r\n \n \n \r\n
\r\n\r\n\r\n
^H; / ^PageTitle; / ^AdminToggle; / ^LoginToggle; / ^a;
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n \n ','style',1,1); -INSERT INTO template VALUES ('4','Clipboard','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \n \n ^AdminBar;\n\n\r\n\r\n\r\n\r\n\r\n
Clipboard\r\n^H; / ^a;
\r\n
PAGES
^Navigation(FlexMenu_1002);
CONTENT
\n\n\n \n \n\n
\r\n\r\n\r\n
\r\n^H; / ^a;\r\n\n \n ','style',0,0); INSERT INTO template VALUES ('1001','WebGUI 6','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \r\n \n \n \r\n^AdminBar(2);\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n
^L(17,\"\",2); ^AdminToggle;
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\n         \r\n\"home\" \n \"Email\"\r\n\"Print\" \n \"Site \"Plain\r\n^Spacer(56,1);^Spacer(26,1);
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
^Spacer(53,59);^D(\"%c %D, %y\");
^PageTitle;
^Spacer(53,59);
\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
^Spacer(53,1);\r\n
\r\n^Navigation(FlexMenu_1002);\r\n


\r\n\r\n
\n \n ^Spacer(53,1);
\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n

Design by Plain Black
\r\n\n \n ','style',1,1); INSERT INTO template VALUES ('3','Make Page Printable','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \n \n ^AdminBar;\n\n\r\n
\n\n\n \n \n\n
© 2001-2004 Plain Black LLC
\r\n\n \n ','style',1,1); -INSERT INTO template VALUES ('5','Trash','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \n \n ^AdminBar;\n\n\r\n\r\n\r\n\r\n\r\n
Trash\r\n^H; / ^a; / Empty Trash
\r\n
PAGES
^Navigation(FlexMenu_1002);
CONTENT
\n\n\n \n \n\n
\r\n\r\n\r\n
\r\n^H; / ^a; / Empty Trash\r\n\n \n ','style',0,0); -INSERT INTO template VALUES ('2','Packages','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \n \n ^AdminBar;\n\n\r\n\r\n\r\n\r\n\r\n
Packages\r\n^H; / ^a;
\r\n
PACKAGES
^Navigation(FlexMenu_1002);
CONTENT
\n\n\n \n \n\n
\r\n\r\n\r\n
\r\n^H; / ^a;\r\n\n \n ','style',0,0); INSERT INTO template VALUES ('10','htmlArea Image Manager','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \r\n\n \n \r\n\r\n\r\n\r\n\r\n\r\n\n \n \r\n\n \n ','style',1,0); INSERT INTO template VALUES ('6','Empty','','style',0,0); INSERT INTO template VALUES ('5','Item','\r\n \r\n \">\r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n\r\n - \r\n \">\" border=\"0\" alt=\"\" width=\"16\" height=\"16\" border=\"0\" align=\"middle\" />\r\n\r\n\r\n\r\n - \r\n','Article',1,1); @@ -2845,7 +2834,6 @@ INSERT INTO template VALUES ('1','Default Make Printable','\">','Macro/LoginToggle',1,1); INSERT INTO template VALUES ('1','Attachment Box','

\r\n \r\n \r\n \r\n \r\n
\r\n\">/attachment.gif\" border=\"0\" alt=\"\">\r\n\">\" align=\"middle\" width=\"16\" height=\"16\" border=\"0\" alt=\"\">\r\n
\r\n

\r\n','AttachmentBox',1,1); INSERT INTO template VALUES ('1','Default Post Preview','

\n\n

\n\n\n\n\n\n
\n\n
\n\n\n\n\n','Forum/PostPreview',1,1); -INSERT INTO template VALUES ('4','Classic','^JavaScript(\"/textFix.js\");\r\n\r\n\r\n \r\n \r\n\r\n\r\n\r\n','richEditor',1,1); -- -- Table structure for table `theme` @@ -3136,7 +3124,6 @@ CREATE TABLE wobject ( -- -INSERT INTO wobject VALUES ('-1','4','SiteMap',0,'Page Not Found',1,'The page you were looking for could not be found on this system. Perhaps it has been deleted or renamed. The following list is a site map of this site. If you don\'t find what you\'re looking for on the site map, you can always start from the Home Page.',1001744792,'3',1016077239,'3',1,1001744792,1336444487,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'2','3','3','7','1003'); INSERT INTO wobject VALUES ('1','1','Article',1,'Welcome',1,'Welcome to WebGUI. This is web done right.\n

\nWebGUI is a user-friendly web site management system made by Plain Black. It is designed to be easy to use for the average business user, but powerful enough to satisfy the needs of a large enterprise.\n

\nThere are thousands of small and large businesses, schools, universities, governments, clubs, projects, communities, and individuals using WebGUI all over the world today. A brief list of some of them can be found here. There\'s no reason your site shouldn\'t be on that list.

',1076701903,'3',1076707751,'3',1,946710000,2082783600,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'1','3','3','7','1005'); INSERT INTO wobject VALUES ('2','1','Article',2,'Key Benefits',1,'\n\n\n
\n\n
Easy to Use
\n
If you can use a web browser, then you can manage a web site with WebGUI. WebGUI\'s unique WYSIWYG inline content editing interface ensures that you know where you are and what your content will look like while you\'re editing. In addition, you don\'t need to install and learn any complicated programs, you can edit everything with your trusty web browser.
\n
\n\n
Flexible Designs
\n
WebGUI\'s powerful templating system ensures that no two WebGUI sites ever need to look the same. You\'re not restricted in how your content is laid out or how your navigation functions.
\n
\n\n
Work Faster
\n
Though there is some pretty cool technology behind the scenes that makes WebGUI work, our first concern has always been usability and not technology. After all if it\'s not useful, why use it? With that in mind WebGUI has all kinds of wizards, short cuts, online help, and other aids to help you work faster.
\n
\n\n
Localized Content
\n
With WebGUI there\'s no need to limit yourself to one language or timezone. It\'s a snap to build a multi-lingual site with WebGUI. In fact, even WebGUI\'s built in functions and online help have been translated to more than 15 languages. User\'s can also adjust their local settings for dates, times, and other localized oddities.
\n
\n\n
Pluggable By Design
\n
When Plain Black created WebGUI we knew we wouldn\'t be able to think of everything you want to use WebGUI for, so we made most of WebGUI\'s functions pluggable. This allows you to add new features to WebGUI and still be able to upgrade the core system without a fuss.
\n\n
',1076702850,'3',1076707868,'3',1,946710000,2082783600,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'1','3','3','7','1007'); INSERT INTO wobject VALUES ('3','1000','Article',1,'Getting Started',0,'If you\'re reading this message it means that you\'ve got WebGUI up and running. Good job! The installation is not trivial.\n\n

\n \nIn order to do anything useful with your new installation you\'ll need to log in as the default administrator account. Follow these steps to get started:\n\n

\n\n

    \n
  1. Click here to log in. (username: Admin password: 123qwe)\n
  2. Click here to turn the administrative interface on.\n
\n
\nNOTE: You could have also done these steps using the block at the top of this page.\n
\n\n

\n\nNow that you\'re in as the administrator, you should change your password so no one else can log in and mess with your site. You might also want to create another account for yourself with Administrative privileges in case you can\'t log in with the Admin account for some reason.\n\n

\n \nYou\'ll now notice little buttons and menus on all the pages in your site. These controls help you administer your site. The \"Add content\" menu lets you add new content to your pages as well as paste content from the clipboard. The \"Administrative functions\" menu let\'s you control users and groups as well as many other admin settings. The little toolbars help you manipulate the content in your pages.\n\n\n

\n\nFor more information about how to administer WebGUI consider getting a copy of Ruling WebGUI. Plain Black Software also provides several Support Programs for WebGUI if you run into trouble.\n\n

\n \nEnjoy your new WebGUI site!',1076704456,'3',1076704456,'3',1,946710000,2082783600,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'1','3','3','7','1009'); diff --git a/docs/upgrades/upgrade_6.2.9-6.3.0.pl b/docs/upgrades/upgrade_6.2.9-6.3.0.pl index 689b3dc73..76fdc0d5d 100644 --- a/docs/upgrades/upgrade_6.2.9-6.3.0.pl +++ b/docs/upgrades/upgrade_6.2.9-6.3.0.pl @@ -82,12 +82,15 @@ WebGUI::SQL->write("alter table wobject add printableStyleTemplateId varchar(22) WebGUI::SQL->write("alter table wobject add cacheTimeout int not null default 60"); WebGUI::SQL->write("alter table wobject add cacheTimeoutVisitor int not null default 3600"); WebGUI::SQL->write("alter table wobject drop primary key"); +# next 2 lines are for sitemap to nav migration +WebGUI::SQL->write("alter table Navigation rename tempoldnav"); +WebGUI::SQL->write("create table Navigation (assetId varchar(22) not null primary key, assetsToInclude text, startType varchar(35), startPoint varchar(255), endPoint varchar(35), showSystemPages int not null default 0, showHiddenPages int not null default 0, showUnprivilegedPages int not null default 0)"); my $sth = WebGUI::SQL->read("select distinct(namespace) from wobject"); while (my ($namespace) = $sth->array) { WebGUI::SQL->write("alter table ".$namespace." add column assetId varchar(22) not null"); } $sth->finish; -walkTree('0','theroot','000001','1'); +walkTree('0','PBasset000000000000001','000001','1'); print "\t\tMaking second round of table structure changes\n" unless ($quiet); WebGUI::SQL->write("drop table SiteMap"); WebGUI::SQL->write("delete from template where namespace in ('SiteMap')"); @@ -123,87 +126,152 @@ WebGUI::SQL->write("alter table wobject drop column bufferPrevId"); WebGUI::SQL->write("alter table wobject drop column forumId"); WebGUI::SQL->write("alter table wobject drop column startDate"); WebGUI::SQL->write("alter table wobject drop column endDate"); +WebGUI::SQL->write("alter table wobject drop column addedBy"); +WebGUI::SQL->write("alter table wobject drop column dateAdded"); +WebGUI::SQL->write("alter table wobject drop column editedBy"); +WebGUI::SQL->write("alter table wobject drop column lastEdited"); WebGUI::SQL->write("alter table wobject drop column allowDiscussion"); WebGUI::SQL->write("drop table page"); WebGUI::SQL->write("alter table Article drop column image"); WebGUI::SQL->write("alter table Article drop column attachment"); +my %migration; -print "\tUpdating navigation to work with asset tree\n" unless ($quiet); -WebGUI::SQL->write("alter table Navigation add column assetsToInclude text"); -WebGUI::SQL->write("alter table Navigation add column startType varchar(35)"); -WebGUI::SQL->write("alter table Navigation add column startPoint varchar(35)"); -WebGUI::SQL->write("alter table Navigation add column baseType varchar(35)"); -WebGUI::SQL->write("alter table Navigation add column basePage varchar(255)"); -WebGUI::SQL->write("alter table Navigation add column endType varchar(35)"); -WebGUI::SQL->write("alter table Navigation add column endPoint varchar(35)"); -my $sth = WebGUI::SQL->read("select * from Navigation"); +print "\tConverting navigation system to asset tree\n" unless ($quiet); +my ($navRootLineage) = WebGUI::SQL->quickArray("select assetId,title,lineage from asset where length(lineage)=12 order by lineage desc limit 1"); +$navRootLineage = sprintf("%012d",("000001000005"+1)); +my $navRootId = WebGUI::SQL->setRow("asset","assetId",{ + assetId=>"new", + isHidden=>1, + title=>"Navigation Configurations", + menuTitle=>"Navigation Configurations", + url=>fixUrl('doesntexistyet',"Navigation Configurations"), + ownerUserId=>"3", + groupIdView=>"4", + groupIdEdit=>"4", + parentId=>"PBasset000000000000001", + lineage=>$navRootLineage, + lastUpdated=>time(), + className=>"WebGUI::Admin::Wobject::Navigation", + state=>"published" + }); +WebGUI::SQL->setRow("wobject","assetId",{ + assetId=>$navRootId, + templateId=>"1", + styleTemplateId=>"1", + printableStyleTemplateId=>"3" + },undef,$navRootId); +WebGUI::SQL->setRow("Navigation","assetId",{ + assetId=>$navRootId, + startType=>"relativeToCurrentUrl", + startPoint=>"0", + endPoint=>"55", + assetsToInclude=>"descendants" + },undef,$navRootId); +my $sth = WebGUI::SQL->read("select * from tempoldnav"); +my $navRankCounter = 1; while (my $data = $sth->hashRef) { - my %newNav; - $newNav{navigationId} = $data->{navigationId}; - $newNav{identifier} = $data->{identifier}; + print "\t\tConverting ".$data->{identifier}."\n" unless ($quiet); + my (%newNav,%newAsset,%newWobject); + $newNav{assetId} = $newWobject{assetId} = $newAsset{assetId} = getNewId("nav",$data->{navigationId}); + $newAsset{url} = fixUrl($newAsset{assetId},$data->{identifier}); + $newAsset{isHidden} = 1; + $newAsset{title} = $newAsset{menuTitle} = $data->{identifier}; + $newAsset{ownerUserId} = "3"; + $newAsset{groupIdView} = $newAsset{groupIdEdit} = "4"; + $newAsset{className} = 'WebGUI::Asset::Wobject::Navigation'; + $newAsset{state} = 'published'; + $newAsset{lastUpdated} = time(); + $newAsset{parentId} = $navRootId; + $newAsset{lineage} = $navRootLineage.sprintf("%06d",$navRankCounter); + $newWobject{templateId} = $data->{templateId}; + $newWobject{styleTemplateId}="1"; + $newWobject{printableStyleTemplateId}="3"; $newNav{showSystemPages} = $data->{showSystemPages}; $newNav{showHiddenPages} = $data->{showHiddenPages}; $newNav{showUnprivilegedPages} = $data->{showUnprivilegedPages}; - $newNav{startType} = "relativeToRoot"; - $newNav{startPoint} = $data->{stopAtLevel}+1; if ($data->{startAt} eq "root") { - $newNav{baseType} = "relativeToRoot"; - $newNav{basePage} = "0"; + $newNav{startType} = "relativeToRoot"; + $newNav{startPoint} = "0"; } elsif ($data->{startAt} eq "WebGUIroot") { - $newNav{baseType} = "relativeToRoot"; - $newNav{basePage} = "1"; + $newNav{startType} = "relativeToRoot"; + $newNav{startPoint} = "1"; } elsif ($data->{startAt} eq "top") { - $newNav{baseType} = "relativeToRoot"; - $newNav{basePage} = "2"; + $newNav{startType} = "relativeToRoot"; + $newNav{startPoint} = "2"; } elsif ($data->{startAt} eq "grandmother") { - $newNav{baseType} = "relativeToCurrentPage"; - $newNav{basePage} = "-2"; + $newNav{startType} = "relativeToCurrentUrl"; + $newNav{startPoint} = "-2"; } elsif ($data->{startAt} eq "mother") { - $newNav{baseType} = "relativeToCurrentPage"; - $newNav{basePage} = "-1"; + $newNav{startType} = "relativeToCurrentUrl"; + $newNav{startPoint} = "-1"; } elsif ($data->{startAt} eq "current") { - $newNav{baseType} = "relativeToCurrentPage"; - $newNav{basePage} = "0"; + $newNav{startType} = "relativeToCurrentUrl"; + $newNav{startPoint} = "0"; } elsif ($data->{startAt} eq "daughter") { - $newNav{baseType} = "relativeToCurrentPage"; - $newNav{basePage} = "1"; + $newNav{startType} = "relativeToCurrentUrl"; + $newNav{startPoint} = "1"; } else { - $newNav{baseType} = "specificUrl"; - $newNav{basePage} = $data->{startAt}; + $newNav{startType} = "specificUrl"; + $newNav{startPoint} = $data->{startAt}; } - $newNav{endType} = "relativeToBasePage"; - $newNav{endPoint} = ($data->{depth} == 99)?55:$data->{stopAtLevel}); + $newNav{endPoint} = (($data->{depth} == 99)?55:$data->{depth}); if ($data->{method} eq "daughters") { + $newNav{endPoint} = "1"; $newNav{assetsToInclude} = "descendants"; } elsif ($data->{method} eq "sisters") { $newNav{assetsToInclude} = "siblings"; } elsif ($data->{method} eq "self_and_sisters") { - $newNav{assetsToInclude} = "self,siblings"; + $newNav{assetsToInclude} = "self\nsiblings"; } elsif ($data->{method} eq "descendants") { $newNav{assetsToInclude} = "descendants"; } elsif ($data->{method} eq "self_and_descendants") { - $newNav{assetsToInclude} = "self,descendants"; + $newNav{assetsToInclude} = "self\ndescendants"; } elsif ($data->{method} eq "leaves_under") { + $newNav{endPoint} = "1"; $newNav{assetsToInclude} = "descendants"; } elsif ($data->{method} eq "generation") { - $newNav{assetsToInclude} = "self,sisters"; + $newNav{assetsToInclude} = "self\nsisters"; } elsif ($data->{method} eq "ancestors") { - $newNav{assetsToInclude} = "ancestors"; + $newNav{endPoint} += $newNav{startPoint} unless ($newNav{startType} eq "specificUrl"); + $newNav{startType} = "relativeToRoot"; + $newNav{startPoint} = $data->{stopAtLevel}+1; + $newNav{assetsToInclude} = "descendants"; } elsif ($data->{method} eq "self_and_ancestors") { - $newNav{assetsToInclude} = "self,ancestors"; + $newNav{endPoint} += $newNav{startPoint} unless ($newNav{startType} eq "specificUrl"); + $newNav{startType} = "relativeToRoot"; + $newNav{startPoint} = $data->{stopAtLevel}+1; + $newNav{assetsToInclude} = "self\ndescendants"; } elsif ($data->{method} eq "pedigree") { + $newNav{endPoint} += $newNav{startPoint} unless ($newNav{startType} eq "specificUrl"); + $newNav{startType} = "relativeToRoot"; + $newNav{startPoint} = $data->{stopAtLevel}+1; $newNav{assetsToInclude} = "pedigree"; } - WebGUI::SQL->setRow("Navigation","navigationId",\%newNav); + WebGUI::SQL->setRow("asset","assetId",\%newAsset,undef,$newNav{assetId}); + WebGUI::SQL->setRow("wobject","assetId",\%newWobject,undef,$newNav{assetId}); + WebGUI::SQL->setRow("Navigation","assetId",\%newNav,undef,$newNav{assetId}); + $navRankCounter++; } $sth->finish; -WebGUI::SQL->write("alter table Navigation drop column depth"); -WebGUI::SQL->write("alter table Navigation drop column startAt"); -WebGUI::SQL->write("alter table Navigation drop column stopAtLevel"); -WebGUI::SQL->write("alter table Navigation drop column method"); -WebGUI::SQL->write("alter table Navigation drop column reverse"); +WebGUI::SQL->write("update Navigation set startPoint='root' where startPoint='nameless_root'"); +WebGUI::SQL->write("drop table tempoldnav"); + + +print "\tDeleting files which are no longer used.\n" unless ($quiet); +#unlink("../../lib/WebGUI/Page.pm"); +#unlink("../../lib/WebGUI/Operation/Page.pm"); +#unlink("../../lib/WebGUI/Navigation.pm"); +#unlink("../../lib/WebGUI/Operation/Navigation.pm"); +#unlink("../../lib/WebGUI/Attachment.pm"); +#unlink("../../lib/WebGUI/Node.pm"); +#unlink("../../lib/WebGUI/Wobject/Article.pm"); +#unlink("../../lib/WebGUI/Wobject/SiteMap.pm"); +#unlink("../../lib/WebGUI/Wobject/DataForm.pm"); +#unlink("../../lib/WebGUI/Wobject/USS.pm"); +#unlink("../../lib/WebGUI/Wobject/FileManager.pm"); + WebGUI::Session::close(); @@ -316,18 +384,17 @@ sub walkTree { rmtree($session{config}{uploadsPath}.'/'.$wobject->{wobjectId}); } elsif ($wobject->{namespace} eq "SiteMap") { print "\t\t\tConverting SiteMap ".$wobject->{wobjectId}." into Navigation\n" unless ($quiet); - my $navident = 'SiteMap_'.$namespace->{wobjectId}; my ($starturl) = WebGUI::SQL->quickArray("select urlizedTitle from page where pageId=".quote($namespace->{startAtThisLevel})); - WebGUI::SQL->write("insert into Navigation (navigationId, identifier, depth, startAt, - templateId) values (".quote(WebGUI::Id::generate()).", ".quote($navident).", - ".quote($namespace->{depth}).", ".quote($starturl).", '1')"); - my $navmacro = $wobject->{description}.'

^Navigation('.$navident.');

'; - WebGUI::SQL->write("update asset set className='WebGUI::Asset::Wobject::Article' where assetId=".quote($wobjectId)); - WebGUI::SQL->write("update wobject set namespace='Article', description=".quote($navmacro)." - where assetId=".quote($wobjectId)); - WebGUI::SQL->write("insert into Article (assetId,wobjectId) values (".quote($wobjectId).", - ".quote($wobject->{wobjectId}).")"); + WebGUI::SQL->setRow("Navigation","assetId",{ + assetId=>$wobjectId, + endPoint=>$namespace->{depth}, + startPoint=>$starturl, + startType=>"specificUrl", + assetsToInclude=>"descendants" + },undef,$wobjectId); + WebGUI::SQL->write("update asset set className='WebGUI::Asset::Wobject::Navigation' where assetId=".quote($wobjectId)); + WebGUI::SQL->write("update wobject set namespace='Navigation', templateId='1' where assetId=".quote($wobjectId)); } elsif ($wobject->{namespace} eq "FileManager") { print "\t\t\tConverting File Manager ".$wobject->{wobjectId}." into File Folder Layout\n" unless ($quiet); WebGUI::SQL->write("update asset set className='WebGUI::Asset::Layout' where assetId=".quote($wobjectId)); @@ -469,3 +536,321 @@ sub isIn { } +sub getNewId { + my $type = shift; + my $oldId = shift; + my $namespace = shift; + my $migration = {'tmpl' => { + 'Operation/MessageLog/View' => { + '1' => 'PBtmpl0000000000000050' + }, + 'Forum/Search' => { + '1' => 'PBtmpl0000000000000031' + }, + 'Auth/WebGUI/Account' => { + '1' => 'PBtmpl0000000000000010' + }, + 'Forum/PostPreview' => { + '1' => 'PBtmpl0000000000000030' + }, + 'MessageBoard' => { + '1' => 'PBtmpl0000000000000047' + }, + 'FileManager' => { + '1' => 'PBtmpl0000000000000025', + '2' => 'PBtmpl0000000000000087' + }, + 'Operation/Profile/View' => { + '1' => 'PBtmpl0000000000000052' + }, + 'Forum/PostForm' => { + '1' => 'PBtmpl0000000000000029' + }, + 'Operation/RedeemSubscription' => { + '1' => 'PBtmpl0000000000000053' + }, + 'Navigation' => { + '8' => 'PBtmpl0000000000000136', + '6' => 'PBtmpl0000000000000130', + '1001' => 'PBtmpl0000000000000075', + '4' => 'PBtmpl0000000000000117', + '1' => 'PBtmpl0000000000000048', + '3' => 'PBtmpl0000000000000108', + '7' => 'PBtmpl0000000000000134', + '1000' => 'PBtmpl0000000000000071', + '2' => 'PBtmpl0000000000000093', + '5' => 'PBtmpl0000000000000124' + }, + 'Macro/L_loginBox' => { + '1' => 'PBtmpl0000000000000044', + '2' => 'PBtmpl0000000000000092' + }, + 'Commerce/ConfirmCheckout' => { + '1' => 'PBtmpl0000000000000016' + }, + 'prompt' => { + '1' => 'PBtmpl0000000000000057' + }, + 'Auth/SMB/Login' => { + '1' => 'PBtmpl0000000000000009' + }, + 'ImageAsset' => { + '2' => 'PBtmpl0000000000000088' + }, + 'AttachmentBox' => { + '1' => 'PBtmpl0000000000000003' + }, + 'Forum' => { + '1' => 'PBtmpl0000000000000026' + }, + 'Poll' => { + '1' => 'PBtmpl0000000000000055' + }, + 'FileAsset' => { + '1' => 'PBtmpl0000000000000024' + }, + 'HttpProxy' => { + '1' => 'PBtmpl0000000000000033' + }, + 'Auth/SMB/Create' => { + '1' => 'PBtmpl0000000000000008' + }, + 'Commerce/ViewPurchaseHistory' => { + '1' => 'PBtmpl0000000000000019' + }, + 'Article' => { + '6' => 'PBtmpl0000000000000129', + '4' => 'PBtmpl0000000000000115', + '1' => 'PBtmpl0000000000000002', + '3' => 'PBtmpl0000000000000103', + '2' => 'PBtmpl0000000000000084', + '5' => 'PBtmpl0000000000000123' + }, + 'style' => { + '6' => 'PBtmpl0000000000000132', + 'adminConsole' => 'PBtmpl0000000000000137', + '3' => 'PBtmpl0000000000000111', + '1001' => 'PBtmpl0000000000000076', + '1' => 'PBtmpl0000000000000060', + '1000' => 'PBtmpl0000000000000072', + '10' => 'PBtmpl0000000000000070' + }, + 'Macro/SubscriptionItem' => { + '1' => 'PBtmpl0000000000000046' + }, + 'WSClient' => { + '1' => 'PBtmpl0000000000000069', + '2' => 'PBtmpl0000000000000100' + }, + 'Operation/MessageLog/Message' => { + '1' => 'PBtmpl0000000000000049' + }, + 'Auth/SMB/Account' => { + '1' => 'PBtmpl0000000000000007' + }, + 'Survey' => { + '1' => 'PBtmpl0000000000000061' + }, + 'EventsCalendar' => { + '1' => 'PBtmpl0000000000000022', + '3' => 'PBtmpl0000000000000105', + '2' => 'PBtmpl0000000000000086' + }, + 'Macro/AdminToggle' => { + '1' => 'PBtmpl0000000000000036' + }, + 'Auth/LDAP/Create' => { + '1' => 'PBtmpl0000000000000005' + }, + 'Auth/WebGUI/Create' => { + '1' => 'PBtmpl0000000000000011' + }, + 'page' => { + '6' => 'PBtmpl0000000000000131', + '3' => 'PBtmpl0000000000000109', + '7' => 'PBtmpl0000000000000135', + '2' => 'PBtmpl0000000000000094', + '15' => 'PBtmpl0000000000000078', + '1' => 'PBtmpl0000000000000054', + '4' => 'PBtmpl0000000000000118', + '5' => 'PBtmpl0000000000000125' + }, + 'Macro/H_homeLink' => { + '1' => 'PBtmpl0000000000000042' + }, + 'USS' => { + '6' => 'PBtmpl0000000000000133', + '21' => 'PBtmpl0000000000000102', + '3' => 'PBtmpl0000000000000112', + '2' => 'PBtmpl0000000000000097', + '17' => 'PBtmpl0000000000000081', + '20' => 'PBtmpl0000000000000101', + '15' => 'PBtmpl0000000000000079', + '14' => 'PBtmpl0000000000000077', + '4' => 'PBtmpl0000000000000121', + '1' => 'PBtmpl0000000000000066', + '18' => 'PBtmpl0000000000000082', + '1000' => 'PBtmpl0000000000000074', + '16' => 'PBtmpl0000000000000080', + '19' => 'PBtmpl0000000000000083', + '5' => 'PBtmpl0000000000000128' + }, + 'AdminConsole' => { + '1' => 'PBtmpl0000000000000001' + }, + 'SQLReport' => { + '1' => 'PBtmpl0000000000000059' + }, + 'Macro/AdminBar' => { + '1' => 'PBtmpl0000000000000035', + '2' => 'PBtmpl0000000000000090' + }, + 'Survey/Gradebook' => { + '1' => 'PBtmpl0000000000000062' + }, + 'DataForm/List' => { + '1' => 'PBtmpl0000000000000021' + }, + 'Macro/GroupDelete' => { + '1' => 'PBtmpl0000000000000041' + }, + 'Product' => { + '4' => 'PBtmpl0000000000000119', + '1' => 'PBtmpl0000000000000056', + '3' => 'PBtmpl0000000000000110', + '2' => 'PBtmpl0000000000000095' + }, + 'Commerce/TransactionError' => { + '1' => 'PBtmpl0000000000000018' + }, + 'IndexedSearch' => { + '1' => 'PBtmpl0000000000000034', + '3' => 'PBtmpl0000000000000106', + '2' => 'PBtmpl0000000000000089' + }, + 'Auth/WebGUI/Expired' => { + '1' => 'PBtmpl0000000000000012' + }, + 'Commerce/SelectPaymentGateway' => { + '1' => 'PBtmpl0000000000000017' + }, + 'Macro/File' => { + '1' => 'PBtmpl0000000000000039', + '3' => 'PBtmpl0000000000000107', + '2' => 'PBtmpl0000000000000091' + }, + 'Survey/Overview' => { + '1' => 'PBtmpl0000000000000063' + }, + 'Macro/a_account' => { + '1' => 'PBtmpl0000000000000037' + }, + 'Macro/LoginToggle' => { + '1' => 'PBtmpl0000000000000043' + }, + 'Auth/LDAP/Account' => { + '1' => 'PBtmpl0000000000000004' + }, + 'Survey/Response' => { + '1' => 'PBtmpl0000000000000064' + }, + 'Commerce/CheckoutCanceled' => { + '1' => 'PBtmpl0000000000000015' + }, + 'USS/Submission' => { + '1' => 'PBtmpl0000000000000067', + '3' => 'PBtmpl0000000000000113', + '2' => 'PBtmpl0000000000000098' + }, + 'Auth/WebGUI/Recovery' => { + '1' => 'PBtmpl0000000000000014' + }, + 'Macro/r_printable' => { + '1' => 'PBtmpl0000000000000045' + }, + 'Operation/Profile/Edit' => { + '1' => 'PBtmpl0000000000000051' + }, + 'SyndicatedContent' => { + '1' => 'PBtmpl0000000000000065', + '1000' => 'PBtmpl0000000000000073' + }, + 'USS/SubmissionForm' => { + '4' => 'PBtmpl0000000000000122', + '1' => 'PBtmpl0000000000000068', + '3' => 'PBtmpl0000000000000114', + '2' => 'PBtmpl0000000000000099' + }, + 'EventsCalendar/Event' => { + '1' => 'PBtmpl0000000000000023' + }, + 'Macro/GroupAdd' => { + '1' => 'PBtmpl0000000000000040' + }, + 'Forum/Notification' => { + '1' => 'PBtmpl0000000000000027' + }, + 'Auth/LDAP/Login' => { + '1' => 'PBtmpl0000000000000006' + }, + 'DataForm' => { + '4' => 'PBtmpl0000000000000116', + '1' => 'PBtmpl0000000000000020', + '3' => 'PBtmpl0000000000000104', + '2' => 'PBtmpl0000000000000085' + }, + 'Auth/WebGUI/Login' => { + '1' => 'PBtmpl0000000000000013' + }, + 'richEditor' => { + 'tinymce' => 'PBtmpl0000000000000138', + '5' => 'PBtmpl0000000000000126' + }, + 'Forum/Thread' => { + '1' => 'PBtmpl0000000000000032' + }, + 'Forum/Post' => { + '1' => 'PBtmpl0000000000000028' + }, + 'Macro/EditableToggle' => { + '1' => 'PBtmpl0000000000000038' + }, + 'richEditor/pagetree' => { + '1' => 'PBtmpl0000000000000058' + } + }, + 'nav' => { + '1002' => 'PBnav00000000000000005', + '11' => 'PBnav00000000000000006', + '7' => 'PBnav00000000000000019', + '2' => 'PBnav00000000000000014', + '17' => 'PBnav00000000000000012', + '1' => 'PBnav00000000000000001', + '18' => 'PBnav00000000000000013', + '16' => 'PBnav00000000000000011', + '13' => 'PBnav00000000000000008', + 'iBkcoHUb-z4vzYPyX0oS5A' => 'PBnav00000000000000023', + '6' => 'PBnav00000000000000018', + 'b3XBaWXeMXS39HPDfV2y5Q' => 'PBnav00000000000000022', + '3' => 'PBnav00000000000000015', + '9' => 'PBnav00000000000000021', + '12' => 'PBnav00000000000000007', + '14' => 'PBnav00000000000000009', + '15' => 'PBnav00000000000000010', + '8' => 'PBnav00000000000000020', + '1001' => 'PBnav00000000000000004', + '4' => 'PBnav00000000000000016', + '1000' => 'PBnav00000000000000003', + '10' => 'PBnav00000000000000002', + '5' => 'PBnav00000000000000017' + } + }; + my $newId; + if ($type eq "nav") { + $newId = $migration->{nav}{$oldId}; + } elsif ($type eq "tmpl") { + $newId = $migration->{tmpl}{$namespace}{$oldId}; + } + $newId = WebGUI::Id::generate() unless ($newId); + return $newId; +} diff --git a/docs/upgrades/upgrade_6.2.9-6.3.0.sql b/docs/upgrades/upgrade_6.2.9-6.3.0.sql index 6f952a0bd..56d522322 100644 --- a/docs/upgrades/upgrade_6.2.9-6.3.0.sql +++ b/docs/upgrades/upgrade_6.2.9-6.3.0.sql @@ -69,7 +69,7 @@ create table asset ( index (parentId) ); -insert into asset (assetId, parentId, lineage, state, className, title, menuTitle, url, isSystem, ownerUserId, groupIdView, groupIdEdit) values ('theroot', 'infinity', '000001','published','WebGUI::Asset','Root','Root','root',1,'3','3','3'); +insert into asset (assetId, parentId, lineage, state, className, title, menuTitle, url, isSystem, ownerUserId, groupIdView, groupIdEdit) values ('PBasset000000000000001', 'infinity', '000001','published','WebGUI::Asset','Root','Root','root',1,'3','3','3'); create table assetHistory ( assetId varchar(22) not null, diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index c7ccb5d01..54351b6e5 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -279,38 +279,39 @@ sub getEditForm { -value=>$self->get("url"), -uiLevel=>3 ); - $tabform->getTab("properties")->yesNo( - -name=>"isHidden", - -value=>$self->get("isHidden"), - -label=>WebGUI::International::get(886), - -uiLevel=>6 - ); - $tabform->getTab("properties")->yesNo( - -name=>"newWindow", - -value=>$self->get("newWindow"), - -label=>WebGUI::International::get(940), - -uiLevel=>6 - ); - $tabform->getTab("properties")->yesNo( - -name=>"encryptPage", - -value=>$self->get("encryptPage"), - -label=>WebGUI::International::get('encrypt page'), - -uiLevel=>6 - ); $tabform->getTab("properties")->textarea( -name=>"synopsis", -label=>WebGUI::International::get(412), -value=>$self->get("synopsis"), -uiLevel=>3 ); - $tabform->addTab("privileges",WebGUI::International::get(107),6); - $tabform->getTab("privileges")->dateTime( + $tabform->addTab("display",WebGUI::International::get(105),5); + $tabform->getTab("display")->yesNo( + -name=>"isHidden", + -value=>$self->get("isHidden"), + -label=>WebGUI::International::get(886), + -uiLevel=>6 + ); + $tabform->getTab("display")->yesNo( + -name=>"newWindow", + -value=>$self->get("newWindow"), + -label=>WebGUI::International::get(940), + -uiLevel=>6 + ); + $tabform->addTab("security",WebGUI::International::get(107),6); + $tabform->getTab("security")->yesNo( + -name=>"encryptPage", + -value=>$self->get("encryptPage"), + -label=>WebGUI::International::get('encrypt page'), + -uiLevel=>6 + ); + $tabform->getTab("security")->dateTime( -name=>"startDate", -label=>WebGUI::International::get(497), -value=>$self->get("startDate"), -uiLevel=>6 ); - $tabform->getTab("privileges")->dateTime( + $tabform->getTab("security")->dateTime( -name=>"endDate", -label=>WebGUI::International::get(498), -value=>$self->get("endDate"), @@ -331,7 +332,7 @@ sub getEditForm { $clause = "userId=".quote($self->get("ownerUserId")); } my $users = WebGUI::SQL->buildHashRef("select userId,username from users where $clause order by username"); - $tabform->getTab("privileges")->selectList( + $tabform->getTab("security")->selectList( -name=>"ownerUserId", -options=>$users, -label=>WebGUI::International::get(108), @@ -339,13 +340,13 @@ sub getEditForm { -subtext=>$subtext, -uiLevel=>6 ); - $tabform->getTab("privileges")->group( + $tabform->getTab("security")->group( -name=>"groupIdView", -label=>WebGUI::International::get(872), -value=>[$self->get("groupIdView")], -uiLevel=>6 ); - $tabform->getTab("privileges")->group( + $tabform->getTab("security")->group( -name=>"groupIdEdit", -label=>WebGUI::International::get(871), -value=>[$self->get("groupIdEdit")], @@ -356,6 +357,12 @@ sub getEditForm { } +sub getFirstDescendant { + my $self = shift; + $self->{_firstDescendant} = WebGUI::Asset->newByLineage($self->get("lineage").$self->formatRank(1)) unless (exists $self->{_firstDescendant}); + return $self->{_firstDescendant}; +} + sub getIcon { my $self = shift; my $small = shift; @@ -452,7 +459,7 @@ sub getLineageLength { } sub getName { - return WebGUI::International::get('asset','Asset'); + return WebGUI::International::get("asset","Asset"); } sub getNextChildRank { @@ -560,16 +567,6 @@ sub new { return undef; } -sub newByPropertyHashRef { - my $class = shift; - my $properties = shift; - my $className = $properties->{className}; - my $cmd = "use ".$className; - eval ($cmd); - WebGUI::ErrorHandler::fatalError("Couldn't compile asset package: ".$className.". Root cause: ".$@) if ($@); - bless {_properties => $properties}, $className; -} - sub newByDynamicClass { my $class = shift; my $assetId = shift; @@ -592,6 +589,23 @@ sub newByDynamicClass { } +sub newByLineage { + my $class = shift; + my $lineage = shift; + my $asset = WebGUI::SQL->quickHashRef("select assetId, className from asset where lineage=".quote($lineage)); + return WebGUI::Asset->newByDynamicClass($asset->{assetId}, $asset->{className}); +} + +sub newByPropertyHashRef { + my $class = shift; + my $properties = shift; + my $className = $properties->{className}; + my $cmd = "use ".$className; + eval ($cmd); + WebGUI::ErrorHandler::fatalError("Couldn't compile asset package: ".$className.". Root cause: ".$@) if ($@); + bless {_properties => $properties}, $className; +} + sub newByUrl { my $class = shift; my $url = shift || $session{env}{PATH_INFO}; @@ -786,7 +800,7 @@ sub www_add { my %properties = ( groupIdView => $self->get("groupIdView"), groupIdEdit => $self->get("groupIdEdit"), - ownerId => $self->get("ownerId"), + ownerUserId => $self->get("ownerUserId"), encryptPage => $self->get("encryptPage"), isHidden => $self->get("isHidden"), startDate => $self->get("startDate"), @@ -909,7 +923,7 @@ sub www_manageAssets {
-
Retrieving Assets...
+
Retrieving Assets...
hello
'; $output .= ""); + my $previewButton = qq{ + }; + my $saveButton = ' '; + $tabform->{_submit} = $previewButton." ".$saveButton; + return $tabform; +} + +sub getName { + return WebGUI::International::get("navigation","Navigation"); +} + + +sub view { + my $self = shift; + # we've got to determine what our start point is based upon user conditions + my $start; + if (!exists $session{asset}) { + $start = $self; + } elsif ($self->get("startType") eq "specificUrl") { + $start = WebGUI::Asset->getByUrl($self->get("startPoint")); + } elsif ($self->get("startType") eq "relativeToRoot") { + unless (($self->get("startPoint")+1) >= $self->getLineageLength) { + $start = WebGUI::Asset->newByLineage(substr($session{asset}->get("lineage"),0, ($self->get("startPoint") + 1) * 6)); + } + } elsif ($self->get("startType") eq "relativeToCurrentUrl") { + if ($self->get("startPoint") < 0) { + $start = WebGUI::Asset->newByLineage(substr($session{asset}->get("lineage"),0, + ($session{asset}->getLineageLength - $self->get("startPoint") + 1) * 6 + )); + } elsif ($self->get("startPoint") > 0) { + my $lineage = $session{asset}->getLineage; + for (1..$self->get("startPoint")) { + $lineage .= $self->formatRank(1); + } + $start = WebGUI::Asset->newByLineage($lineage); + } + } + $start = $session{asset} unless (defined $start); # if none of the above results in a start point, then the current page must be it + my @assets = $start->getLineage(); + + +my $config; +my $base; + + my (@relatives, %rules); + foreach my $relative ("ancestors","self","siblings","descendants") { + push(@relatives,$relative) if ($config->{relative}); + } + $rules{returnQuickReadObjects} = 1; + $base->getLineage(\@relatives,\%rules); + + my @interestingPageProperties = ('pageId', 'parentId', 'title', 'ownerId', 'urlizedTitle', + 'synopsis', 'newWindow', 'menuTitle', 'encryptLogin'); + my $var = {'page_loop' => []}; + my $p = $self->_getStartPageObject(); + my $method = $self->_methods()->{$self->{_method}}{method}; + + my $cache = WebGUI::Cache->new($self->{_identifier}.'-'.$session{page}{pageId}, "Navigation-".$session{config}{configFile}); + my $cacheContent = $cache->get unless $session{var}{adminOn}; + my (@page_loop, $lastPage, %unfolded); + tie %unfolded, "Tie::IxHash"; + + # Store current page properties in template var + my $currentPage = WebGUI::Page->getPage(); + my $currentRoot = $currentPage->getWebGUIRoot(); + foreach my $property (@interestingPageProperties) { + $var->{'basepage.'.$property} = $currentPage->get($property); + } + unless (defined $cacheContent && + ! $session{url}{siteURL}) { # Never use cache if an alternate site url is specified. + # The loop was not cached + my @pages = eval $method; + if ($@) { + WebGUI::ErrorHandler::warn("Error in WebGUI::Navigation::build while trying to execute $method".$@); + } + if (@pages) { + my $startPageDepth = $p->get("depth")+1; + my $maxDepth = $startPageDepth + $self->{_depth}; + my $minDepth = $startPageDepth - $self->{_depth}; + + foreach my $page (@pages) { + my $pageData = {}; + $pageData->{"page.absDepth"} = $page->{'depth'} + 1; + $pageData->{"page.isSystem"} = $page->{isSystem}; + + # Check if in depth range + next if ($pageData->{"page.absDepth"} > $maxDepth || $pageData->{"page.absDepth"} < $minDepth); + + # Check stopAtLevel + next if ($pageData->{"page.absDepth"} < $self->{_stopAtLevel}); + + # Check showSystemPages + next if (! $self->{_showSystemPages} && $pageData->{"page.isSystem"}); + + # Deal with hidden pages, don't ever hide pages if admin mode is on + next if(($page->{'hideFromNavigation'} && ! $self->{_showHiddenPages}) && (! $session{var}{adminOn})); + + # Initial page info + $pageData->{"page.url"} = WebGUI::URL::gateway($page->{'urlizedTitle'}); + if ($page->{'encryptPage'}) { + $pageData->{"page.url"} =~ s/http:/https:/; + } + $pageData->{"page.relDepth"} = $pageData->{"page.absDepth"} - $startPageDepth; + $pageData->{"page.isBasepage"} = ($page->{'pageId'} eq $session{page}{pageId}); + $pageData->{"page.isHidden"} = $page->{'hideFromNavigation'}; + + # indent + my $indent = 0; + if ($self->{_method} eq 'pedigree' # reverse traversing + || $self->{_method} eq 'ancestors' # needs another way to calculate + || $self->{_method} eq 'self_and_ancestors') { # the indent + if ($self->{_stopAtLevel} <= $startPageDepth && $self->{_stopAtLevel} > 0) { + $indent = $pageData->{"page.absDepth"} - ($self->{_stopAtLevel} - 1) - 1; + } elsif ($self->{_stopAtLevel} > $startPageDepth && $self->{_stopAtLevel} > 0) { + $indent = 0; + } else { + $indent = $pageData->{"page.absDepth"} - 1; + } + } else { + $indent = $pageData->{"page.absDepth"} - $startPageDepth - 1; + } + $pageData->{"page.indent_loop"} = []; + push(@{$pageData->{"page.indent_loop"}},{'indent'=>$_}) for(1..$indent); + $pageData->{"page.indent"} = "   " x $indent; + + # Put page properties in $pageData hashref + foreach my $property (@interestingPageProperties) { + $pageData->{"page.".$property} = $page->{$property}; + } + $pageData->{"page.isRoot"} = (! $page->{'parentId'}); + $pageData->{"page.isTop"} = ($pageData->{"page.absDepth"} == 2); + $pageData->{"page.hasDaughter"} = ($page->{'nestedSetRight'} - $page->{'nestedSetLeft'} > 1); + $pageData->{"page.isDaughter"} = ($page->{'parentId'} eq $currentPage->get('pageId')); + $pageData->{"page.isMother"} = ($page->{'pageId'} eq $currentPage->get('parentId')); + + $pageData->{"page.isAncestor"} + = (($page->{'nestedSetLeft'} < $currentPage->get('nestedSetLeft')) + && ($page->{'nestedSetRight'} > $currentPage->get('nestedSetRight'))); + $pageData->{"page.isDescendent"} + = (($page->{'nestedSetLeft'} > $currentPage->get('nestedSetLeft')) + && ($page->{'nestedSetRight'} < $currentPage->get('nestedSetRight'))); + + $pageData->{"page.inRoot"} + = (($page->{'nestedSetLeft'} > $currentRoot->get('nestedSetLeft')) + && ($page->{'nestedSetRight'} < $currentRoot->get('nestedSetRight'))); + + # Some information about my mother + my $mother = WebGUI::Page->getPage($page->{parentId}); + if ($page->{parentId} ne "0") { + foreach (qw(title urlizedTitle parentId pageId)) { + $pageData->{"page.mother.$_"} = $mother->get($_); + } + $pageData->{"page.isSister"} + = (($mother->get("pageId") eq $currentPage->get("parentId")) + && !$pageData->{"page.isBasepage"}); + } + + $pageData->{"page.inBranch"} + = ($pageData->{"page.isAncestor"} + || $pageData->{"page.isDescendent"} + || $pageData->{"page.isSister"} + || $pageData->{"page.isBasepage"}); + + $pageData->{"page.isLeftMost"} = (($page->{'nestedSetLeft'} - 1) == $mother->get('nestedSetLeft')); + $pageData->{"page.isRightMost"} = (($page->{'nestedSetRight'} + 1) == $mother->get('nestedSetRight')); + my $depthDiff = ($lastPage) ? ($lastPage->{'page.absDepth'} - $pageData->{'page.absDepth'}) : 0; + if ($depthDiff > 0) { + $pageData->{"page.depthDiff"} = $depthDiff if ($depthDiff > 0); + $pageData->{"page.depthDiffIs".$depthDiff} = 1; + push(@{$pageData->{"page.depthDiff_loop"}},{}) for(1..$depthDiff); + } + + # Some information about my depth + $pageData->{"page.depthIs".$pageData->{"page.absDepth"}} = 1; + $pageData->{"page.relativeDepthIs".$pageData->{"page.relDepth"}} = 1; + + # We need a copy of the last page for the depthDiffLoop + $lastPage = $pageData; + + # Store $pageData in page_loop. Mind the order. + if ($self->{_reverse}) { + unshift(@page_loop, $pageData); + } else { + push(@page_loop, $pageData); + } + } + } + + # We had a cache miss, so let's put the data in cache + $cache->set(\@page_loop, 3600*24) unless $session{var}{adminOn}; + } else { + # We had a cache hit + @page_loop = @{$cacheContent}; + } + + # Do the user-dependent checks (which cannot be cached globally) + foreach my $pageData (@page_loop) { + $pageData->{"page.isViewable"} = WebGUI::Page::canView($pageData->{'page.pageId'}); + # Check privileges + if ($pageData->{"page.isViewable"} || $self->{_showUnprivilegedPages}) { + push (@{$var->{page_loop}}, $pageData); + push (@{$unfolded{$pageData->{"page.parentId"}}}, $pageData); + } + } + + foreach (values %unfolded) { + push(@{$var->{unfolded_page_loop}}, @{$_}); + } + + # Configure button + $var->{'config.button'} = $self->_getEditButton(); + + # Some properties of the page the user's viewing. + $var->{'basepage.hasDaughter'} = $currentPage->hasDaughter(); + $var->{"basepage.isHome"} = ($currentPage->get('pageId') eq '1'); + + if ($self->{_template}) { + return WebGUI::Template::processRaw($self->{_template}, $var); + } else { + return WebGUI::Template::process($self->{_templateId}, "Navigation", $var); + } +} + + +sub www_edit { + my $self = shift; + return WebGUI::Privilege::insufficient() unless $self->canEdit; + $self->getAdminConsole->setHelp("navigation add/edit"); + return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get("22","Navigation")); +} + + +#------------------------------------------------------------------- +sub www_preview { + my $self = shift; + $session{var}{adminOn} = 0; + return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(3)); + my $nav = WebGUI::Navigation->new( depth=>$session{form}{depth}, + method=>$session{form}{method}, + startAt=>$session{form}{startAt}, + stopAtLevel=>$session{form}{stopAtLevel}, + templateId=>$session{form}{templateId}, + showSystemPages=>$session{form}{showSystemPages}, + showHiddenPages=>$session{form}{showHiddenPages}, + showUnprivilegedPages=>$session{form}{showUnprivilegedPages}, + 'reverse'=>$session{form}{'reverse'}, + ); + my $output = qq( + + +
+ Configuration + Output
+ + Identifier: $session{form}{identifier}
+ startAt: $session{form}{startAt}
+ method: $session{form}{method}
+ stopAtLevel: $session{form}{stopAtLevel}
+ depth: $session{form}{depth}
+ templateId: $session{form}{templateId}
+ reverse: $session{form}{'reverse'}
+ showSystemPages: $session{form}{showSystemPages}
+ showHiddenPages: $session{form}{showHiddenPages}
+ showUnprivilegedPages: $session{form}{showUnprivilegedPages}
+
+
+ ) . $nav->build . qq(
); + + # Because of the way the system is set up, the preview is cached. So let's remove it again... + WebGUI::Cache->new($nav->{_identifier}."$session{page}{pageId}", "Navigation-".$session{config}{configFile})->delete; + + return _submenu($output,"preview"); +} + +1; diff --git a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm index 3c8d1e7d7..a0f923705 100644 --- a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm +++ b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm @@ -82,7 +82,7 @@ sub getEditForm { -label=>WebGUI::International::get(1,"SyndicatedContent"), -value=>$self->getValue("rssUrl") ); - $tabform->getTab("layout")->integer( + $tabform->getTab("display")->integer( -name=>"maxHeadlines", -label=>WebGUI::International::get(3,"SyndicatedContent"), -value=>$self->getValue("maxHeadlines") diff --git a/lib/WebGUI/Asset/Wobject/USS.pm b/lib/WebGUI/Asset/Wobject/USS.pm index 624c930a5..89d5e26da 100644 --- a/lib/WebGUI/Asset/Wobject/USS.pm +++ b/lib/WebGUI/Asset/Wobject/USS.pm @@ -161,36 +161,36 @@ sub duplicate { sub getEditForm { my $self = shift; my $tabform = $self->getEditForm; - $tabform->getTab("layout")->template( + $tabform->getTab("display")->template( -name=>"submissionTemplateId", -value=>$self->getValue("submissionTemplateId"), -namespace=>$self->get("namespace")."/Submission", -label=>WebGUI::International::get(73,$self->get("namespace")), -afterEdit=>'func=edit&wid='.$self->get("wobjectId") ); - $tabform->getTab("layout")->template( + $tabform->getTab("display")->template( -name=>"submissionFormTemplateId", -value=>$self->getValue("submissionFormTemplateId"), -namespace=>$self->get("namespace")."/SubmissionForm", -label=>WebGUI::International::get(87,$self->get("namespace")), -afterEdit=>'func=edit&wid='.$self->get("wobjectId") ); - $tabform->getTab("privileges")->group( + $tabform->getTab("security")->group( -name=>"groupToApprove", -label=>WebGUI::International::get(1,$self->get("namespace")), -value=>[$self->getValue("groupToApprove")] ); - $tabform->getTab("privileges")->group( + $tabform->getTab("security")->group( -name=>"groupToContribute", -label=>WebGUI::International::get(2,$self->get("namespace")), -value=>[$self->getValue("groupToContribute")] ); - $tabform->getTab("layout")->integer( + $tabform->getTab("display")->integer( -name=>"submissionsPerPage", -label=>WebGUI::International::get(6,$self->get("namespace")), -value=>$self->getValue("submissionsPerPage") ); - $tabform->getTab("privileges")->selectList( + $tabform->getTab("security")->selectList( -name=>"defaultStatus", -options=>{ Approved=>status('Approved'), @@ -209,10 +209,10 @@ sub getEditForm { } else { $tabform->getTab("properties")->hidden("karmaPerSubmission",$self->getValue("karmaPerSubmission")); } - $tabform->getTab("layout")->filterContent( + $tabform->getTab("display")->filterContent( -value=>$self->getValue("filterContent") ); - $tabform->getTab("layout")->selectList( + $tabform->getTab("display")->selectList( -name=>"sortBy", -value=>[$self->getValue("sortBy")], -options=>{ @@ -223,7 +223,7 @@ sub getEditForm { }, -label=>WebGUI::International::get(79,$self->get("namespace")) ); - $tabform->getTab("layout")->selectList( + $tabform->getTab("display")->selectList( -name=>"sortOrder", -value=>[$self->getValue("sortOrder")], -options=>{ diff --git a/lib/WebGUI/SQL.pm b/lib/WebGUI/SQL.pm index 8684fdaed..0c389b3f6 100644 --- a/lib/WebGUI/SQL.pm +++ b/lib/WebGUI/SQL.pm @@ -707,7 +707,7 @@ sub rows { #------------------------------------------------------------------- -=head2 setRow ( table, key, data [, dbh ] ) +=head2 setRow ( table, key, data [, dbh, id ] ) Inserts/updates a row of data into the database. Returns the value of the key. @@ -717,22 +717,26 @@ The name of the table to use. =head3 key -The name of the primary key of the table. +The name of the primary key of the table. =head3 data -A hash reference containing column names and values to be set. +A hash reference containing column names and values to be set. If the field matching the key parameter is set to "new" then a new row will be created. =head3 dbh A database handler to use. Defaults to the WebGUI database handler. +=head3 id + +Use this ID to create a new row. Same as setting the key value to "new" except that we'll use this passed in id instead. + =cut sub setRow { - my ($self, $table, $keyColumn, $data, $dbh) = @_; - if ($data->{$keyColumn} eq "new") { - $data->{$keyColumn} = WebGUI::Id::generate(); + my ($self, $table, $keyColumn, $data, $dbh, $id) = @_; + if ($data->{$keyColumn} eq "new" || $id) { + $data->{$keyColumn} = $id || WebGUI::Id::generate(); WebGUI::SQL->write("insert into $table ($keyColumn) values (".quote($data->{$keyColumn}).")", $dbh); } my (@pairs); diff --git a/lib/WebGUI/i18n/English/Navigation.pm b/lib/WebGUI/i18n/English/Navigation.pm index 251f99eac..87b4ee209 100644 --- a/lib/WebGUI/i18n/English/Navigation.pm +++ b/lib/WebGUI/i18n/English/Navigation.pm @@ -1,187 +1,36 @@ package WebGUI::i18n::English::Navigation; our $I18N = { - 'add new' => { - message => q|Add new navigation.|, - lastUpdated => 1101774172, - context => q|A submenu item in admin console that allows the user to add a new navigation config.| - }, - - '33' => { - message => q|Error: This identifier is already in use. Please use an unique value.|, - lastUpdated => 1077081255 - }, - '32' => { message => q|Show unprivileged pages|, lastUpdated => 1077080845 }, - '21' => { - message => q|List all Navigation.|, - lastUpdated => 1077080151 - }, - - '7' => { - message => q|my daughter's level (./page)|, - lastUpdated => 1077078687 - }, - - '26' => { - message => q|Stop traversing when reaching level|, - lastUpdated => 1077080617 - }, - - '2' => { - message => q|root level (/home)|, - lastUpdated => 1077078325 - }, - - '17' => { - message => q|pedigree|, - lastUpdated => 1077079481 - }, - - '1' => { - message => q|nameless root|, - lastUpdated => 1077078206 - }, - - '18' => { - message => q|Edit this Navigation.|, - lastUpdated => 1077079911 - }, - '30' => { message => q|Show system pages|, lastUpdated => 1077080766 }, - '16' => { - message => q|self and ancestors|, - lastUpdated => 1077079343 - }, - - '27' => { - message => q|Max depth|, - lastUpdated => 1077080669 - }, - '25' => { message => q|Base page|, lastUpdated => 1077080583 }, - '28' => { - message => q|Return a loop with|, - lastUpdated => 1077080706 - }, - - '14' => { - message => q|generation|, - lastUpdated => 1077079203 - }, - - '20' => { - message => q|Delete this Navigation.|, - lastUpdated => 1077080098 - }, - - '24' => { - message => q|Identifier|, - lastUpdated => 1077080504 - }, - - '10' => { - message => q|self and sisters|, - lastUpdated => 1077078879 - }, - '31' => { message => q|Show hidden pages|, lastUpdated => 1077080799 }, - '35' => { - message => q|Please specify an identifier. ie: ^Navigation(myMenu);|, - lastUpdated => 1077081415 - }, - - '11' => { - message => q|descendants|, - lastUpdated => 1077078969 - }, - '22' => { message=> q|Edit Navigation|, lastUpdated => 1077078969 }, - '13' => { - message => q|childless descendants|, - lastUpdated => 1077079109 - }, - - '23' => { - message => q|Navigation properties|, - lastUpdated => 1077080317 - }, - - '29' => { - message => q|Reverse output|, - lastUpdated => 1100587628 - }, - - '6' => { - message => q|my level (.)|, - lastUpdated => 1077078579 - }, - - '3' => { - message => q|top level (/home/page)|, - lastUpdated => 1077078394 - }, - - '9' => { - message => q|sisters|, - lastUpdated => 1077078821 - }, - - '12' => { - message => q|self and descendants|, - lastUpdated => 1077079020 - }, - - '15' => { - message => q|ancestors|, - lastUpdated => 1077079273 - }, - - '8' => { - message => q|daughters|, - lastUpdated => 1077078773 - }, - - '4' => { - message => q|my grandmother's level (../../page)|, - lastUpdated => 1077078456 - }, - 'preview' => { message => q|Preview Navigation|, lastUpdated => 1077078456 }, - '19' => { - message => q|Copy this Navigation.|, - lastUpdated => 1077080062 - }, - - '5' => { - message => q|my mother's level (../page)|, - lastUpdated => 1077078526 - }, - 'navigation' => { message => q|Navigation|, lastUpdated => 1077078526, diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm index 974f08405..06f2ab7d6 100644 --- a/lib/WebGUI/i18n/English/WebGUI.pm +++ b/lib/WebGUI/i18n/English/WebGUI.pm @@ -1347,7 +1347,7 @@ How should this user be notified when they get a new WebGUI message? }, '107' => { - message => q|Privileges|, + message => q|Security|, lastUpdated => 1031514049 }, @@ -2061,8 +2061,8 @@ The title of the page is what your users will use to navigate through the site. A shorter or altered title to appear in navigation. If left blank this will default to Title.

-Page URL
-You may either specify a URL for the page, or if you leave this blank, a URL based on the Title will be generated. +URL
+You may either specify a URL for the asset, or if you leave this blank, a URL based on the Title will be generated.

Redirect URL
@@ -2082,7 +2082,7 @@ Select yes to hide this page from the navigation menus and site maps. Select yes to open this page in a new window. This is often used in conjunction with the Redirect URL parameter.

-Encrypt page?
+Encrypt content?
Select yes to serve this page over SSL.

@@ -2123,9 +2123,6 @@ If you don't wish to specify meta tags yourself, WebGUI can generate meta tags b By default, when you create a page, it inherits a few traits from its parent. One of those traits is style. Choose from the list of styles if you would like to change the appearance of this page. See Add Style for more details.

-If you select "Yes" below the style pull-down menu, all of the pages below this page will take on the style you've chosen for this page. -

- Printable Style
This sets the printable style for this page to be something other than the WebGUI Default Printable Style.

@@ -3935,8 +3932,9 @@ Large sites using external group data will be making many calls to the external }, '104' => { - message => q|Page URL|, - lastUpdated => 1031514049 + message => q|URL|, + lastUpdated => 1031514049, + context => q|asset property| }, '412' => { @@ -5395,11 +5393,6 @@ Start typing! Or better yet, copy the snippet from some other electronic documen lastUpdated => 1060433369 }, - '106' => { - message => q|Select "Yes" to change all the pages under this page to this style.|, - lastUpdated => 1031514049 - }, - '707' => { message => q|Show debugging?|, lastUpdated => 1031514049 @@ -6353,7 +6346,7 @@ What group should be alerted when a new user registers? }, '105' => { - message => q|Layout|, + message => q|Display|, lastUpdated => 1046638916 }, @@ -6614,9 +6607,9 @@ config file.

context => q|option for Rich Editor in profile| }, 'encrypt page' => { - message => q|Encrypt page?|, + message => q|Encrypt content?|, lastUpdated =>1092748557, - context => q|page property| + context => q|asset property| }, 'Forum, Post Preview Template Title' => { message => q|Forum Post Preview Template|, diff --git a/www/extras/assetManager/Asset.js b/www/extras/assetManager/Asset.js index 68ee42633..b13a82bde 100644 --- a/www/extras/assetManager/Asset.js +++ b/www/extras/assetManager/Asset.js @@ -1,6 +1,7 @@ //--------Constructor-------------------- +//Creates a new asset object. function Asset() { //properties this.url = ""; @@ -65,19 +66,5 @@ function Asset_view() { location.href = "http://" + manager.tools.getHostName(location.href) + this.url; } -//function Asset_displayProperties() { -// html = ""; -// html+="" -// html+="" -// html+="" -// html+="" -// html+="" -// html+="
Title:" + this.title + "
Rank:" + this.rank + "
Asset ID:" + this.assetId + "
Asset Type:" + this.type + "
Size:" + this.size + "
Last Updated:" + this.lastUpdate + "
"; -// manager.display.displayPropertiesWindow(html); -//} - - - - diff --git a/www/extras/assetManager/AssetManager.js b/www/extras/assetManager/AssetManager.js index 39a576af8..35334dbd5 100644 --- a/www/extras/assetManager/AssetManager.js +++ b/www/extras/assetManager/AssetManager.js @@ -1,12 +1,15 @@ //--------Constructor-------------------- +//Manages an array of assets. + function AssetManager(assetArrayData,headerArrayData,labels,crumbtrail) { + + //create all the objects used by the manager this.tools = new Tools(); this.contextMenu = new ContextMenu(); this.display = new Display(); this.eventManager = new EventManager(); - this.keys = new Array(); this.keys[0] = "rank"; this.keys[1] = "title"; @@ -34,31 +37,30 @@ function AssetManager(assetArrayData,headerArrayData,labels,crumbtrail) { this.getSelectedAssetIds = AssetManager_getSelectedAssetIds; } +//returns a reference to the asset manager function AssetManager_getManager() { - //debug(manager.assetArrayData); return manager; } +//renders the full asset manager function AssetManager_renderAssets() { - - var gridStr = ''; var eventStr=''; var id = ""; for (i=0;i' + this.columnHeadings[i] + ''; eventStr += 'document.getElementById("' + id + '").onclick=AssetManager_getManager().eventManager.gridHeaderClick;'; + eventStr += 'document.getElementById("' + id + '").onmouseover=AssetManager_getManager().eventManager.gridHeaderMouseOver;'; + eventStr += 'document.getElementById("' + id + '").onmouseout=AssetManager_getManager().eventManager.gridHeaderMouseOut;'; } gridStr+= ''; -//['Rank','Title','Type','Last Updated','Size']; for (i=0;i'; - /* rank, title, type, lastUpdate, size, url, assetId */ asset = new Asset(); asset.rank = this.assetArrayData[i][0]; @@ -72,9 +74,6 @@ function AssetManager_renderAssets() { this.assets[i]=asset; //add the row events -// eventStr += 'document.getElementById("' + id + '").onclick=Grid_rowClicked;'; -// eventStr += 'document.getElementById("' + id + '").onmouseover=Grid_rowMouseOver;'; -// eventStr += 'document.getElementById("' + id + '").onmouseout=Grid_rowMouseOut;'; eventStr += 'document.getElementById("' + id + '").ondblclick=AssetManager_getManager().eventManager.assetDoubleClick;'; eventStr += 'document.getElementById("' + id + '").onmousedown=AssetManager_getManager().eventManager.assetMouseDown;'; eventStr += 'document.getElementById("' + id + '").oncontextmenu=AssetManager_getManager().eventManager.assetRightClick;'; @@ -90,7 +89,6 @@ function AssetManager_renderAssets() { gridStr +=''; } gridStr+=this.assetArrayData[i][k] + ''; -// eventStr += 'document.getElementById("' + id + '").asset = AssetManager_getManager().assets[' + i + '];'; } } gridStr+=''; @@ -100,11 +98,11 @@ function AssetManager_renderAssets() { document.getElementById("workspace").innerHTML=gridStr; eval(eventStr); - this.buildCrumbTrail(); - - - } + this.buildCrumbTrail(); +} + +//builds the asset crumb trail function AssetManager_buildCrumbTrail() { var crumbtrail = document.getElementById("crumbtrail"); var contents = '
'; @@ -130,8 +128,6 @@ function AssetManager_buildCrumbTrail() { asset.title = this.crumbtrail[i][2]; asset.url = this.crumbtrail[i][1]; asset.assetId = this.crumbtrail[i][0]; - - asset.div = document.getElementById(this.crumbtrail[i][0]); asset.div.ondblclick=AssetManager_getManager().eventManager.assetDoubleClick; @@ -140,25 +136,21 @@ function AssetManager_buildCrumbTrail() { asset.isParent = true; document.getElementById(this.crumbtrail[i][0]).asset = asset; - this.assets[this.assets.length] = asset; - - } - + this.assets[this.assets.length] = asset; + } } -function AssetManager_getAsset(obj) { - +//returns an asset based on a div object +function AssetManager_getAsset(obj) { while (obj.tagName!=this.display.topLevelElement && !obj.asset) { obj=this.display.dom? obj.parentNode : obj.parentElement - } - + } return obj.asset; } +//displays the right click context menu function AssetManager_displayContextMenu(x,y,asset) { - - var arr = new Array(); - + var arr = new Array(); if (this.display.overObjects.length == 1) { arr[arr.length] = new ContextMenuItem(this.labels["go"],"javascript:manager.display.contextMenu.owner.go()"); arr[arr.length] = new ContextMenuItem("",""); @@ -212,6 +204,7 @@ function AssetManager_remove() { } } +//returns the asset IDS of all selected assets function AssetManager_getSelectedAssetIds() { var assetIds = ""; for (i=0;i'; - } - + } var rowArray = new Array(); diff --git a/www/extras/assetManager/Display.js b/www/extras/assetManager/Display.js index a4393b43c..8bb0f4726 100644 --- a/www/extras/assetManager/Display.js +++ b/www/extras/assetManager/Display.js @@ -1,30 +1,19 @@ //--------Constructor-------------------- +//creates a new Display object. The display object manages selected assets, the drag functionality, and highlighting. + function Display() { this.dom=document.getElementById&&!document.all; - this.baseX=0; - this.baseY=0; - this.width=0; - this.height=0; - this.rootNode=""; - this.packageNS = ""; this.focusObjects = new Array(); this.overObjects = new Array(); - this.overCrumbtrail = null; this.topLevelElement=this.dom? "HTML" : "BODY" this.scrollJump = 25; this.dragEnabled = false; - this.displayPropertiesWindow = Display_displayPropertiesWindow; - this.hidePropertiesWindow = Display_hidePropertiesWindow; this.dragStart = Display_dragStart; this.adjustScrollBars = Display_adjustScrollBars; this.dragStop = Display_dragStop; - this.activityLists = new Array(); this.spy = Display_spy; - this.currentTemp=null; - this.temp1 = 0; - this.temp2=0; this.move = Display_move; this.x = 0; this.y = 0; @@ -33,8 +22,6 @@ function Display() { this.contextMenu=new ContextMenu(); this.bringToFront = Display_bringToFront; this.lastZIndex = 1000; - this.dragableObjectClasses = new Array(); - this.registerDragableClass = Display_registerDragableClass; this.keyDown = Display_keyDown; this.keyUp = Display_keyUp; this.selectAsset = Display_selectAsset; @@ -44,115 +31,59 @@ function Display() { //---------Method Implementations ------------- -function Display_registerDragableClass(objectClassName,classNameDuringDrag) { - var obj = new Object(); - obj.clazzName = objectClassName; - obj.clazzNameDuringDrag = classNameDuringDrag; - this.dragableObjectClasses[this.dragableObjectClasses.length] = obj; -} - +//changes the z index of obj to be greater than all other elements function Display_bringToFront(obj) { this.lastZIndex++; obj.style.zIndex = this.lastZIndex; } -function Display_hidePropertiesWindow() { - manager.tools.hideObject(document.getElementById("propertiesWindow")); -} - -function Display_displayPropertiesWindow(html) { - temp = "
" + manager.labels['properties'] + "X
" + html + "
"; - - propWindow = document.getElementById("propertiesWindow"); - propWindow.innerHTML=temp; - propWindow.style.top=50 + document.body.scrollTop; - propWindow.style.left=50 + document.body.scrollLeft; - manager.tools.showObject(propWindow); - this.bringToFront(propWindow); -} - - +//called to enable dragging on an element function Display_dragStart(firedobj,xCoordinate,yCoordinate) { + if (!firedobj) return; - if (this.shiftKeyDown) return; - - - - while (firedobj.tagName!=this.topLevelElement && !firedobj.asset && firedobj.className != "dragable") { + if (this.shiftKeyDown || this.controlKeyDown) return; + + //traverse up the dom tree until you find the asset + while (firedobj.tagName!=this.topLevelElement && !firedobj.asset) { firedobj=manager.display.dom? firedobj.parentNode : firedobj.parentElement } - - if ((!firedobj.asset || firedobj.asset.isParent) && firedobj.className != "dragable") { + if ((!firedobj.asset || firedobj.asset.isParent)) { return; } this.dragEnabled=true; -// while (firedobj.tagName!=this.topLevelElement) { - // for (i =0;ix1 && x < (x1 + obj.offsetWidth)) { - if (y> y1 && y< (y1 + obj.offsetHeight)) { - //for (j=0;j(y1 + obj.bpm.children[j].offsetTop) && y < (y1 + obj.bpm.children[j].offsetTop + obj.bpm.children[j].offsetHeight)) { - return obj; - // } - //} + //add 13 pixels for ie since border widths are included in calculation + var fudge = this.dom? 0:13; + if (y> y1 && y< (y1 + obj.offsetHeight + fudge)) { + return obj; } } - } - + } return returnObj; } +//called on keyDown. Does the right thing (ex. delete, cut, copy, ect) function Display_keyDown(e) { if (e.keyCode==16) { this.shiftKeyDown = true; @@ -270,6 +200,7 @@ function Display_keyDown(e) { } } +//called on keyUp. Does the right thing (ex. delete, cut, copy, ect) function Display_keyUp(e) { if (e.keyCode==16) { this.shiftKeyDown = false; @@ -278,42 +209,46 @@ function Display_keyUp(e) { } } - -//checks to see if the scroll bars need to be adjusted +//checks to see if the scroll bars need to be adjusted. Called durring dragging function Display_adjustScrollBars(e) { var scrY=0; var scrX=0; - if (e.clientY > document.body.clientHeight-this.scrollJump) { - if (e.clientY + document.body.scrollTop < this.pageHeight - (this.scrollJump + 40)) { + var topScroll = document.documentElement.scrollTop; + var leftScroll = document.documentElement.scrollLeft; + var innerHeight = document.documentElement.clientHeight; + var innerWidth = document.documentElement.clientWidth; + + if (e.clientY > innerHeight-this.scrollJump) { + if (e.clientY + topScroll < this.pageHeight - (this.scrollJump + 40)) { scrY=this.scrollJump; - window.scroll(document.body.scrollLeft,document.body.scrollTop + scrY); + window.scroll(leftScroll,topScroll + scrY); this.y-=scrY; } }else if (e.clientY < this.scrollJump) { - if (document.body.scrollTop < this.scrollJump) { - scrY = document.body.scrollTop; + if (topScroll < this.scrollJump) { + scrY = topScroll; }else { scrY=this.scrollJump; } - window.scroll(document.body.scrollLeft,document.body.scrollTop - scrY); + window.scroll(leftScroll,topScroll - scrY); this.y+=scrY; } - if (e.clientX > document.body.clientWidth-this.scrollJump) { - if (e.clientX + document.body.scrollLeft < this.pageWidth - (this.scrollJump + 40)) { + if (e.clientX > innerWidth-this.scrollJump) { + if (e.clientX + leftScroll < this.pageWidth - (this.scrollJump + 40)) { scrX=this.scrollJump; - window.scroll(document.body.scrollLeft + scrX,document.body.scrollTop); + window.scroll(leftScroll + scrX,topScroll); this.x-=scrX; } }else if (e.clientX < this.scrollJump) { - if (document.body.scrollLeft < this.scrollJump) { - scrX = document.body.scrollLeft; + if (leftScroll < this.scrollJump) { + scrX = leftScroll; }else { scrX=this.scrollJump; } - window.scroll(document.body.scrollLeft - scrX,document.body.scrollTop); + window.scroll(leftScroll - scrX,topScroll); this.x+=scrX; } } diff --git a/www/extras/assetManager/EventManager.js b/www/extras/assetManager/EventManager.js index 7bd1bb310..806f2422a 100644 --- a/www/extras/assetManager/EventManager.js +++ b/www/extras/assetManager/EventManager.js @@ -11,6 +11,8 @@ function EventManager() { document.onkeyup=EventManager_keyUp; this.gridHeaderClick = EventManager_gridHeaderClick; + this.gridHeaderMouseOver = EventManager_gridHeaderMouseOver; + this.gridHeaderMouseOut = EventManager_gridHeaderMouseOut; this.assetDoubleClick = EventManager_assetDoubleClick; this.assetRightClick = EventManager_assetRightClick; this.assetMouseDown = EventManager_assetMouseDown; @@ -19,6 +21,28 @@ function EventManager() { //---------Method Implementations ------------- +function EventManager_gridHeaderMouseOver(e) { + var dom = document.getElementById&&!document.all; + e=dom? e : event; + + if (!manager.display.dragEnabled) { + var obj =dom? e.target : e.srcElement + var parts = obj.className.split("-"); + obj.className="am-grid-header-over-" + parts[parts.length -1]; + } +} + +function EventManager_gridHeaderMouseOut(e) { + var dom = document.getElementById&&!document.all; + e=dom? e : event; + var obj =dom? e.target : e.srcElement + + var parts = obj.className.split("-"); + + obj.className="am-grid-header-" + parts[parts.length -1]; + +} + function EventManager_keyDown(e) { var dom = document.getElementById&&!document.all; e=dom? e : event; @@ -64,6 +88,8 @@ function EventManager_assetMouseDown(e) { var dom = document.getElementById&&!document.all; e=dom? e : event; + Display_adjustScrollBars(e); + if (e.button==2) { //this is a hack to get the context menu stuff to work right in IE if (!dom) { @@ -91,6 +117,8 @@ function EventManager_documentMouseDown(e) { manager.display.dragStart(asset.div,e.clientX,e.clientY); return; } + }else { + manager.display.clearSelectedAssets(); } if (e.button != 2) { @@ -116,8 +144,6 @@ function EventManager_documentMouseUp(e) { } manager.display.dragStop(); - //if (obj) manager.display.selectActivity(obj); - return false; } @@ -133,7 +159,6 @@ function EventManager_gridHeaderClick(e) { var e=dom? e : event; var obj =dom? e.target : e.srcElement - var parts = obj.id.split("."); - + var parts = obj.id.split("."); AssetManager_getManager().sortGrid(parts[parts.length-1]); } diff --git a/www/extras/assetManager/Tools.js b/www/extras/assetManager/Tools.js index 245a743fa..8bb0a8fa4 100644 --- a/www/extras/assetManager/Tools.js +++ b/www/extras/assetManager/Tools.js @@ -4,7 +4,6 @@ function Tools() { this.dom=document.getElementById&&!document.all; this.topLevelElement=this.dom? "HTML" : "BODY" - this.getActivity = Tools_getActivity; this.debug = Tools_debug; this.debugEnabled = false; this.getElementChildren = Tools_getElementChildren; @@ -52,11 +51,6 @@ function Tools_cancelEvent() { return false; } -//recurses up a tree to get any activity of className activity -function Tools_getActivity(obj) { - var parts = obj.id.split("."); - return manager.assets[parts[0] + "." + parts[1] + "." + parts[2]]; -} //shows a positionable element by toggling the style display property function Tools_showObject(obj) { diff --git a/www/extras/assetManager/assetManager.css b/www/extras/assetManager/assetManager.css index 9ac21ddde..8fdb8b70f 100644 --- a/www/extras/assetManager/assetManager.css +++ b/www/extras/assetManager/assetManager.css @@ -1,7 +1,3 @@ -#crumbtrail{ - color: #3E697E; - font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, Arial, sans-serif; -} .am-grid { height: 100%; font: menu; @@ -25,7 +21,7 @@ .am-grid-header-0 img{ padding: 0 3px 0 3px; } -.am-grid-header-0 .over{ +.am-grid-header-over-0{ width: 10px; background-color: #F2F3F4; border-left: 1px solid #fff; @@ -47,6 +43,15 @@ padding: 0 3px 0 3px; } +.am-grid-header-over-1{ + width: 200px; + background-color: #F2F3F4; + border-left: 1px solid #fff; + border-right: 1px solid #7F949F; + border-bottom: 2px solid #EA5600; + padding: 0 0 0 10px; +} + .am-grid-header-2 { width: 50px; background-color: #F2F3F4; @@ -59,6 +64,15 @@ padding: 0 3px 0 3px; } +.am-grid-header-over-2{ + width: 50px; + background-color: #F2F3F4; + border-left: 1px solid #fff; + border-right: 1px solid #7F949F; + border-bottom: 2px solid #EA5600; + padding: 0 0 0 10px; +} + .am-grid-header-3 { width: 150px; background-color: #F2F3F4; @@ -71,6 +85,15 @@ padding: 0 3px 0 3px; } +.am-grid-header-over-3{ + width: 150px; + background-color: #F2F3F4; + border-left: 1px solid #fff; + border-right: 1px solid #7F949F; + border-bottom: 2px solid #EA5600; + padding: 0 0 0 10px; +} + .am-grid-header-4 { width: 50px; background-color: #F2F3F4; @@ -83,6 +106,17 @@ .am-grid-header-4 img{ padding: 0 3px 0 3px; } + +.am-grid-header-over-4{ + width: 50px; + background-color: #F2F3F4; + border-left: 1px solid #fff; + border-right: 1px solid #7F949F; + border-bottom: 2px solid #EA5600; + padding: 0 10px 0 0; + text-align: right; +} + .am-grid-row { color: #000; } @@ -124,13 +158,16 @@ .am-crumbtrail { - font-size: 12px; + color: #3E697E; + font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, Arial, sans-serif; + cursor: pointer; } -.am-crumbtrail-header { - font-size: 12px; - font-weight: 700; - +.am-crumbtrail-over { + color: #3E697E; + font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, Arial, sans-serif; + cursor: pointer; + text-decoration: underline; } .contextMenu{