WebGUI 2.7.0 release

This commit is contained in:
JT Smith 2001-12-31 23:34:00 +00:00
parent c0463670e8
commit 08b81c6064
104 changed files with 7333 additions and 2576 deletions

File diff suppressed because it is too large Load diff

View file

@ -11,6 +11,6 @@ Data::Config.........................S
IE Rich Edit.........................Brattli
Spanish Translation..................Ricardo Markiewicz
Portuguese Translation...............Jose Caneira
Dutch Translation....................Joeri de Bruin

View file

@ -7,6 +7,13 @@ upgrading from one version to the next, or even between multiple
versions. Be sure to heed the warnings contained herein as they will
save you many hours of grief.
2.7.0
--------------------------------------------------------------------
* If your 3rd-party widgets, macros, templates, and utilities have
not been broken by any other 2.x.x release, they will most
certainly be broken by this one. The good news is that if
you build any of those things on 2.7.0 or after, they
should continue to work for the foreseeable future.
2.6.0
--------------------------------------------------------------------

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,36 @@
delete from help;
INSERT INTO help VALUES (1,'US English','Add','Page','Think of pages as containers for content. For instance, if you want to write a letter to the editor of your favorite magazine you\'d get out a notepad (or open a word processor) and start filling it with your thoughts. The same is true with WebGUI. Create a page, then add your content to the page.\r\n\r\n<b>Title</b>\r\nThe title of the page is what your users will use to navigate through the site. Titles should be descriptive, but not very long.\r\n\r\n<b>Meta Tags</b>\r\nMeta tags are used by some search engines to associate key words to a particular page. There is a great site called <a href=\"http://www.metatagbuilder.com/\">Meta Tag Builder</a> that will help you build meta tags if you\'ve never done it before.\r\n\r\n<i>Advanced Users:</i> If you have other things (like JavaScript) you usually put in the &lt;head&gt; area of your pages, you may put them here as well.','0');
INSERT INTO help VALUES (2,'US English','Edit','Page','<b>Title</b>\r\nSee <i>Add Page</i> for details.\r\n\r\n<b>Meta Tags</b>\r\nSee <i>Add Page</i> for details.\r\n\r\n<b>Style</b>\r\nBy 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 <i>Add Style</i> for more details.\r\n\r\nIf you check the box next to the style pull-down menu, all of the pages below this page will take on the style you\'ve chosen for this page.\r\n\r\n<b>Page URL</b>\r\nWhen you create a page a url for the page is generated based on the page title. If you are unhappy with the url that was chosen, you can change it here.\r\n\r\n<b>Owner</b>\r\nThe owner of a page is usually the person who created the page. If you\'d like to give ownership of a page to a different content manager, then change the name here. Be careful though, once you change ownership of the page, you won\'t be able to get it back unless you are an administrator.\r\n\r\n<b>Owner can view?</b>\r\nCan the owner view the page or not?\r\n\r\n<b>Owner can edit?</b>\r\nCan the owner edit the page or not? Be careful, if you decide that the owner cannot edit the page and you do not belong to the page group, then you\'ll lose the ability to edit this page.\r\n\r\n<b>Group</b>\r\nA group is assigned to every page for additional privilege control. Pick a group from the pull-down menu.\r\n\r\n<b>Group can view?</b>\r\nCan members of this group view this page?\r\n\r\n<b>Group can edit?</b>\r\nCan members of this group edit this page?\r\n\r\n<b>Anybody can view?</b>\r\nCan any visitor or member regardless of the group and owner view this page?\r\n\r\n<b>Anybody can edit?</b>\r\nCan any visitor or member regardless of the group and owner edit this page?\r\n\r\n','9');
INSERT INTO help VALUES (3,'US English','Delete','Page','Deleting a page can create a big mess if you are uncertain about what you are doing. When you delete a page you are also deleting the content it contains, all sub-pages connected to this page, and all the content they contain. Be certain that you have already moved all the content you wish to keep before you delete a page.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (4,'US English','Delete','Style','When you delete a style all pages using that style will be reverted to the fail safe (default) style. To ensure uninterrupted viewing, you should be sure that no pages are using a style before you delete it.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (5,'US English','Add','User','See <b>Manage Users</b> for additional details.\r\n\r\n<b>Username</b>\r\nUsername is a unique identifier for a user. Sometimes called a handle, it is also how the user will be known on the site. (<i>Note:</i> Administrators have unlimited power in the WebGUI system. This also means they are capable of breaking the system. If you rename or create a user, be careful not to use a username already in existance.)\r\n\r\n<b>Password</b>\r\nA password is used to ensure that the user is who s/he says s/he is.\r\n\r\n<b>Email Address</b>\r\nThe user\'s email address. This must only be specified if the user will partake in functions that require email.\r\n\r\n<b>ICQ UIN</b>\r\nThe <a href=\"http://www.icq.com\">ICQ</a> UIN is the \"User ID Number\" on the ICQ network. ICQ is a very popular instant messaging platform.\r\n\r\n<b>Groups</b>\r\nGroups displays which groups the user is in. Groups that are highlighted are groups that the user is assigned to. Those that are not highlighted are other groups that can be assigned. Note that you must hold down CTRL to select multiple groups.','0');
INSERT INTO help VALUES (6,'US English','Edit','User','<b>Username</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Password</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Email Address</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>ICQ UIN</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Groups</b>\r\nSee <i>Add User</i> for details.\r\n\r\n','0');
INSERT INTO help VALUES (7,'US English','Delete','User','There is no need to ever actually delete a user. If you are concerned with locking out a user, then simply change their password. If you truely wish to delete a user, then please keep in mind that there are consequences. If you delete a user any content that they added to the site via widgets (like message boards and user contributions) will remain on the site. However, if another user tries to visit the deleted user\'s profile they will get an error message. Also if the user ever is welcomed back to the site, there is no way to give him/her access to his/her old content items except by re-adding the user to the users table manually.\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (8,'US English','Manage','User','Users are the accounts in the system that are given rights to do certain things. There are two default users built into the system: Admin and Visitor.\r\n\r\n<b>Admin</b>\r\nAdmin is exactly what you\'d expect. It is a user with unlimited rights in the WebGUI environment. If it can be done, this user has the rights to do it.\r\n\r\n<b>Visitor</b>\r\nVisitor is exactly the opposite of Admin. Visitor has no rights what-so-ever. By default any user who is not logged in is seen as the user Visitor.','0');
INSERT INTO help VALUES (9,'US English','Manage','Style','Styles are used to manage the look and feel of your WebGUI pages. With WebGUI, you can have an unlimited number of styles, so your site can take on as many looks as you like. You could have some pages that look like your company\'s brochure, and some pages that look like Yahoo!&reg;. You could even have some pages that look like pages in a book. Using style management, you have ultimate control over all your designs.\r\n\r\nThere are three styles built in to WebGUI: Fail Safe, Plain Black Software, and Yahoo!&reg;. These styles are not meant to be edited, but rather to give you samples of what\'s possible.\r\n\r\n<b>Fail Safe</b>\r\nWhen you delete a style that is still in use on some pages, the Fail Safe style will be applied to those pages. This style has a white background and simple navigation.\r\n\r\n<b>Plain Black Software</b>\r\nThis is the simple design used on the Plain Black Software site.\r\n\r\n<b>Yahoo!&reg;</b>\r\nThis is the design of the Yahoo!&reg; site. (Yahoo!&reg; has not given us permission to use their design. It is simply an example.)','0');
INSERT INTO help VALUES (10,'US English','Manage','Group','Groups are used to subdivide privileges and responsibilities within the WebGUI system. For instance, you may be building a site for a classroom situation. In that case you might set up a different group for each class that you teach. You would then apply those groups to the pages that are designed for each class.\r\n\r\nThere are four groups built into WebGUI. They are Admins, Content Managers, Visitors, and Registered Users.\r\n\r\n<b>Admins</b>\r\nAdmins are users who have unlimited privileges within WebGUI. A user should only be added to the admin group if they oversee the system. Usually only one to three people will be added to this group.\r\n\r\n<b>Content Managers</b>\r\nContent managers are users who have privileges to add, edit, and delete content from various areas on the site. The content managers group should not be used to control individual content areas within the site, but to determine whether a user can edit content at all. You should set up additional groups to separate content areas on the site.\r\n\r\n<b>Registered Users</b>\r\nWhen users are added to the system they are put into the registered users group. A user should only be removed from this group if their account is deleted or if you wish to punish a troublemaker.\r\n\r\n<b>Visitors</b>\r\nVisitors are users who are not logged in using an account on the system. Also, if you wish to punish a registered user you could remove him/her from the Registered Users group and insert him/her into the Visitors group.','0');
INSERT INTO help VALUES (11,'US English','Edit','Style','<b>Style Name</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n<b>Header</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n<b>Footer</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n<b>Style Sheet</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n','18,19');
INSERT INTO help VALUES (12,'US English','Edit','Settings','Settings are items that allow you to adjust WebGUI to your particular needs.\r\n\r\n<b>Path to WebGUI Extras</b>\r\nThe web-path to the directory containing WebGUI images and javascript files.\r\n\r\n<b>Session Timeout</b>\r\nThe time (in seconds) that a user session remains active (before needing to log in again). This timeout is reset each time a visitor hits a page. Therefore if you set the timeout for 8 hours, a user would have to log in again if s/he hadn\'t visited the site for 8 hours.\r\n\r\n1800 = half hour\r\n3600 = 1 hour\r\n28000 = 8 hours\r\n86400 = 1 day\r\n604800 = 1 week\r\n1209600 = 2 weeks\r\n\r\n<b>Maximum Attachment Size</b>\r\nThe maximum size of files allowed to be uploaded to this site. This applies to all widgets that allow uploaded files and images (like Article and User Contributions). This size is measured in kilobytes.\r\n\r\n<b>Web Attachment Path</b>\r\nThe web-path of the directory where attachments are to be stored.\r\n\r\n<b>Server Attachment Path</b>\r\nThe local path of the directory where attachments are to be stored. (Perhaps /var/www/public/uploads) Be sure that the web server has the rights to write to that directory.\r\n\r\n<b>SMTP Server</b>\r\nThis is the address of your local mail server. It is needed for all features that use the Internet email system (such as password recovery).\r\n\r\n<b>Company Name</b>\r\nThe name of your company. It will appear on all emails and anywhere you use the Company Name macro.\r\n\r\n<b>Company Email Address</b>\r\nA general email address at your company. This is the address that all automated messages will come from. It can also be used via the WebGUI macro system.\r\n\r\n<b>Company URL</b>\r\nThe primary URL of your company. This will appear on all automated emails sent from the WebGUI system. It is also available via the WebGUI macro system.\r\n\r\n\r\n','19');
INSERT INTO help VALUES (13,'US English','Edit','Group','<b>Group Name</b>\r\nSee <i>Add Group</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Group</i> for details.\r\n','0');
INSERT INTO help VALUES (14,'US English','Delete','Widget','This function permanently deletes the selected widget from a page. If you are unsure whether you wish to delete this content you may be better served to cut the content to the clipboard until you are certain you wish to delete it.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (15,'US English','Delete','Group','As the function suggests you\'ll be deleting a group and removing all users from the group. Be careful not to orphan users from pages they should have access to by deleting a group that is in use.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (16,'US English','Add','Style','Styles are WebGUI macro enabled. See <i>Using Macros</i> for more information.\r\n\r\n<b>Style Name</b>\r\nA unique name to describe what this style looks like at a glance. The name has no effect on the actual look of the style.\r\n\r\n<b>Header</b>\r\nThe header is the start of the look of your site. It is helpful to look at your design and cut it into three pieces. The top and left of your design is the header. The center part is the content, and the right and bottom is the footer. Cut the HTML from your header and paste it in the space provided.\r\n\r\nIf you are in need of assistance for creating a look for your site, or if you need help cutting apart your design, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides support services for a small fee.\r\n\r\nMany people will add WebGUI macros to their header for automated navigation, and other features.\r\n\r\n<b>Footer</b>\r\nThe footer is the end of the look for your site. It is the right and bottom portion of your design. You may also place WebGUI macros in your footer.\r\n\r\n<b>Style Sheet</b>\r\nPlace your style sheet entries here. Style sheets are used to control colors, sizes, and other properties of the elements on your site. See <i>Using Style Sheets</i> for more information.\r\n\r\n<i>Advanced Users:</i> for greater performance create your stylesheet on the file system (call it something like webgui.css) and add an entry like this to this area: \r\n&lt;link href=\"/webgui.css\" rel=\"stylesheet\" rev=\"stylesheet\" type=\"text/css\"&gt;','18,19');
INSERT INTO help VALUES (17,'US English','Add','Group','See <i>Manage Group</i> for a description of grouping functions and the default groups.\r\n\r\n<b>Group Name</b>\r\nA name for the group. It is best if the name is descriptive so you know what it is at a glance.\r\n\r\n<b>Description</b>\r\nA longer description of the group so that other admins and content managers (or you if you forget) will know what the purpose of this group is.','0');
INSERT INTO help VALUES (22,'US English','Edit','SQL Report','<b>Title</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Display Title?</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Process Macros</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Template</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Query</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>DSN</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Database User</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Database Password</b>\r\nSee <i>Add SQL Report</i> for details.\r\n','19,14,21');
INSERT INTO help VALUES (18,'US English','Using','Style Sheets','<a href=\"http://www.w3.org/Style/CSS/\">Cascading Style Sheets (CSS)</a> are a great way to manage the look and feel of any web site. They are used extensively in WebGUI.\r\n\r\nIf you are unfamiliar with how to use CSS, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides training classes on XHTML and CSS. Alternatively, Bradsoft makes an excellent CSS editor called <a href=\"http://www.bradsoft.com/topstyle/index.asp\">Top Style</a>.\r\n\r\nThe following is a list of classes used to control the look of WebGUI:\r\n\r\n<b>A</b>\r\nThe links throughout the style.\r\n\r\n<b>BODY</b>\r\nThe default setup of all pages within a style.\r\n\r\n<b>H1</b>\r\nThe headers on every page.\r\n\r\n<b>.accountOptions</b>\r\nThe links that appear under the login and account update forms.\r\n\r\n<b>.adminBar </b>\r\nThe bar that appears at the top of the page when you\'re in admin mode.\r\n\r\n<b>.boardMenu </b>\r\nThe menu on the message boards.\r\n\r\n<b>.boardMessage </b>\r\nThe full message text.\r\n\r\n<b>.boardTitle </b>\r\nThe title of the message board.\r\n\r\n<b>.content</b>\r\nThe main content area on all pages of the style.\r\n\r\n<b>.crumbTrail </b>\r\nThe crumb trail (if you\'re using that macro).\r\n\r\n<b>.eventTitle </b>\r\nThe title of an individual event.\r\n\r\n<b>.faqQuestion</b>\r\nAn F.A.Q. question. To distinguish it from an answer.\r\n\r\n<b>.formDescription </b>\r\nThe tags on all forms next to the form elements. \r\n\r\n<b>.formSubtext </b>\r\nThe tags below some form elements.\r\n\r\n<b>.highlight </b>\r\nDenotes a highlighted item, such as which message you are viewing within a list.\r\n\r\n<b>.horizontalMenu </b>\r\nThe horizontal menu (if you use a horizontal menu macro).\r\n\r\n<b>.loginBox</b>\r\nThe login box macro.\r\n\r\n<b>.pagination </b>\r\nThe Previous and Next links on pages with pagination.\r\n\r\n<b>.pollAnswer </b>\r\nAn answer on a poll.\r\n\r\n<b>.pollColor </b>\r\nThe color of the percentage bar on a poll.\r\n\r\n<b>.pollQuestion </b>\r\nThe question on a poll.\r\n\r\n<b>.tableData </b>\r\nThe data rows on things like message boards and user contributions.\r\n\r\n<b>.tableHeader </b>\r\nThe headings of columns on things like message boards and user contributions.\r\n\r\n<b>.verticalMenu </b>\r\nThe vertical menu (if you use a verticall menu macro).\r\n\r\n','11,16');
INSERT INTO help VALUES (19,'US English','Using','Macros','WebGUI macros are used to create dynamic content within otherwise static content. For instance, you may wish to show which user is logged in on every page, or you may wish to have a dynamically built menu or crumb trail. \r\n\r\nMacros always begin with a carrot (^) and follow with one other character. The following is a description of all the macros in the WebGUI system.\r\n\r\n<b>^^ - Carrot</b>\r\nSince the carrot symbol is used to start all macros, this macro is in place just in case you really wanted to use a carrot somewhere.\r\n\r\n<b>^/ - System URL</b>\r\nThe URL to the gateway script (including the domain for this site). This is often used within pages so that if your development server is on a domain different than your production server that your URLs will still worked when moved.\r\n\r\n<b>^@ - Username</b>\r\nThe username of the currently logged in user.\r\n\r\n<b>^# - User ID</b>\r\nThe user id of the currently logged in user.\r\n\r\n<b>^* - Random Number</b>\r\nA randomly generated number. This is often used on images (such as banner ads) that you want to ensure do not cache.\r\n\r\n<b>^a - My Account Link</b>\r\nA link to your account information.\r\n\r\n<b>^C - Crumb Trail</b>\r\nA dynamically generated crumb trail to the current page.\r\n\r\n<b>^D - Date</b>\r\nThe current date and time.\r\n\r\n<b>^f - Full Menu (Vertical)</b>\r\nDisplays a complete menu listing for all pages on the site, sort of like a site map.\r\n\r\n<b>^F - 2 Level Menu (Vertical)</b>\r\nDisplays the first two levels of the menuing hierarchy at all times.\r\n\r\n<b>^h - 3 Level Menu (Vertical)</b>\r\nDisplays the first three levels of the menuing hierarchy at all times.\r\n\r\n<b>^H - Home Link</b>\r\nA link to the home page of this site.\r\n\r\n<b>^L - Login</b>\r\nA small login form.\r\n\r\n<b>^M - Current Menu (Vertical)</b>\r\nA vertical menu containing the sub-pages at the current level.\r\n\r\n<b>^m - Current Menu (Horizontal)</b>\r\nA horizontal menu containing the sub-pages at the current level.\r\n\r\n<b>^T - Top Level Menu (Vertical)</b>\r\nA vertical menu containing the main pages of the site (aka the sub-pages from the home page).\r\n\r\n<b>^t - Top Level Menu (Horizontal)</b>\r\nA vertical menu containing the main pages of the site (aka the sub-pages from the home page).\r\n\r\n','11,16,12');
INSERT INTO help VALUES (20,'US English','Add','SQL Report','SQL Reports are perhaps the most powerful widget in the WebGUI arsenal. They allow a user to query data from any database that they have access to. This is great for getting sales figures from your Accounting database or even summarizing all the message boards on your web site.\r\n\r\n<b>Title</b>\r\nThe title of this report.\r\n\r\n<b>Display Title?</b>\r\nDo you wish to display the title of the report? If so, check the box.\r\n\r\n<b>Process Macros</b>\r\nDo you wish to process WebGUI Macros on this report? If so, check the box.\r\n\r\n<b>Description</b>\r\nDescribe the content of this report so your users will better understand what the report is all about.\r\n\r\n<b>Template</b>\r\nLayout a template of how this report should look. Usually you\'ll use HTML tables to generate a report. An example is included below.\r\n\r\nThere are 11 special macro characters used in generating SQL Reports. They are ^-, ^0, ^1, ^2, ^3, ^4, ^5, ^6, ^7, ^8, and ^9. These macros will be processed regardless of whether you checked the process macros box above. The ^- macro represents split points in the document where the report will begin and end looping. The numeric macros represent the data fields that will be returned from your query. Note that you may only have 10 fields returned per row in your query.\r\n\r\n<i>Sample Template:</i>\r\n&lt;table&gt;\r\n&lt;tr&gt;&lt;th&gt;Employee Name&lt;/th&gt;&lt;th&gt;Employee #&lt;/th&gt;&lt;th&gt;Vacation Days Remaining&lt;/th&gt;&lt;th&gt;Monthly Salary&lt;/th&gt;&lt;/tr&gt;\r\n^-\r\n&lt;tr&gt;&lt;td&gt;^0&lt;/td&gt;&lt;td&gt;^1&lt;/td&gt;&lt;td&gt;^2&lt;/td&gt;&lt;td&gt;^3&lt;/td&gt;&lt;/tr&gt;\r\n^-\r\n&lt;/table&gt;\r\n\r\n<b>Query</b>\r\nThis is a standard SQL query. If you are unfamiliar with SQL, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides training courses in SQL and database management.\r\n\r\n<b>DSN</b>\r\n<b>D</b>ata <b>S</b>ource <b>N</b>ame is the unique identifier that Perl uses to describe the location of your database. It takes the format of DBI:[driver]:[database name]:[host]. \r\n\r\n<i>Example:</i> DBI:mysql:WebGUI:localhost\r\n\r\n<b>Database User</b>\r\nThe username you use to connect to the DSN.\r\n\r\n<b>Database Password</b>\r\nThe password you use to connect to the DSN.\r\n','19,14,21');
INSERT INTO help VALUES (21,'US English','Using','Widget','Widgets are the true power of WebGUI. Widgets are tiny pluggable applications built to run under WebGUI. Message boards and polls are examples of widgets.\r\n\r\nTo add a widget to a page, first go to that page, then select <i>Add Content...</i> from the upper left corner of your screen. Each widget has it\'s own help so be sure to read the help if you\'re not sure how to use a widget.\r\n','0');
INSERT INTO help VALUES (23,'US English','Add','Article','Articles are the Swiss Army knife of WebGUI. Most pieces of static content can be added via the Article widget.\r\n\r\n<b>Title</b>\r\nWhat\'s the title for this content? Even if you don\'t wish the title to appear, it\'s a good idea to title your content so that if it is ever copied to the clipboard it will have a name.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title listed above?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process WebGUI macros on this article? Unchecking this box will not process macros and will speed up page execution.\r\n\r\n<b>Start Date</b>\r\nWhat date do you want this article to appear on the site? Dates are in the format of MM/DD/YYYY. You can use the JavaScript wizard to choose your date from a calendar by clicking on the <i>set date</i> button. By default the date is set to 01/01/2000.\r\n\r\n<b>End Date</b>\r\nWhat date do you want this article to be removed from the site? By default the date is set to 100 years in the future, 01/01/2100.\r\n\r\n<b>Body</b>\r\nThe body of the article is where all the content goes. You may feel free to add HTML tags as necessary to format your content. Be sure to put a &lt;p&gt; between paragraphs to add white space to your content.\r\n\r\n<b>Image</b>\r\nChoose an image (.jpg, .gif, .png) file from your hard drive. This file will be uploaded to the server and displayed in the upper-right corner of your article.\r\n\r\n<b>Link Title</b>\r\nIf you wish to add a link to your article, enter the title of the link in this field. \r\n\r\n<i>Example:</i> Google\r\n\r\n<b>Link URL</b>\r\nIf you added a link title, now add the URL (uniform resource locator) here. \r\n\r\n<i>Example:</i> http://www.google.com\r\n\r\n<b>Attachment</b>\r\nIf you wish to attach a word processor file, a zip file, or any other file for download by your users, then choose it from your hard drive.\r\n','14,21');
INSERT INTO help VALUES (24,'US English','Edit','Article','<b>Title</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Start Date</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>End Date</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Body</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Image</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Link Title</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Link URL</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Attachment</b>\r\nSee <i>Add Article</i> for details.\r\n','14,21');
INSERT INTO help VALUES (25,'US English','Add','Extra Column','Extra columns allow you to change the layout of your page for one page only. If you wish to have multiple columns on all your pages. Perhaps you should consider altering the <i>style</i> applied to your pages. \r\n\r\nColumns are always added from left to right. Therefore any existing content will be on the left of the new column.\r\n\r\n<b>Spacer</b>\r\nSpacer is the amount of space between your existing content and your new column. It is measured in pixels.\r\n\r\n<b>Width</b>\r\nWidth is the actual width of the new column to be added. Width is measured in pixels.\r\n\r\n<b>StyleSheet Class</b>\r\nBy default the <i>content</i> style (which is the style the body of your site should be using) that is applied to all columns. However, if you\'ve created a style specifically for columns, then feel free to modify this class.\r\n','14,21,9,18');
INSERT INTO help VALUES (26,'US English','Edit','Extra Column','<b>Spacer</b>\r\nSee <i>Add Extra Column</b> for details.\r\n\r\n<b>Width</b>\r\nSee <i>Add Extra Column</b> for details.\r\n\r\n<b>StyleSheet Class</b>\r\nSee <i>Add Extra Column</b> for details.\r\n','14,21,9,18');
INSERT INTO help VALUES (27,'US English','Add','Widget','You can add widgets by selecting from the <i>Add Content</i> pulldown menu.','0');
INSERT INTO help VALUES (28,'US English','Add','Poll','Polls can be used to get the impressions of your users on various topics.\r\n\r\n<b>Title</b>\r\nThe title of the poll. Even if you don\'t wish to display the title you should fill out this field so this poll will have a name if it is ever placed in the clipboard.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to disply the title?\r\n\r\n<b>Description</b>\r\nYou may provide a description for this poll, or give the user some background information.\r\n\r\n<b>Active</b>\r\nIf this box is checked, then users will be able to vote. Otherwise they\'ll only be able to see the results of the poll.\r\n\r\n<b>Who can vote?</b>\r\nChoose a group that can vote on this poll.\r\n\r\n<b>Graph Width</b>\r\nThe width of the poll results graph. The width is measured in pixels.\r\n\r\n<b>Question</b>\r\nWhat is the question you\'d like to ask your users?\r\n\r\n<b>Answers</b>\r\nEnter the possible answers to your question. Enter only one answer per line. Polls are only capable of 20 possible answers.\r\n','14,21');
INSERT INTO help VALUES (29,'US English','Edit','Poll','<b>Title</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Active</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Who can vote?</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Graph Width</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Question</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Answers</b>\r\nSee <i>Add Poll</i> for details.\r\n','14,21');
INSERT INTO help VALUES (30,'US English','Add','Site Map','Site maps are used to provide additional navigation in WebGUI. You could set up a traditional site map that would display a hierarchical view of all the pages in the site. On the other hand, you could use site maps to provide extra navigation at certain levels in your site.\r\n\r\n<b>Title</b>\r\nWhat title would you give to this site map? You should fill this field out even if you don\'t wish it to be displayed.\r\n\r\n<b>Display Title</b>\r\nShould the title be displayed?\r\n\r\n<b>Description</b>\r\nEnter a description as to why this site map is here and what purpose it serves.\r\n\r\n<b>Starting from this level?</b>\r\nIf the site map should display the page tree starting from this level, then check this box. If you wish the site map to start from the home page then uncheck it.\r\n\r\n<b>Show only one level?</b>\r\nShould the site map display only the current level of pages or all pages from this point forward? \r\n','14,21');
INSERT INTO help VALUES (31,'US English','Edit','Site Map','<b>Title</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Display Title</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Starting from this level?</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Show only one level?</b>\r\nSee <i>Add Site Map</i> for details.\r\n','14,21');
alter table pollAnswer add column ipAddress varchar(50);
alter table session add column lastIP varchar(50);

View file

@ -0,0 +1,47 @@
alter table SQLReport add column convertCarriageReturns int not null default 0;
delete from help;
INSERT INTO help VALUES (1,'US English','Add','Page','Think of pages as containers for content. For instance, if you want to write a letter to the editor of your favorite magazine you\'d get out a notepad (or open a word processor) and start filling it with your thoughts. The same is true with WebGUI. Create a page, then add your content to the page.\r\n\r\n<b>Title</b>\r\nThe title of the page is what your users will use to navigate through the site. Titles should be descriptive, but not very long.\r\n\r\n<b>Meta Tags</b>\r\nMeta tags are used by some search engines to associate key words to a particular page. There is a great site called <a href=\"http://www.metatagbuilder.com/\">Meta Tag Builder</a> that will help you build meta tags if you\'ve never done it before.\r\n\r\n<i>Advanced Users:</i> If you have other things (like JavaScript) you usually put in the &lt;head&gt; area of your pages, you may put them here as well.','0');
INSERT INTO help VALUES (2,'US English','Edit','Page','<b>Title</b>\r\nSee <i>Add Page</i> for details.\r\n\r\n<b>Meta Tags</b>\r\nSee <i>Add Page</i> for details.\r\n\r\n<b>Style</b>\r\nBy 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 <i>Add Style</i> for more details.\r\n\r\nIf you check the box next to the style pull-down menu, all of the pages below this page will take on the style you\'ve chosen for this page.\r\n\r\n<b>Page URL</b>\r\nWhen you create a page a url for the page is generated based on the page title. If you are unhappy with the url that was chosen, you can change it here.\r\n\r\n<b>Owner</b>\r\nThe owner of a page is usually the person who created the page. If you\'d like to give ownership of a page to a different content manager, then change the name here. Be careful though, once you change ownership of the page, you won\'t be able to get it back unless you are an administrator.\r\n\r\n<b>Owner can view?</b>\r\nCan the owner view the page or not?\r\n\r\n<b>Owner can edit?</b>\r\nCan the owner edit the page or not? Be careful, if you decide that the owner cannot edit the page and you do not belong to the page group, then you\'ll lose the ability to edit this page.\r\n\r\n<b>Group</b>\r\nA group is assigned to every page for additional privilege control. Pick a group from the pull-down menu.\r\n\r\n<b>Group can view?</b>\r\nCan members of this group view this page?\r\n\r\n<b>Group can edit?</b>\r\nCan members of this group edit this page?\r\n\r\n<b>Anybody can view?</b>\r\nCan any visitor or member regardless of the group and owner view this page?\r\n\r\n<b>Anybody can edit?</b>\r\nCan any visitor or member regardless of the group and owner edit this page?\r\n\r\n','9');
INSERT INTO help VALUES (3,'US English','Delete','Page','Deleting a page can create a big mess if you are uncertain about what you are doing. When you delete a page you are also deleting the content it contains, all sub-pages connected to this page, and all the content they contain. Be certain that you have already moved all the content you wish to keep before you delete a page.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (4,'US English','Delete','Style','When you delete a style all pages using that style will be reverted to the fail safe (default) style. To ensure uninterrupted viewing, you should be sure that no pages are using a style before you delete it.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (5,'US English','Add','User','See <b>Manage Users</b> for additional details.\r\n\r\n<b>Username</b>\r\nUsername is a unique identifier for a user. Sometimes called a handle, it is also how the user will be known on the site. (<i>Note:</i> Administrators have unlimited power in the WebGUI system. This also means they are capable of breaking the system. If you rename or create a user, be careful not to use a username already in existance.)\r\n\r\n<b>Password</b>\r\nA password is used to ensure that the user is who s/he says s/he is.\r\n\r\n<b>Email Address</b>\r\nThe user\'s email address. This must only be specified if the user will partake in functions that require email.\r\n\r\n<b>ICQ UIN</b>\r\nThe <a href=\"http://www.icq.com\">ICQ</a> UIN is the \"User ID Number\" on the ICQ network. ICQ is a very popular instant messaging platform.\r\n\r\n<b>Groups</b>\r\nGroups displays which groups the user is in. Groups that are highlighted are groups that the user is assigned to. Those that are not highlighted are other groups that can be assigned. Note that you must hold down CTRL to select multiple groups.','0');
INSERT INTO help VALUES (6,'US English','Edit','User','<b>Username</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Password</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Email Address</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>ICQ UIN</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Groups</b>\r\nSee <i>Add User</i> for details.\r\n\r\n','0');
INSERT INTO help VALUES (7,'US English','Delete','User','There is no need to ever actually delete a user. If you are concerned with locking out a user, then simply change their password. If you truely wish to delete a user, then please keep in mind that there are consequences. If you delete a user any content that they added to the site via widgets (like message boards and user contributions) will remain on the site. However, if another user tries to visit the deleted user\'s profile they will get an error message. Also if the user ever is welcomed back to the site, there is no way to give him/her access to his/her old content items except by re-adding the user to the users table manually.\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (8,'US English','Manage','User','Users are the accounts in the system that are given rights to do certain things. There are two default users built into the system: Admin and Visitor.\r\n\r\n<b>Admin</b>\r\nAdmin is exactly what you\'d expect. It is a user with unlimited rights in the WebGUI environment. If it can be done, this user has the rights to do it.\r\n\r\n<b>Visitor</b>\r\nVisitor is exactly the opposite of Admin. Visitor has no rights what-so-ever. By default any user who is not logged in is seen as the user Visitor.','0');
INSERT INTO help VALUES (9,'US English','Manage','Style','Styles are used to manage the look and feel of your WebGUI pages. With WebGUI, you can have an unlimited number of styles, so your site can take on as many looks as you like. You could have some pages that look like your company\'s brochure, and some pages that look like Yahoo!&reg;. You could even have some pages that look like pages in a book. Using style management, you have ultimate control over all your designs.\r\n\r\nThere are three styles built in to WebGUI: Fail Safe, Plain Black Software, and Yahoo!&reg;. These styles are not meant to be edited, but rather to give you samples of what\'s possible.\r\n\r\n<b>Fail Safe</b>\r\nWhen you delete a style that is still in use on some pages, the Fail Safe style will be applied to those pages. This style has a white background and simple navigation.\r\n\r\n<b>Plain Black Software</b>\r\nThis is the simple design used on the Plain Black Software site.\r\n\r\n<b>Yahoo!&reg;</b>\r\nThis is the design of the Yahoo!&reg; site. (Yahoo!&reg; has not given us permission to use their design. It is simply an example.)','0');
INSERT INTO help VALUES (10,'US English','Manage','Group','Groups are used to subdivide privileges and responsibilities within the WebGUI system. For instance, you may be building a site for a classroom situation. In that case you might set up a different group for each class that you teach. You would then apply those groups to the pages that are designed for each class.\r\n\r\nThere are four groups built into WebGUI. They are Admins, Content Managers, Visitors, and Registered Users.\r\n\r\n<b>Admins</b>\r\nAdmins are users who have unlimited privileges within WebGUI. A user should only be added to the admin group if they oversee the system. Usually only one to three people will be added to this group.\r\n\r\n<b>Content Managers</b>\r\nContent managers are users who have privileges to add, edit, and delete content from various areas on the site. The content managers group should not be used to control individual content areas within the site, but to determine whether a user can edit content at all. You should set up additional groups to separate content areas on the site.\r\n\r\n<b>Registered Users</b>\r\nWhen users are added to the system they are put into the registered users group. A user should only be removed from this group if their account is deleted or if you wish to punish a troublemaker.\r\n\r\n<b>Visitors</b>\r\nVisitors are users who are not logged in using an account on the system. Also, if you wish to punish a registered user you could remove him/her from the Registered Users group and insert him/her into the Visitors group.','0');
INSERT INTO help VALUES (11,'US English','Edit','Style','<b>Style Name</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n<b>Header</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n<b>Footer</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n<b>Style Sheet</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n','18,19');
INSERT INTO help VALUES (12,'US English','Edit','Settings','Settings are items that allow you to adjust WebGUI to your particular needs.\r\n\r\n<b>Path to WebGUI Extras</b>\r\nThe web-path to the directory containing WebGUI images and javascript files.\r\n\r\n<b>Session Timeout</b>\r\nThe time (in seconds) that a user session remains active (before needing to log in again). This timeout is reset each time a visitor hits a page. Therefore if you set the timeout for 8 hours, a user would have to log in again if s/he hadn\'t visited the site for 8 hours.\r\n\r\n1800 = half hour\r\n3600 = 1 hour\r\n28000 = 8 hours\r\n86400 = 1 day\r\n604800 = 1 week\r\n1209600 = 2 weeks\r\n\r\n<b>Maximum Attachment Size</b>\r\nThe maximum size of files allowed to be uploaded to this site. This applies to all widgets that allow uploaded files and images (like Article and User Contributions). This size is measured in kilobytes.\r\n\r\n<b>Web Attachment Path</b>\r\nThe web-path of the directory where attachments are to be stored.\r\n\r\n<b>Server Attachment Path</b>\r\nThe local path of the directory where attachments are to be stored. (Perhaps /var/www/public/uploads) Be sure that the web server has the rights to write to that directory.\r\n\r\n<b>SMTP Server</b>\r\nThis is the address of your local mail server. It is needed for all features that use the Internet email system (such as password recovery).\r\n\r\n<b>Company Name</b>\r\nThe name of your company. It will appear on all emails and anywhere you use the Company Name macro.\r\n\r\n<b>Company Email Address</b>\r\nA general email address at your company. This is the address that all automated messages will come from. It can also be used via the WebGUI macro system.\r\n\r\n<b>Company URL</b>\r\nThe primary URL of your company. This will appear on all automated emails sent from the WebGUI system. It is also available via the WebGUI macro system.\r\n\r\n\r\n','19');
INSERT INTO help VALUES (13,'US English','Edit','Group','<b>Group Name</b>\r\nSee <i>Add Group</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Group</i> for details.\r\n','0');
INSERT INTO help VALUES (14,'US English','Delete','Widget','This function permanently deletes the selected widget from a page. If you are unsure whether you wish to delete this content you may be better served to cut the content to the clipboard until you are certain you wish to delete it.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (15,'US English','Delete','Group','As the function suggests you\'ll be deleting a group and removing all users from the group. Be careful not to orphan users from pages they should have access to by deleting a group that is in use.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (16,'US English','Add','Style','Styles are WebGUI macro enabled. See <i>Using Macros</i> for more information.\r\n\r\n<b>Style Name</b>\r\nA unique name to describe what this style looks like at a glance. The name has no effect on the actual look of the style.\r\n\r\n<b>Header</b>\r\nThe header is the start of the look of your site. It is helpful to look at your design and cut it into three pieces. The top and left of your design is the header. The center part is the content, and the right and bottom is the footer. Cut the HTML from your header and paste it in the space provided.\r\n\r\nIf you are in need of assistance for creating a look for your site, or if you need help cutting apart your design, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides support services for a small fee.\r\n\r\nMany people will add WebGUI macros to their header for automated navigation, and other features.\r\n\r\n<b>Footer</b>\r\nThe footer is the end of the look for your site. It is the right and bottom portion of your design. You may also place WebGUI macros in your footer.\r\n\r\n<b>Style Sheet</b>\r\nPlace your style sheet entries here. Style sheets are used to control colors, sizes, and other properties of the elements on your site. See <i>Using Style Sheets</i> for more information.\r\n\r\n<i>Advanced Users:</i> for greater performance create your stylesheet on the file system (call it something like webgui.css) and add an entry like this to this area: \r\n&lt;link href=\"/webgui.css\" rel=\"stylesheet\" rev=\"stylesheet\" type=\"text/css\"&gt;','18,19');
INSERT INTO help VALUES (17,'US English','Add','Group','See <i>Manage Group</i> for a description of grouping functions and the default groups.\r\n\r\n<b>Group Name</b>\r\nA name for the group. It is best if the name is descriptive so you know what it is at a glance.\r\n\r\n<b>Description</b>\r\nA longer description of the group so that other admins and content managers (or you if you forget) will know what the purpose of this group is.','0');
INSERT INTO help VALUES (22,'US English','Edit','SQL Report','<b>Title</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Display Title?</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Process Macros</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Template</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Query</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>DSN</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Database User</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Database Password</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Convert carriage returns?</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n','19,14,21');
INSERT INTO help VALUES (18,'US English','Using','Style Sheets','<a href=\"http://www.w3.org/Style/CSS/\">Cascading Style Sheets (CSS)</a> are a great way to manage the look and feel of any web site. They are used extensively in WebGUI.\r\n\r\nIf you are unfamiliar with how to use CSS, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides training classes on XHTML and CSS. Alternatively, Bradsoft makes an excellent CSS editor called <a href=\"http://www.bradsoft.com/topstyle/index.asp\">Top Style</a>.\r\n\r\nThe following is a list of classes used to control the look of WebGUI:\r\n\r\n<b>A</b>\r\nThe links throughout the style.\r\n\r\n<b>BODY</b>\r\nThe default setup of all pages within a style.\r\n\r\n<b>H1</b>\r\nThe headers on every page.\r\n\r\n<b>.accountOptions</b>\r\nThe links that appear under the login and account update forms.\r\n\r\n<b>.adminBar </b>\r\nThe bar that appears at the top of the page when you\'re in admin mode.\r\n\r\n<b>.boardMenu </b>\r\nThe menu on the message boards.\r\n\r\n<b>.boardMessage </b>\r\nThe full message text.\r\n\r\n<b>.boardTitle </b>\r\nThe title of the message board.\r\n\r\n<b>.content</b>\r\nThe main content area on all pages of the style.\r\n\r\n<b>.crumbTrail </b>\r\nThe crumb trail (if you\'re using that macro).\r\n\r\n<b>.eventTitle </b>\r\nThe title of an individual event.\r\n\r\n<b>.faqQuestion</b>\r\nAn F.A.Q. question. To distinguish it from an answer.\r\n\r\n<b>.formDescription </b>\r\nThe tags on all forms next to the form elements. \r\n\r\n<b>.formSubtext </b>\r\nThe tags below some form elements.\r\n\r\n<b>.highlight </b>\r\nDenotes a highlighted item, such as which message you are viewing within a list.\r\n\r\n<b>.horizontalMenu </b>\r\nThe horizontal menu (if you use a horizontal menu macro).\r\n\r\n<b>.loginBox</b>\r\nThe login box macro.\r\n\r\n<b>.pagination </b>\r\nThe Previous and Next links on pages with pagination.\r\n\r\n<b>.pollAnswer </b>\r\nAn answer on a poll.\r\n\r\n<b>.pollColor </b>\r\nThe color of the percentage bar on a poll.\r\n\r\n<b>.pollQuestion </b>\r\nThe question on a poll.\r\n\r\n<b>.tableData </b>\r\nThe data rows on things like message boards and user contributions.\r\n\r\n<b>.tableHeader </b>\r\nThe headings of columns on things like message boards and user contributions.\r\n\r\n<b>.verticalMenu </b>\r\nThe vertical menu (if you use a verticall menu macro).\r\n\r\n','11,16');
INSERT INTO help VALUES (19,'US English','Using','Macros','WebGUI macros are used to create dynamic content within otherwise static content. For instance, you may wish to show which user is logged in on every page, or you may wish to have a dynamically built menu or crumb trail. \r\n\r\nMacros always begin with a carat (^) and follow with one other character. The following is a description of all the macros in the WebGUI system.\r\n\r\n<b>^^ - Carat</b>\r\nSince the carat symbol is used to start all macros, this macro is in place just in case you really wanted to use a carat somewhere.\r\n\r\n<b>^/ - System URL</b>\r\nThe URL to the gateway script (including the domain for this site). This is often used within pages so that if your development server is on a domain different than your production server that your URLs will still worked when moved.\r\n\r\n<b>^@ - Username</b>\r\nThe username of the currently logged in user.\r\n\r\n<b>^# - User ID</b>\r\nThe user id of the currently logged in user.\r\n\r\n<b>^* - Random Number</b>\r\nA randomly generated number. This is often used on images (such as banner ads) that you want to ensure do not cache.\r\n\r\n<b>^a - My Account Link</b>\r\nA link to your account information.\r\n\r\n<b>^C - Crumb Trail</b>\r\nA dynamically generated crumb trail to the current page.\r\n\r\n<b>^D - Date</b>\r\nThe current date and time.\r\n\r\n<b>^f - Full Menu (Vertical)</b>\r\nDisplays a complete menu listing for all pages on the site, sort of like a site map.\r\n\r\n<b>^F - 2 Level Menu (Vertical)</b>\r\nDisplays the first two levels of the menuing hierarchy at all times.\r\n\r\n<b>^h - 3 Level Menu (Vertical)</b>\r\nDisplays the first three levels of the menuing hierarchy at all times.\r\n\r\n<b>^H - Home Link</b>\r\nA link to the home page of this site.\r\n\r\n<b>^L - Login</b>\r\nA small login form.\r\n\r\n<b>^M - Current Menu (Vertical)</b>\r\nA vertical menu containing the sub-pages at the current level.\r\n\r\n<b>^m - Current Menu (Horizontal)</b>\r\nA horizontal menu containing the sub-pages at the current level.\r\n\r\n<b>^P - Previous Menu (Vertical)</b>\r\nA vertical menu containing the sub-pages at the previous level.\r\n\r\n<b>^p - Previous Menu (Horizontal)</b>\r\nA horizontal menu containing the sub-pages at the previous level.\r\n\r\n<b>^r - Make Page Printable</b>\r\nCreates a link to remove the style from a page to make it printable.\r\n\r\n<b>^T - Top Level Menu (Vertical)</b>\r\nA vertical menu containing the main pages of the site (aka the sub-pages from the home page).\r\n\r\n<b>^t - Top Level Menu (Horizontal)</b>\r\nA vertical menu containing the main pages of the site (aka the sub-pages from the home page).\r\n\r\n','11,16,12');
INSERT INTO help VALUES (20,'US English','Add','SQL Report','SQL Reports are perhaps the most powerful widget in the WebGUI arsenal. They allow a user to query data from any database that they have access to. This is great for getting sales figures from your Accounting database or even summarizing all the message boards on your web site.\r\n\r\n<b>Title</b>\r\nThe title of this report.\r\n\r\n<b>Display Title?</b>\r\nDo you wish to display the title of the report? If so, check the box.\r\n\r\n<b>Process Macros</b>\r\nDo you wish to process WebGUI Macros on this report? If so, check the box.\r\n\r\n<b>Description</b>\r\nDescribe the content of this report so your users will better understand what the report is all about.\r\n\r\n<b>Template</b>\r\nLayout a template of how this report should look. Usually you\'ll use HTML tables to generate a report. An example is included below.\r\n\r\nThere are 11 special macro characters used in generating SQL Reports. They are ^-, ^0, ^1, ^2, ^3, ^4, ^5, ^6, ^7, ^8, and ^9. These macros will be processed regardless of whether you checked the process macros box above. The ^- macro represents split points in the document where the report will begin and end looping. The numeric macros represent the data fields that will be returned from your query. Note that you may only have 10 fields returned per row in your query.\r\n\r\n<i>Sample Template:</i>\r\n&lt;table&gt;\r\n&lt;tr&gt;&lt;th&gt;Employee Name&lt;/th&gt;&lt;th&gt;Employee #&lt;/th&gt;&lt;th&gt;Vacation Days Remaining&lt;/th&gt;&lt;th&gt;Monthly Salary&lt;/th&gt;&lt;/tr&gt;\r\n^-\r\n&lt;tr&gt;&lt;td&gt;^0&lt;/td&gt;&lt;td&gt;^1&lt;/td&gt;&lt;td&gt;^2&lt;/td&gt;&lt;td&gt;^3&lt;/td&gt;&lt;/tr&gt;\r\n^-\r\n&lt;/table&gt;\r\n\r\n<b>Query</b>\r\nThis is a standard SQL query. If you are unfamiliar with SQL, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides training courses in SQL and database management.\r\n\r\n<b>DSN</b>\r\n<b>D</b>ata <b>S</b>ource <b>N</b>ame is the unique identifier that Perl uses to describe the location of your database. It takes the format of DBI:[driver]:[database name]:[host]. \r\n\r\n<i>Example:</i> DBI:mysql:WebGUI:localhost\r\n\r\n<b>Database User</b>\r\nThe username you use to connect to the DSN.\r\n\r\n<b>Database Password</b>\r\nThe password you use to connect to the DSN.\r\n\r\n<b>Convert carriage returns?</b>\r\nDo you wish to convert the carriage returns in the resultant data to HTML breaks (&lt;br&gt;).\r\n','19,14,21');
INSERT INTO help VALUES (21,'US English','Using','Widget','Widgets are the true power of WebGUI. Widgets are tiny pluggable applications built to run under WebGUI. Message boards and polls are examples of widgets.\r\n\r\nTo add a widget to a page, first go to that page, then select <i>Add Content...</i> from the upper left corner of your screen. Each widget has it\'s own help so be sure to read the help if you\'re not sure how to use a widget.\r\n','0');
INSERT INTO help VALUES (23,'US English','Add','Article','Articles are the Swiss Army knife of WebGUI. Most pieces of static content can be added via the Article widget.\r\n\r\n<b>Title</b>\r\nWhat\'s the title for this content? Even if you don\'t wish the title to appear, it\'s a good idea to title your content so that if it is ever copied to the clipboard it will have a name.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title listed above?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process WebGUI macros on this article? Unchecking this box will not process macros and will speed up page execution.\r\n\r\n<b>Start Date</b>\r\nWhat date do you want this article to appear on the site? Dates are in the format of MM/DD/YYYY. You can use the JavaScript wizard to choose your date from a calendar by clicking on the <i>set date</i> button. By default the date is set to 01/01/2000.\r\n\r\n<b>End Date</b>\r\nWhat date do you want this article to be removed from the site? By default the date is set to 100 years in the future, 01/01/2100.\r\n\r\n<b>Body</b>\r\nThe body of the article is where all the content goes. You may feel free to add HTML tags as necessary to format your content. Be sure to put a &lt;p&gt; between paragraphs to add white space to your content.\r\n\r\n<b>Image</b>\r\nChoose an image (.jpg, .gif, .png) file from your hard drive. This file will be uploaded to the server and displayed in the upper-right corner of your article.\r\n\r\n<b>Link Title</b>\r\nIf you wish to add a link to your article, enter the title of the link in this field. \r\n\r\n<i>Example:</i> Google\r\n\r\n<b>Link URL</b>\r\nIf you added a link title, now add the URL (uniform resource locator) here. \r\n\r\n<i>Example:</i> http://www.google.com\r\n\r\n<b>Attachment</b>\r\nIf you wish to attach a word processor file, a zip file, or any other file for download by your users, then choose it from your hard drive.\r\n','14,21');
INSERT INTO help VALUES (24,'US English','Edit','Article','<b>Title</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Start Date</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>End Date</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Body</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Image</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Link Title</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Link URL</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Attachment</b>\r\nSee <i>Add Article</i> for details.\r\n','14,21');
INSERT INTO help VALUES (25,'US English','Add','Extra Column','Extra columns allow you to change the layout of your page for one page only. If you wish to have multiple columns on all your pages. Perhaps you should consider altering the <i>style</i> applied to your pages. \r\n\r\nColumns are always added from left to right. Therefore any existing content will be on the left of the new column.\r\n\r\n<b>Spacer</b>\r\nSpacer is the amount of space between your existing content and your new column. It is measured in pixels.\r\n\r\n<b>Width</b>\r\nWidth is the actual width of the new column to be added. Width is measured in pixels.\r\n\r\n<b>StyleSheet Class</b>\r\nBy default the <i>content</i> style (which is the style the body of your site should be using) that is applied to all columns. However, if you\'ve created a style specifically for columns, then feel free to modify this class.\r\n','14,21,9,18');
INSERT INTO help VALUES (26,'US English','Edit','Extra Column','<b>Spacer</b>\r\nSee <i>Add Extra Column</b> for details.\r\n\r\n<b>Width</b>\r\nSee <i>Add Extra Column</b> for details.\r\n\r\n<b>StyleSheet Class</b>\r\nSee <i>Add Extra Column</b> for details.\r\n','14,21,9,18');
INSERT INTO help VALUES (27,'US English','Add','Widget','You can add widgets by selecting from the <i>Add Content</i> pulldown menu.','0');
INSERT INTO help VALUES (28,'US English','Add','Poll','Polls can be used to get the impressions of your users on various topics.\r\n\r\n<b>Title</b>\r\nThe title of the poll. Even if you don\'t wish to display the title you should fill out this field so this poll will have a name if it is ever placed in the clipboard.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to disply the title?\r\n\r\n<b>Description</b>\r\nYou may provide a description for this poll, or give the user some background information.\r\n\r\n<b>Active</b>\r\nIf this box is checked, then users will be able to vote. Otherwise they\'ll only be able to see the results of the poll.\r\n\r\n<b>Who can vote?</b>\r\nChoose a group that can vote on this poll.\r\n\r\n<b>Graph Width</b>\r\nThe width of the poll results graph. The width is measured in pixels.\r\n\r\n<b>Question</b>\r\nWhat is the question you\'d like to ask your users?\r\n\r\n<b>Answers</b>\r\nEnter the possible answers to your question. Enter only one answer per line. Polls are only capable of 20 possible answers.\r\n','14,21,19');
INSERT INTO help VALUES (29,'US English','Edit','Poll','<b>Title</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Active</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Who can vote?</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Graph Width</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Question</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Answers</b>\r\nSee <i>Add Poll</i> for details.\r\n','14,21,19');
INSERT INTO help VALUES (30,'US English','Add','Site Map','Site maps are used to provide additional navigation in WebGUI. You could set up a traditional site map that would display a hierarchical view of all the pages in the site. On the other hand, you could use site maps to provide extra navigation at certain levels in your site.\r\n\r\n<b>Title</b>\r\nWhat title would you give to this site map? You should fill this field out even if you don\'t wish it to be displayed.\r\n\r\n<b>Display Title</b>\r\nShould the title be displayed?\r\n\r\n<b>Description</b>\r\nEnter a description as to why this site map is here and what purpose it serves.\r\n\r\n<b>Starting from this level?</b>\r\nIf the site map should display the page tree starting from this level, then check this box. If you wish the site map to start from the home page then uncheck it.\r\n\r\n<b>Show only one level?</b>\r\nShould the site map display only the current level of pages or all pages from this point forward? \r\n','14,21,19');
INSERT INTO help VALUES (31,'US English','Edit','Site Map','<b>Title</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Display Title</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Starting from this level?</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Show only one level?</b>\r\nSee <i>Add Site Map</i> for details.\r\n','14,21,19');
INSERT INTO help VALUES (32,'US English','Add','Message Board','Message boards, also called Forums and/or Discussions, are a great way to add community to any site or intranets. Many companies use message boards internally to collaborate on projects.\r\n\r\n<b>Title</b>\r\nThe name of this board.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title?\r\n\r\n<b>Description</b>\r\nBriefly describe what should be displayed on this message board.\r\n\r\n<b>Who can post?</b>\r\nWhat group can post to this message board?\r\n\r\n<b>Messages Per Page</b>\r\nWhen a visitor first comes to a message board s/he will be presented with a listing of all the topics (aka threads) of the message board. If a board is popular, it will quickly have many topics. The messages per page attribute allows you to specify how many topics should be shown on one page.\r\n\r\n<b>Edit Timeout</b>\r\nHow long after a user has posted to the board will their message be available for them to edit. This timeout is measured in hours.\r\n\r\n<i>Note:</i> Don\'t set this limit too high. One of the great things about message boards is that they are an accurate record of a discussion. If you allow editing for a long time, then a user has a chance to go back and change his/her mind a long time after the original statement was made.\r\n','14,21,19');
INSERT INTO help VALUES (33,'US English','Edit','Message Board','<b>Title</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Who can post?</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Messages Per Page</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Edit Timeout</b>\r\nSee <i>Add Message Board</i> for details.\r\n','14,21,19');
INSERT INTO help VALUES (34,'US English','Add','Link List','Link lists are just what they sound like, a list of links. Many sites have a links section, and this just automates the process.\r\n\r\n<b>Title</b>\r\nWhat is the title of this link list?\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title of this list?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process macros on the contents of this link list? Turning this off will increase performance slightly on busy sites.\r\n\r\n<b>Description</b>\r\nDescribe the purpose of the links in this list.','14,21,19');
INSERT INTO help VALUES (35,'US English','Edit','Link List','<b>Title</b>\r\nSee <i>Add Link List</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Link List</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add Link List</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Link List</i> for details.\r\n\r\n<b>Adding / Editing Links</b>\r\nYou\'ll notice at the bottom of the Edit screen that there are some options to add, edit, delete and reorder the links in your link lists. This process works exactly as the process for doing the same with widgets and pages. The three properties of links are <i>name</i>, <i>url</i>, and <i>description</i>.\r\n','14,21,19');
INSERT INTO help VALUES (36,'US English','Add','Syndicated Content','Syndicated content is content that is pulled from another site using the RDF/RSS specification. This technology is often used to pull headlines from various news sites like <a href=\"http://www.cnn.com\">CNN</a> and <a href=\"http://slashdot.org\">Slashdot</a>. It can, of course, be used for other things like sports scores, stock market info, etc.\r\n\r\nYou can find a list of syndicated content at <a href=\"http://my.userland.com\">http://my.userland.com</a>. You will need to register with an account to browse their listing of content. Also, the list contained there is by no means a complete list of all the syndicated content on the internet.\r\n\r\n<b>Title</b>\r\nWhat is the title for this content? This is often the title of the site that the content comes from.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title?\r\n\r\n<b>Description</b>\r\nBriefly describe the content being pulled so that your users will know what they are seeing.\r\n\r\n<b>URL to RSS file</b>\r\nProvide the exact URL (starting with http://) to the syndicated content\'s RDF or RSS file. The syndicated content will be downloaded from this URL hourly.','14,21');
INSERT INTO help VALUES (37,'US English','Edit','Syndicated Content','<b>Title</b>\r\nSee <i>Add Syndicated Content</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Syndicated Content</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Syndicated Content</i> for details.\r\n\r\n<b>URL to RSS file</b>\r\nSee <i>Add Syndicated Content</i> for details.\r\n','14,21');
INSERT INTO help VALUES (38,'US English','Add','Events Calendar','Events calendars are used on many intranets to keep track of internal dates that affect a whole organization. Also events calendars on consumer sites are a great way to let your customers know what events you\'ll be attending and what promotions you\'ll be having.\r\n\r\n<b>Title</b>\r\nWhat is the title of this events calendar?\r\n\r\n<b>Display the title?</b>\r\nDo you want the title to be displayed?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process WebGUI macros in the content of the events calendar? Turning this off can increase performance on busy sites.\r\n\r\n<b>Description</b>\r\nBriefly describe what this events calendar details.\r\n','14,21,19');
INSERT INTO help VALUES (39,'US English','Edit','Events Calendar','<b>Title</b>\r\nSee <i>Add Events Calendar</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Events Calendar</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add Events Calendar</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Events Calendar</i> for details.\r\n\r\n<b>Add / Edit Events</b>\r\nOn the edit screen you\'ll notice that there are options to add, edit, and delete the events in your events calendar. The properties for events are <i>name</i>, <i>description</i>, <i>start date</i>, and <i>end date</i>.\r\n\r\n<i>Note:</i> Events that have already happened will not be displayed on the events calendar.','14,21,19');
INSERT INTO help VALUES (40,'US English','Add','F.A.Q.','It seems that almost every web site, intranet, and extranet in the world has a frequently asked questions area. This widget helps you build one too.\r\n\r\n<b>Title</b>\r\nWhat is the title for this FAQ section?\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process macros contained in the FAQ content? Turning this off will increase performance on busy sites.\r\n\r\n<b>Description</b>\r\nBriefly describe what this FAQ covers.\r\n','14,21,19');
INSERT INTO help VALUES (41,'US English','Edit','F.A.Q.','<b>Title</b>\r\nSee <i>Add F.A.Q.</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add F.A.Q.</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add F.A.Q.</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add F.A.Q.</i> for details.\r\n\r\n<b>Add / Edit Questions</b>\r\nOn the edit screen you\'ll notice options for adding, editing, deleting, and reordering the questions in your FAQ. The two properties of FAQ questions are <i>question</i> and <i>answer</i>.\r\n\r\n','14,21,19');
INSERT INTO help VALUES (42,'US English','Add','Search (MnoGo)','The <a href=\"http://www.mnogosearch.org\">Mno Go Search engine</a> is one of the most popular and powerful open-source search engines on the market. It is so good that we figured that there was no reason to reinvent the wheel so we incorperated it into WebGUI.\r\n\r\n<b>Title</b>\r\nWhat is the title of this search?\r\n\r\n<b>Display the title?</b>\r\nDo you want to display the title?\r\n\r\n<b>Description</b>\r\nBriefly describe what is available through this search engine.\r\n\r\n<b>DSN</b>\r\n<b>D</b>ata <b>S</b>ource <b>N</b>ame is the unique identifier that Perl uses to describe the location of your database. It takes the format of DBI:[driver]:[database name]:[host]. This DSN needs to point to where your Mno Go Indexer stored the spider results. If you are uncertain how to set up the Mno Go Search Engine and Indexer <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides support and training services.\r\n\r\n<i>Example:</i> DBI:mysql:WebGUI:localhost\r\n\r\n<b>Database User</b>\r\nThe username you use to connect to the DSN.\r\n\r\n<b>Database Password</b>\r\nThe password you use to connect to the DSN.\r\n','14,21');
INSERT INTO help VALUES (43,'US English','Edit','Search (MnoGo)','<b>Title</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>DSN</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>Database User</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>Database Password</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n','14,21');
INSERT INTO help VALUES (44,'US English','Add','User Submission System','User submission systems are a great way to add a sense of community to any site as well as get free content from your users.\r\n\r\n<b>Title</b>\r\nWhat is the title for this user submission system?\r\n\r\n<b>Display the title?</b>\r\nWould you like the title displayed?\r\n\r\n<b>Description</b>\r\nBriefly describe why this user submission system is here and what should be submitted to it.\r\n\r\n<b>Who can contribute?</b>\r\nWhat group is allowed to contribute content?\r\n\r\n<b>Submissions Per Page</b>\r\nHow many submissions should be listed per page in the submissions index?\r\n\r\n<b>Default Status</b>\r\nShould submissions be set to <i>approved</i>, <i>pending</i>, or <i>denied</i> by default?\r\n\r\n<i>Note:</i> If you set the default status to pending, then be prepared to monitor the pending queue under the Admin menu.\r\n','14,21');
INSERT INTO help VALUES (45,'US English','Edit','User Submission System','<b>Title</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Who can contribute?</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Submissions Per Page</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Default Status</b>\r\nSee <i>Add User Submission System</i> for details.\r\n','14,21');

View file

@ -0,0 +1,3 @@
alter table submission add column convertCarriageReturns int not null;
alter table Article add column convertCarriageReturns int not null;

View file

@ -0,0 +1,39 @@
alter table Poll add column graphWidth int not null default 150;
drop table UserContribution;
CREATE TABLE UserSubmission (
widgetId int(11) NOT NULL default '0',
groupToContribute int(11) default NULL,
submissionsPerPage int(11) NOT NULL default '50',
defaultStatus varchar(30) default 'Approved',
PRIMARY KEY (widgetId)
) TYPE=MyISAM;
delete from help where helpId=18;
INSERT INTO help VALUES (18,'US English','Using','Style Sheets','<a href=\"http://www.w3.org/Style/CSS/\">Cascading Style Sheets (CSS)</a> are a great way to manage the look and feel of any web site. They are used extensively in WebGUI.\r\n\r\nIf you are unfamiliar with how to use CSS, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides training classes on XHTML and CSS. Alternatively, Bradsoft makes an excellent CSS editor called <a href=\"http://www.bradsoft.com/topstyle/index.asp\">Top Style</a>.\r\n\r\nThe following is a list of classes used to control the look of WebGUI:\r\n\r\n<b>A</b>\r\nThe links throughout the style.\r\n\r\n<b>BODY</b>\r\nThe default setup of all pages within a style.\r\n\r\n<b>H1</b>\r\nThe headers on every page.\r\n\r\n<b>.accountOptions</b>\r\nThe links that appear under the login and account update forms.\r\n\r\n<b>.adminBar </b>\r\nThe bar that appears at the top of the page when you\'re in admin mode.\r\n\r\n<b>.boardMenu </b>\r\nThe menu on the message boards.\r\n\r\n<b>.boardMessage </b>\r\nThe full message text.\r\n\r\n<b>.boardTitle </b>\r\nThe title of the message board.\r\n\r\n<b>.content</b>\r\nThe main content area on all pages of the style.\r\n\r\n<b>.crumbTrail </b>\r\nThe crumb trail (if you\'re using that macro).\r\n\r\n<b>.eventTitle </b>\r\nThe title of an individual event.\r\n\r\n<b>.faqQuestion</b>\r\nAn F.A.Q. question. To distinguish it from an answer.\r\n\r\n<b>.formDescription </b>\r\nThe tags on all forms next to the form elements. \r\n\r\n<b>.formSubtext </b>\r\nThe tags below some form elements.\r\n\r\n<b>.highlight </b>\r\nDenotes a highlighted item, such as which message you are viewing within a list.\r\n\r\n<b>.horizontalMenu </b>\r\nThe horizontal menu (if you use a horizontal menu macro).\r\n\r\n<b>.loginBox</b>\r\nThe login box macro.\r\n\r\n<b>.pagination </b>\r\nThe Previous and Next links on pages with pagination.\r\n\r\n<b>.pollAnswer </b>\r\nAn answer on a poll.\r\n\r\n<b>.pollColor </b>\r\nThe color of the percentage bar on apoll.\r\n\r\n<b>.pollQuestion </b>\r\nThe question on a poll.\r\n\r\n<b>.tableData </b>\r\nThe data rows on things like message boards and user contributions.\r\n\r\n<b>.tableHeader </b>\r\nThe headings of columns on things like message boards and user contributions.\r\n\r\n<b>.verticalMenu </b>\r\nThe vertical menu (if you use a verticall menu macro).\r\n\r\n','11,16');
delete from help where helpId=19;
INSERT INTO help VALUES (19,'US English','Using','Macros','WebGUI macros are used to create dynamic content within otherwise static content. For instance, you may wish to show which user is logged in on every page, or you may wish to have a dynamically built menu or crumb trail. \r\n\r\nMacros always begin with a carrot (^) and follow with one other character. The following is a description of all the macros in the WebGUI system.\r\n\r\n<b>^^ - Carrot</b>\r\nSince the carrot symbol is used to start all macros, this macro is in place just in case you really wanted to use a carrot somewhere.\r\n\r\n<b>^/ - System URL</b>\r\nThe URL to the gateway script (including the domain for this site). This is often used within pages so that if your development server is on a domain different than your production server that your URLs will still worked when moved.\r\n\r\n<b>^@ - Username</b>\r\nThe username of the currently logged in user.\r\n\r\n<b>^# - User ID</b>\r\nThe user id of the currently logged in user.\r\n\r\n<b>^* - Random Number</b>\r\nA randomly generated number. This is often used on images (such as banner ads) that you want to ensure do not cache.\r\n\r\n<b>^a - My Account Link</b>\r\nA link to your account information.\r\n\r\n<b>^C - Crumb Trail</b>\r\nA dynamically generated crumb trail to the current page.\r\n\r\n<b>^D - Date</b>\r\nThe current date and time.\r\n\r\n<b>^H - Home Link</b>\r\nA link to the home page of this site.\r\n\r\n<b>^L - Login</b>\r\nA small login form.\r\n\r\n<b>^M - Current Menu (Vertical)</b>\r\nA vertical menu containing the sub-pages at the current level.\r\n\r\n<b>^m - Current Menu (Horizontal)</b>\r\nA horizontal menu containing the sub-pages at the current level.\r\n\r\n<b>^T - Top Level Menu (Vertical)</b>\r\nA vertical menu containing the main pages of the site (aka the sub-pages from the home page).\r\n\r\n<b>^t - Top Level Menu (Horizontal)</b>\r\nA vertical menu containing the main pages of the site (aka the sub-pages from the home page).\r\n\r\n','11,16,12');
INSERT INTO help VALUES (20,'US English','Add','SQL Report','SQL Reports are perhaps the most powerful widget in the WebGUI arsenal. They allow a user to query data from any database that they have access to. This is great for getting sales figures from your Accounting database or even summarizing all the message boards on your web site.\r\n\r\n<b>Title</b>\r\nThe title of this report.\r\n\r\n<b>Display Title?</b>\r\nDo you wish to display the title of the report? If so, check the box.\r\n\r\n<b>Process Macros</b>\r\nDo you wish to process WebGUI Macros on this report? If so, check the box.\r\n\r\n<b>Description</b>\r\nDescribe the content of this report so your users will better understand what the report is all about.\r\n\r\n<b>Template</b>\r\nLayout a template of how this report should look. Usually you\'ll use HTML tables to generate a report. An example is included below.\r\n\r\nThere are 11 special macro characters used in generating SQL Reports. They are ^-, ^0, ^1, ^2, ^3, ^4, ^5, ^6, ^7, ^8, and ^9. These macros will be processed regardless of whether you checked the process macros box above. The ^- macro represents split points in the document where the report will begin and end looping. The numeric macros represent the data fields that will be returned from your query. Note that you may only have 10 fields returned per row in your query.\r\n\r\n<i>Sample Template:</i>\r\n&lt;table&gt;\r\n&lt;tr&gt;&lt;th&gt;Employee Name&lt;/th&gt;&lt;th&gt;Employee #&lt;/th&gt;&lt;th&gt;Vacation Days Remaining&lt;/th&gt;&lt;th&gt;Monthly Salary&lt;/th&gt;&lt;/tr&gt;\r\n^-\r\n&lt;tr&gt;&lt;td&gt;^0&lt;/td&gt;&lt;td&gt;^1&lt;/td&gt;&lt;td&gt;^2&lt;/td&gt;&lt;td&gt;^3&lt;/td&gt;&lt;/tr&gt;\r\n^-\r\n&lt;/table&gt;\r\n\r\n<b>Query</b>\r\nThis is a standard SQL query. If you are unfamiliar with SQL, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides training courses in SQL and database management.\r\n\r\n<b>DSN</b>\r\n<b>D</b>ata <b>S</b>ource <b>N</b>ame is the unique identifier that Perl uses to describe the location of your database. It takes the format of DBI:[driver]:[database name]:[host]. \r\n\r\n<i>Example:</i> DBI:mysql:WebGUI:localhost\r\n\r\n<b>Database User</b>\r\nThe username you use to connect to the DSN.\r\n\r\n<b>Database Password</b>\r\nThe password you use to connect to the DSN.\r\n','19');
delete from incrementer where incrementerId='helpId';
insert into incrementer values ('submissionId',1);
delete from style where styleId=3;
INSERT INTO style VALUES (3,'Plain Black Software','<body bgcolor=\"#eaeaef\" text=\"#000000\" link=\"#5555ff\">\r\n<a href=\"/\"><img src=\"/extras/plainBlackSoftware.gif\" border=0></a>\r\n<table width=\"100%\"><tr><td>^C</td><td align=\"right\">^D</td></tr></table>\r\n<table width=\"100%\"><tr><td valign=\"top\" width=\"130\">\r\nuser: ^@\r\n<hr size=1>\r\n^T\r\n</td><td valign=\"top\">\r\n^m\r\n','</td></tr></table><hr size=1>\r\n<a href=\"/\"><img src=\"/extras/pbs.gif\" border=0 align=\"right\"></a>\r\n^H / ^a\r\n</body></html>','<style>\r\n/* WebGUI Default Style Sheet */\r\n\r\n.content, body {\r\n background-color: #eaeaef;\r\n color: #000000;\r\n font-family: helvetica, arial;\r\n font-size: 10pt;\r\n}\r\n\r\n.verticalMenu {\r\n font-size: 10pt;\r\n}\r\nH1 {\r\n font-family: helvetica, arial;\r\n}\r\n\r\nA {\r\n color: #5555ff;\r\n}\r\n\r\n.pagination {\r\n font-family: helvetica, arial;\r\n text-align: center;\r\n width: 100%;\r\n font-size: 8pt;\r\n}\r\n\r\n.horizontalMenu {\r\n font-size: 8pt;\r\n background-color: #ffffff;\r\n font-weight: bold;\r\n border: 1px;\r\n width: 100%;\r\n}\r\n\r\n.adminBar {\r\n background-color: #dddddd;\r\n font-size: 8pt;\r\n font-family: helvetica, arial;\r\n color: #000055;\r\n}\r\n\r\n.crumbTrail {\r\n font-family: helvetica, arial;\r\n color: #666666;\r\n font-size: 8pt;\r\n}\r\n\r\n.crumbTrail A {\r\n color: #555555;\r\n}\r\n\r\n.crumbTrail A:visited {\r\n color: #666666;\r\n}\r\n\r\n.highlight {\r\n background-color: #aaaaaa;\r\n}\r\n\r\n.formDescription {\r\n font-family: helvetica, arial;\r\n font-size: 10pt;\r\n}\r\n\r\n.formSubtext {\r\n font-family: helvetica, arial;\r\n font-size: 8pt;\r\n}\r\n\r\n.boardTitle {\r\n font-family: helvetica, arial;\r\n font-size: 16pt;\r\n}\r\n\r\n.boardMenu a {\r\n font-size: 10pt;\r\n text-decoration: none;\r\n}\r\n\r\n.tableHeader {\r\n background-color: #cccccc;\r\n font-size: 10pt;\r\n}\r\n\r\n.tableData {\r\n font-size: 10pt;\r\n font-family: Helvetica, Arial;\r\n}\r\n\r\n.boardMessage {\r\n font-size: 10pt;\r\n font-family: Helvetica, Arial;\r\n}\r\n\r\n.pollAnswer {\r\n font-family: Helvetica, Arial;\r\n font-size: 8pt;\r\n}\r\n\r\n.pollColor {\r\n background-color: #ffddbb;\r\n}\r\n\r\n.pollQuestion {\r\n font-face: Helvetica, Arial;\r\n font-weight: bold;\r\n}\r\n\r\n</style>');
CREATE TABLE submission (
widgetId int(11) default NULL,
submissionId int(11) NOT NULL default '0',
title varchar(30) default NULL,
dateSubmitted datetime default NULL,
username varchar(30) default NULL,
userId int(11) default NULL,
content text,
image varchar(255) default NULL,
attachment varchar(255) default NULL,
status varchar(30) default NULL,
PRIMARY KEY (submissionId)
) TYPE=MyISAM;
alter table widget change sequenceNumber sequenceNumber int not null default 1;
alter table widget add dateAdded dateTime;
alter table widget add addedBy int;
alter table widget add lastEdited dateTime;
alter table widget add editedBy int;

View file

@ -0,0 +1,2 @@
alter table Article add column convertCarriageReturns int not null;

View file

@ -0,0 +1,59 @@
delete from help;
INSERT INTO help VALUES (1,'US English','Add','Page','Think of pages as containers for content. For instance, if you want to write a letter to the editor of your favorite magazine you\'d get out a notepad (or open a word processor) and start filling it with your thoughts. The same is true with WebGUI. Create a page, then add your content to the page.\r\n\r\n<b>Title</b>\r\nThe title of the page is what your users will use to navigate through the site. Titles should be descriptive, but not very long.\r\n\r\n<b>Meta Tags</b>\r\nMeta tags are used by some search engines to associate key words to a particular page. There is a great site called <a href=\"http://www.metatagbuilder.com/\">Meta Tag Builder</a> that will help you build meta tags if you\'ve never done it before.\r\n\r\n<i>Advanced Users:</i> If you have other things (like JavaScript) you usually put in the &lt;head&gt; area of your pages, you may put them here as well.','0');
INSERT INTO help VALUES (2,'US English','Edit','Page','<b>Title</b>\r\nSee <i>Add Page</i> for details.\r\n\r\n<b>Meta Tags</b>\r\nSee <i>Add Page</i> for details.\r\n\r\n<b>Style</b>\r\nBy 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 <i>Add Style</i> for more details.\r\n\r\nIf you check the box next to the style pull-down menu, all of the pages below this page will take on the style you\'ve chosen for this page.\r\n\r\n<b>Page URL</b>\r\nWhen you create a page a url for the page is generated based on the page title. If you are unhappy with the url that was chosen, you can change it here.\r\n\r\n<b>Owner</b>\r\nThe owner of a page is usually the person who created the page. If you\'d like to give ownership of a page to a different content manager, then change the name here. Be careful though, once you change ownership of the page, you won\'t be able to get it back unless you are an administrator.\r\n\r\n<b>Owner can view?</b>\r\nCan the owner view the page or not?\r\n\r\n<b>Owner can edit?</b>\r\nCan the owner edit the page or not? Be careful, if you decide that the owner cannot edit the page and you do not belong to the page group, then you\'ll lose the ability to edit this page.\r\n\r\n<b>Group</b>\r\nA group is assigned to every page for additional privilege control. Pick a group from the pull-down menu.\r\n\r\n<b>Group can view?</b>\r\nCan members of this group view this page?\r\n\r\n<b>Group can edit?</b>\r\nCan members of this group edit this page?\r\n\r\n<b>Anybody can view?</b>\r\nCan any visitor or member regardless of the group and owner view this page?\r\n\r\n<b>Anybody can edit?</b>\r\nCan any visitor or member regardless of the group and owner edit this page?\r\n\r\n','9');
INSERT INTO help VALUES (3,'US English','Delete','Page','Deleting a page can create a big mess if you are uncertain about what you are doing. When you delete a page you are also deleting the content it contains, all sub-pages connected to this page, and all the content they contain. Be certain that you have already moved all the content you wish to keep before you delete a page.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (4,'US English','Delete','Style','When you delete a style all pages using that style will be reverted to the fail safe (default) style. To ensure uninterrupted viewing, you should be sure that no pages are using a style before you delete it.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (5,'US English','Add','User','See <b>Manage Users</b> for additional details.\r\n\r\n<b>Username</b>\r\nUsername is a unique identifier for a user. Sometimes called a handle, it is also how the user will be known on the site. (<i>Note:</i> Administrators have unlimited power in the WebGUI system. This also means they are capable of breaking the system. If you rename or create a user, be careful not to use a username already in existance.)\r\n\r\n<b>Password</b>\r\nA password is used to ensure that the user is who s/he says s/he is.\r\n\r\n<b>Authentication Method</b>\r\nSee <i>Edit Settings</i> for details.\r\n\r\n<b>LDAP URL</b>\r\nSee <i>Edit Settings</i> for details.\r\n\r\n<b>Connect DN</b>\r\nThe Connect DN is the <b>cn</b> (or common name) of a given user in your LDAP database. It should be specified as <b>cn=John Doe</b>. This is, in effect, the username that will be used to authenticate this user against your LDAP server.\r\n\r\n<b>Email Address</b>\r\nThe user\'s email address. This must only be specified if the user will partake in functions that require email.\r\n\r\n<b>ICQ UIN</b>\r\nThe <a href=\"http://www.icq.com\">ICQ</a> UIN is the \"User ID Number\" on the ICQ network. ICQ is a very popular instant messaging platform.\r\n\r\n<b>Groups</b>\r\nGroups displays which groups the user is in. Groups that are highlighted are groups that the user is assigned to. Those that are not highlighted are other groups that can be assigned. Note that you must hold down CTRL to select multiple groups.','0');
INSERT INTO help VALUES (6,'US English','Edit','User','<b>Username</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Password</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Authentication Method</b>\r\nSee <i>Edit Settings</i> for details.\r\n\r\n<b>LDAP URL</b>\r\nSee <i>Edit Settings</i> for details.\r\n\r\n<b>Connect DN</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Email Address</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>ICQ UIN</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Groups</b>\r\nSee <i>Add User</i> for details.\r\n\r\n','12');
INSERT INTO help VALUES (7,'US English','Delete','User','There is no need to ever actually delete a user. If you are concerned with locking out a user, then simply change their password. If you truely wish to delete a user, then please keep in mind that there are consequences. If you delete a user any content that they added to the site via widgets (like message boards and user contributions) will remain on the site. However, if another user tries to visit the deleted user\'s profile they will get an error message. Also if the user ever is welcomed back to the site, there is no way to give him/her access to his/her old content items except by re-adding the user to the users table manually.\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (8,'US English','Manage','User','Users are the accounts in the system that are given rights to do certain things. There are two default users built into the system: Admin and Visitor.\r\n\r\n<b>Admin</b>\r\nAdmin is exactly what you\'d expect. It is a user with unlimited rights in the WebGUI environment. If it can be done, this user has the rights to do it.\r\n\r\n<b>Visitor</b>\r\nVisitor is exactly the opposite of Admin. Visitor has no rights what-so-ever. By default any user who is not logged in is seen as the user Visitor.','0');
INSERT INTO help VALUES (9,'US English','Manage','Style','Styles are used to manage the look and feel of your WebGUI pages. With WebGUI, you can have an unlimited number of styles, so your site can take on as many looks as you like. You could have some pages that look like your company\'s brochure, and some pages that look like Yahoo!&reg;. You could even have some pages that look like pages in a book. Using style management, you have ultimate control over all your designs.\r\n\r\nThere are three styles built in to WebGUI: Fail Safe, Plain Black Software, and Yahoo!&reg;. These styles are not meant to be edited, but rather to give you samples of what\'s possible.\r\n\r\n<b>Fail Safe</b>\r\nWhen you delete a style that is still in use on some pages, the Fail Safe style will be applied to those pages. This style has a white background and simple navigation.\r\n\r\n<b>Plain Black Software</b>\r\nThis is the simple design used on the Plain Black Software site.\r\n\r\n<b>Yahoo!&reg;</b>\r\nThis is the design of the Yahoo!&reg; site. (Yahoo!&reg; has not given us permission to use their design. It is simply an example.)','0');
INSERT INTO help VALUES (10,'US English','Manage','Group','Groups are used to subdivide privileges and responsibilities within the WebGUI system. For instance, you may be building a site for a classroom situation. In that case you might set up a different group for each class that you teach. You would then apply those groups to the pages that are designed for each class.\r\n\r\nThere are four groups built into WebGUI. They are Admins, Content Managers, Visitors, and Registered Users.\r\n\r\n<b>Admins</b>\r\nAdmins are users who have unlimited privileges within WebGUI. A user should only be added to the admin group if they oversee the system. Usually only one to three people will be added to this group.\r\n\r\n<b>Content Managers</b>\r\nContent managers are users who have privileges to add, edit, and delete content from various areas on the site. The content managers group should not be used to control individual content areas within the site, but to determine whether a user can edit content at all. You should set up additional groups to separate content areas on the site.\r\n\r\n<b>Registered Users</b>\r\nWhen users are added to the system they are put into the registered users group. A user should only be removed from this group if their account is deleted or if you wish to punish a troublemaker.\r\n\r\n<b>Visitors</b>\r\nVisitors are users who are not logged in using an account on the system. Also, if you wish to punish a registered user you could remove him/her from the Registered Users group and insert him/her into the Visitors group.','0');
INSERT INTO help VALUES (11,'US English','Edit','Style','<b>Style Name</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n<b>Header</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n<b>Footer</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n<b>Style Sheet</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n','18,19');
INSERT INTO help VALUES (12,'US English','Edit','Settings','Settings are items that allow you to adjust WebGUI to your particular needs.\r\n\r\n<b>Path to WebGUI Extras</b>\r\nThe web-path to the directory containing WebGUI images and javascript files.\r\n\r\n<b>Maximum Attachment Size</b>\r\nThe maximum size of files allowed to be uploaded to this site. This applies to all widgets that allow uploaded files and images (like Article and User Contributions). This size is measured in kilobytes.\r\n\r\n<b>Web Attachment Path</b>\r\nThe web-path of the directory where attachments are to be stored.\r\n\r\n<b>Server Attachment Path</b>\r\nThe local path of the directory where attachments are to be stored. (Perhaps /var/www/public/uploads) Be sure that the web server has the rights to write to that directory.\r\n\r\n<b>Company Name</b>\r\nThe name of your company. It will appear on all emails and anywhere you use the Company Name macro.\r\n\r\n<b>Company Email Address</b>\r\nA general email address at your company. This is the address that all automated messages will come from. It can also be used via the WebGUI macro system.\r\n\r\n<b>Company URL</b>\r\nThe primary URL of your company. This will appear on all automated emails sent from the WebGUI system. It is also available via the WebGUI macro system.\r\n\r\n<b>Authentication Method (default)</b>\r\nWhat should the default authentication method be for new accounts that are created? The two available options are WebGUI and LDAP. WebGUI authentication means that the users will authenticate against the username and password stored in the WebGUI database. LDAP authentication means that users will authenticate against an external LDAP server.\r\n\r\n<i>Note:</i> Authentication settings can be customized on a per user basis.\r\n\r\n<b>LDAP URL (default)</b>\r\nThe default url to your LDAP server. The LDAP URL takes the form of <b>ldap://[server]:[port]/[base DN]</b>. Example: ldap://ldap.mycompany.com:389/o=MyCompany.\r\n\r\n<b>LDAP Identity</b>\r\nThe LDAP Identity is the unique identifier in the LDAP server that the user will be identified against. Often this field is <b>shortname</b>, which takes the form of first initial + last name. Example: jdoe. Therefore if you specify the LDAP identity to be <i>shortname</i> then Jon Doe would enter <i>jdoe</i> during the registration process.\r\n\r\n<b>LDAP Identity Name</b>\r\nThe label used to describe the LDAP Identity to the user. For instance, some companies use an LDAP server for their proxy server users to authenticate against. In the documentation or training already provided to their users, the LDAP identity is known as their <i>Web Username</b>. So you could enter that label here for consitency.\r\n\r\n<b>LDAP Password Name</b>\r\nJust as the LDAP Identity Name is a label, so is the LDAP Password Name. Use this label as you would LDAP Identity Name.\r\n\r\n<b>Session Timeout</b>\r\nThe time (in seconds) that a user session remains active (before needing to log in again). This timeout is reset each time a visitor hits a page. Therefore if you set the timeout for 8 hours, a user would have to log in again if s/he hadn\'t visited the site for 8 hours.\r\n\r\n1800 = half hour\r\n3600 = 1 hour\r\n28000 = 8 hours\r\n86400 = 1 day\r\n604800 = 1 week\r\n1209600 = 2 weeks\r\n\r\n<b>SMTP Server</b>\r\nThis is the address of your local mail server. It is needed for all features that use the Internet email system (such as password recovery).\r\n\r\n\r\n','19');
INSERT INTO help VALUES (13,'US English','Edit','Group','<b>Group Name</b>\r\nSee <i>Add Group</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Group</i> for details.\r\n','0');
INSERT INTO help VALUES (14,'US English','Delete','Widget','This function permanently deletes the selected widget from a page. If you are unsure whether you wish to delete this content you may be better served to cut the content to the clipboard until you are certain you wish to delete it.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (15,'US English','Delete','Group','As the function suggests you\'ll be deleting a group and removing all users from the group. Be careful not to orphan users from pages they should have access to by deleting a group that is in use.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (16,'US English','Add','Style','Styles are WebGUI macro enabled. See <i>Using Macros</i> for more information.\r\n\r\n<b>Style Name</b>\r\nA unique name to describe what this style looks like at a glance. The name has no effect on the actual look of the style.\r\n\r\n<b>Header</b>\r\nThe header is the start of the look of your site. It is helpful to look at your design and cut it into three pieces. The top and left of your design is the header. The center part is the content, and the right and bottom is the footer. Cut the HTML from your header and paste it in the space provided.\r\n\r\nIf you are in need of assistance for creating a look for your site, or if you need help cutting apart your design, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides support services for a small fee.\r\n\r\nMany people will add WebGUI macros to their header for automated navigation, and other features.\r\n\r\n<b>Footer</b>\r\nThe footer is the end of the look for your site. It is the right and bottom portion of your design. You may also place WebGUI macros in your footer.\r\n\r\n<b>Style Sheet</b>\r\nPlace your style sheet entries here. Style sheets are used to control colors, sizes, and other properties of the elements on your site. See <i>Using Style Sheets</i> for more information.\r\n\r\n<i>Advanced Users:</i> for greater performance create your stylesheet on the file system (call it something like webgui.css) and add an entry like this to this area: \r\n&lt;link href=\"/webgui.css\" rel=\"stylesheet\" rev=\"stylesheet\" type=\"text/css\"&gt;','18,19');
INSERT INTO help VALUES (17,'US English','Add','Group','See <i>Manage Group</i> for a description of grouping functions and the default groups.\r\n\r\n<b>Group Name</b>\r\nA name for the group. It is best if the name is descriptive so you know what it is at a glance.\r\n\r\n<b>Description</b>\r\nA longer description of the group so that other admins and content managers (or you if you forget) will know what the purpose of this group is.','0');
INSERT INTO help VALUES (22,'US English','Edit','SQL Report','<b>Title</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Display Title?</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Process Macros</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Template</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Query</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>DSN</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Database User</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Database Password</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Convert carriage returns?</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n','19,14,21');
INSERT INTO help VALUES (18,'US English','Using','Style Sheets','<a href=\"http://www.w3.org/Style/CSS/\">Cascading Style Sheets (CSS)</a> are a great way to manage the look and feel of any web site. They are used extensively in WebGUI.\r\n\r\nIf you are unfamiliar with how to use CSS, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides training classes on XHTML and CSS. Alternatively, Bradsoft makes an excellent CSS editor called <a href=\"http://www.bradsoft.com/topstyle/index.asp\">Top Style</a>.\r\n\r\nThe following is a list of classes used to control the look of WebGUI:\r\n\r\n<b>A</b>\r\nThe links throughout the style.\r\n\r\n<b>BODY</b>\r\nThe default setup of all pages within a style.\r\n\r\n<b>H1</b>\r\nThe headers on every page.\r\n\r\n<b>.accountOptions</b>\r\nThe links that appear under the login and account update forms.\r\n\r\n<b>.adminBar </b>\r\nThe bar that appears at the top of the page when you\'re in admin mode.\r\n\r\n<b>.boardMenu </b>\r\nThe menu on the message boards.\r\n\r\n<b>.boardMessage </b>\r\nThe full message text.\r\n\r\n<b>.boardTitle </b>\r\nThe title of the message board.\r\n\r\n<b>.content</b>\r\nThe main content area on all pages of the style.\r\n\r\n<b>.crumbTrail </b>\r\nThe crumb trail (if you\'re using that macro).\r\n\r\n<b>.eventTitle </b>\r\nThe title of an individual event.\r\n\r\n<b>.faqQuestion</b>\r\nAn F.A.Q. question. To distinguish it from an answer.\r\n\r\n<b>.formDescription </b>\r\nThe tags on all forms next to the form elements. \r\n\r\n<b>.formSubtext </b>\r\nThe tags below some form elements.\r\n\r\n<b>.highlight </b>\r\nDenotes a highlighted item, such as which message you are viewing within a list.\r\n\r\n<b>.horizontalMenu </b>\r\nThe horizontal menu (if you use a horizontal menu macro).\r\n\r\n<b>.loginBox</b>\r\nThe login box macro.\r\n\r\n<b>.pagination </b>\r\nThe Previous and Next links on pages with pagination.\r\n\r\n<b>.pollAnswer </b>\r\nAn answer on a poll.\r\n\r\n<b>.pollColor </b>\r\nThe color of the percentage bar on a poll.\r\n\r\n<b>.pollQuestion </b>\r\nThe question on a poll.\r\n\r\n<b>.tableData </b>\r\nThe data rows on things like message boards and user contributions.\r\n\r\n<b>.tableHeader </b>\r\nThe headings of columns on things like message boards and user contributions.\r\n\r\n<b>.verticalMenu </b>\r\nThe vertical menu (if you use a verticall menu macro).\r\n\r\n','11,16');
INSERT INTO help VALUES (19,'US English','Using','Macros','WebGUI macros are used to create dynamic content within otherwise static content. For instance, you may wish to show which user is logged in on every page, or you may wish to have a dynamically built menu or crumb trail. \r\n\r\nMacros always begin with a carat (^) and follow with one other character. The following is a description of all the macros in the WebGUI system.\r\n\r\n<b>^^ - Carat</b>\r\nSince the carat symbol is used to start all macros, this macro is in place just in case you really wanted to use a carat somewhere.\r\n\r\n<b>^/ - System URL</b>\r\nThe URL to the gateway script (including the domain for this site). This is often used within pages so that if your development server is on a domain different than your production server that your URLs will still worked when moved.\r\n\r\n<b>^\\ - Page URL</b>\r\nThe URL to the current page (including the domain for this site). This is often used within pages so that if your development server is on a domain different than your production server that your URLs will still worked when moved.\r\n\r\n<b>^@ - Username</b>\r\nThe username of the currently logged in user.\r\n\r\n<b>^# - User ID</b>\r\nThe user id of the currently logged in user.\r\n\r\n<b>^* - Random Number</b>\r\nA randomly generated number. This is often used on images (such as banner ads) that you want to ensure do not cache.\r\n\r\n<b>^a - My Account Link</b>\r\nA link to your account information.\r\n\r\n<b>^C - Crumb Trail</b>\r\nA dynamically generated crumb trail to the current page.\r\n\r\n<b>^D - Date</b>\r\nThe current date and time.\r\n\r\n<b>^f - Full Menu (Vertical)</b>\r\nDisplays a complete menu listing for all pages on the site, sort of like a site map.\r\n\r\n<b>^F - 2 Level Menu (Vertical)</b>\r\nDisplays the first two levels of the menuing hierarchy at all times.\r\n\r\n<b>^h - 3 Level Menu (Vertical)</b>\r\nDisplays the first three levels of the menuing hierarchy at all times.\r\n\r\n<b>^H - Home Link</b>\r\nA link to the home page of this site.\r\n\r\n<b>^j - 2 Level, Current Level Menu (Vertical)</b>\r\nDisplays the next two levels of the menuing hierarchy.\r\n\r\n<b>^J - 3 Level, Current Level Menu (Vertical)</b>\r\nDisplays the next three levels of the menuing hierarchy.\r\n\r\n<b>^L - Login</b>\r\nA small login form.\r\n\r\n<b>^M - Current Menu (Vertical)</b>\r\nA vertical menu containing the sub-pages at the current level.\r\n\r\n<b>^m - Current Menu (Horizontal)</b>\r\nA horizontal menu containing the sub-pages at the current level.\r\n\r\n<b>^P - Previous Menu (Vertical)</b>\r\nA vertical menu containing the sub-pages at the previous level.\r\n\r\n<b>^p - Previous Menu (Horizontal)</b>\r\nA horizontal menu containing the sub-pages at the previous level.\r\n\r\n<b>^r - Make Page Printable</b>\r\nCreates a link to remove the style from a page to make it printable.\r\n\r\n<b>^T - Top Level Menu (Vertical)</b>\r\nA vertical menu containing the main pages of the site (aka the sub-pages from the home page).\r\n\r\n<b>^t - Top Level Menu (Horizontal)</b>\r\nA vertical menu containing the main pages of the site (aka the sub-pages from the home page).\r\n\r\n','11,16,12');
INSERT INTO help VALUES (20,'US English','Add','SQL Report','SQL Reports are perhaps the most powerful widget in the WebGUI arsenal. They allow a user to query data from any database that they have access to. This is great for getting sales figures from your Accounting database or even summarizing all the message boards on your web site.\r\n\r\n<b>Title</b>\r\nThe title of this report.\r\n\r\n<b>Display Title?</b>\r\nDo you wish to display the title of the report? If so, check the box.\r\n\r\n<b>Process Macros</b>\r\nDo you wish to process WebGUI Macros on this report? If so, check the box.\r\n\r\n<b>Description</b>\r\nDescribe the content of this report so your users will better understand what the report is all about.\r\n\r\n<b>Template</b>\r\nLayout a template of how this report should look. Usually you\'ll use HTML tables to generate a report. An example is included below.\r\n\r\nThere are 11 special macro characters used in generating SQL Reports. They are ^-, ^0, ^1, ^2, ^3, ^4, ^5, ^6, ^7, ^8, and ^9. These macros will be processed regardless of whether you checked the process macros box above. The ^- macro represents split points in the document where the report will begin and end looping. The numeric macros represent the data fields that will be returned from your query. Note that you may only have 10 fields returned per row in your query.\r\n\r\n<i>Sample Template:</i>\r\n&lt;table&gt;\r\n&lt;tr&gt;&lt;th&gt;Employee Name&lt;/th&gt;&lt;th&gt;Employee #&lt;/th&gt;&lt;th&gt;Vacation Days Remaining&lt;/th&gt;&lt;th&gt;Monthly Salary&lt;/th&gt;&lt;/tr&gt;\r\n^-\r\n&lt;tr&gt;&lt;td&gt;^0&lt;/td&gt;&lt;td&gt;^1&lt;/td&gt;&lt;td&gt;^2&lt;/td&gt;&lt;td&gt;^3&lt;/td&gt;&lt;/tr&gt;\r\n^-\r\n&lt;/table&gt;\r\n\r\n<b>Query</b>\r\nThis is a standard SQL query. If you are unfamiliar with SQL, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides training courses in SQL and database management.\r\n\r\n<b>DSN</b>\r\n<b>D</b>ata <b>S</b>ource <b>N</b>ame is the unique identifier that Perl uses to describe the location of your database. It takes the format of DBI:[driver]:[database name]:[host]. \r\n\r\n<i>Example:</i> DBI:mysql:WebGUI:localhost\r\n\r\n<b>Database User</b>\r\nThe username you use to connect to the DSN.\r\n\r\n<b>Database Password</b>\r\nThe password you use to connect to the DSN.\r\n\r\n<b>Convert carriage returns?</b>\r\nDo you wish to convert the carriage returns in the resultant data to HTML breaks (&lt;br&gt;).\r\n','19,14,21');
INSERT INTO help VALUES (21,'US English','Using','Widget','Widgets are the true power of WebGUI. Widgets are tiny pluggable applications built to run under WebGUI. Message boards and polls are examples of widgets.\r\n\r\nTo add a widget to a page, first go to that page, then select <i>Add Content...</i> from the upper left corner of your screen. Each widget has it\'s own help so be sure to read the help if you\'re not sure how to use a widget.\r\n','0');
INSERT INTO help VALUES (23,'US English','Add','Article','Articles are the Swiss Army knife of WebGUI. Most pieces of static content can be added via the Article widget.\r\n\r\n<b>Title</b>\r\nWhat\'s the title for this content? Even if you don\'t wish the title to appear, it\'s a good idea to title your content so that if it is ever copied to the clipboard it will have a name.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title listed above?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process WebGUI macros on this article? Unchecking this box will not process macros and will speed up page execution.\r\n\r\n<b>Start Date</b>\r\nWhat date do you want this article to appear on the site? Dates are in the format of MM/DD/YYYY. You can use the JavaScript wizard to choose your date from a calendar by clicking on the <i>set date</i> button. By default the date is set to 01/01/2000.\r\n\r\n<b>End Date</b>\r\nWhat date do you want this article to be removed from the site? By default the date is set to 100 years in the future, 01/01/2100.\r\n\r\n<b>Body</b>\r\nThe body of the article is where all the content goes. You may feel free to add HTML tags as necessary to format your content. Be sure to put a &lt;p&gt; between paragraphs to add white space to your content.\r\n\r\n<b>Image</b>\r\nChoose an image (.jpg, .gif, .png) file from your hard drive. This file will be uploaded to the server and displayed in the upper-right corner of your article.\r\n\r\n<b>Link Title</b>\r\nIf you wish to add a link to your article, enter the title of the link in this field. \r\n\r\n<i>Example:</i> Google\r\n\r\n<b>Link URL</b>\r\nIf you added a link title, now add the URL (uniform resource locator) here. \r\n\r\n<i>Example:</i> http://www.google.com\r\n\r\n<b>Attachment</b>\r\nIf you wish to attach a word processor file, a zip file, or any other file for download by your users, then choose it from your hard drive.\r\n','14,21');
INSERT INTO help VALUES (24,'US English','Edit','Article','<b>Title</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Start Date</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>End Date</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Body</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Image</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Link Title</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Link URL</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Attachment</b>\r\nSee <i>Add Article</i> for details.\r\n','14,21');
INSERT INTO help VALUES (25,'US English','Add','Extra Column','Extra columns allow you to change the layout of your page for one page only. If you wish to have multiple columns on all your pages. Perhaps you should consider altering the <i>style</i> applied to your pages. \r\n\r\nColumns are always added from left to right. Therefore any existing content will be on the left of the new column.\r\n\r\n<b>Spacer</b>\r\nSpacer is the amount of space between your existing content and your new column. It is measured in pixels.\r\n\r\n<b>Width</b>\r\nWidth is the actual width of the new column to be added. Width is measured in pixels.\r\n\r\n<b>StyleSheet Class</b>\r\nBy default the <i>content</i> style (which is the style the body of your site should be using) that is applied to all columns. However, if you\'ve created a style specifically for columns, then feel free to modify this class.\r\n','14,21,9,18');
INSERT INTO help VALUES (26,'US English','Edit','Extra Column','<b>Spacer</b>\r\nSee <i>Add Extra Column</b> for details.\r\n\r\n<b>Width</b>\r\nSee <i>Add Extra Column</b> for details.\r\n\r\n<b>StyleSheet Class</b>\r\nSee <i>Add Extra Column</b> for details.\r\n','14,21,9,18');
INSERT INTO help VALUES (27,'US English','Add','Widget','You can add widgets by selecting from the <i>Add Content</i> pulldown menu.','0');
INSERT INTO help VALUES (28,'US English','Add','Poll','Polls can be used to get the impressions of your users on various topics.\r\n\r\n<b>Title</b>\r\nThe title of the poll. Even if you don\'t wish to display the title you should fill out this field so this poll will have a name if it is ever placed in the clipboard.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to disply the title?\r\n\r\n<b>Description</b>\r\nYou may provide a description for this poll, or give the user some background information.\r\n\r\n<b>Active</b>\r\nIf this box is checked, then users will be able to vote. Otherwise they\'ll only be able to see the results of the poll.\r\n\r\n<b>Who can vote?</b>\r\nChoose a group that can vote on this poll.\r\n\r\n<b>Graph Width</b>\r\nThe width of the poll results graph. The width is measured in pixels.\r\n\r\n<b>Question</b>\r\nWhat is the question you\'d like to ask your users?\r\n\r\n<b>Answers</b>\r\nEnter the possible answers to your question. Enter only one answer per line. Polls are only capable of 20 possible answers.\r\n','14,21,19');
INSERT INTO help VALUES (29,'US English','Edit','Poll','<b>Title</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Active</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Who can vote?</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Graph Width</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Question</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Answers</b>\r\nSee <i>Add Poll</i> for details.\r\n','14,21,19');
INSERT INTO help VALUES (30,'US English','Add','Site Map','Site maps are used to provide additional navigation in WebGUI. You could set up a traditional site map that would display a hierarchical view of all the pages in the site. On the other hand, you could use site maps to provide extra navigation at certain levels in your site.\r\n\r\n<b>Title</b>\r\nWhat title would you give to this site map? You should fill this field out even if you don\'t wish it to be displayed.\r\n\r\n<b>Display Title</b>\r\nShould the title be displayed?\r\n\r\n<b>Description</b>\r\nEnter a description as to why this site map is here and what purpose it serves.\r\n\r\n<b>Starting from this level?</b>\r\nIf the site map should display the page tree starting from this level, then check this box. If you wish the site map to start from the home page then uncheck it.\r\n\r\n<b>Show only one level?</b>\r\nShould the site map display only the current level of pages or all pages from this point forward? \r\n','14,21,19');
INSERT INTO help VALUES (31,'US English','Edit','Site Map','<b>Title</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Display Title</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Starting from this level?</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Show only one level?</b>\r\nSee <i>Add Site Map</i> for details.\r\n','14,21,19');
INSERT INTO help VALUES (32,'US English','Add','Message Board','Message boards, also called Forums and/or Discussions, are a great way to add community to any site or intranets. Many companies use message boards internally to collaborate on projects.\r\n\r\n<b>Title</b>\r\nThe name of this board.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title?\r\n\r\n<b>Description</b>\r\nBriefly describe what should be displayed on this message board.\r\n\r\n<b>Who can post?</b>\r\nWhat group can post to this message board?\r\n\r\n<b>Messages Per Page</b>\r\nWhen a visitor first comes to a message board s/he will be presented with a listing of all the topics (aka threads) of the message board. If a board is popular, it will quickly have many topics. The messages per page attribute allows you to specify how many topics should be shown on one page.\r\n\r\n<b>Edit Timeout</b>\r\nHow long after a user has posted to the board will their message be available for them to edit. This timeout is measured in hours.\r\n\r\n<i>Note:</i> Don\'t set this limit too high. One of the great things about message boards is that they are an accurate record of a discussion. If you allow editing for a long time, then a user has a chance to go back and change his/her mind a long time after the original statement was made.\r\n','14,21,19');
INSERT INTO help VALUES (33,'US English','Edit','Message Board','<b>Title</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Who can post?</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Messages Per Page</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Edit Timeout</b>\r\nSee <i>Add Message Board</i> for details.\r\n','14,21,19');
INSERT INTO help VALUES (34,'US English','Add','Link List','Link lists are just what they sound like, a list of links. Many sites have a links section, and this just automates the process.\r\n\r\n<b>Title</b>\r\nWhat is the title of this link list?\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title of this list?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process macros on the contents of this link list? Turning this off will increase performance slightly on busy sites.\r\n\r\n<b>Description</b>\r\nDescribe the purpose of the links in this list.','14,21,19');
INSERT INTO help VALUES (35,'US English','Edit','Link List','<b>Title</b>\r\nSee <i>Add Link List</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Link List</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add Link List</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Link List</i> for details.\r\n\r\n<b>Adding / Editing Links</b>\r\nYou\'ll notice at the bottom of the Edit screen that there are some options to add, edit, delete and reorder the links in your link lists. This process works exactly as the process for doing the same with widgets and pages. The three properties of links are <i>name</i>, <i>url</i>, and <i>description</i>.\r\n','14,21,19');
INSERT INTO help VALUES (36,'US English','Add','Syndicated Content','Syndicated content is content that is pulled from another site using the RDF/RSS specification. This technology is often used to pull headlines from various news sites like <a href=\"http://www.cnn.com\">CNN</a> and <a href=\"http://slashdot.org\">Slashdot</a>. It can, of course, be used for other things like sports scores, stock market info, etc.\r\n\r\nYou can find a list of syndicated content at <a href=\"http://my.userland.com\">http://my.userland.com</a>. You will need to register with an account to browse their listing of content. Also, the list contained there is by no means a complete list of all the syndicated content on the internet.\r\n\r\n<b>Title</b>\r\nWhat is the title for this content? This is often the title of the site that the content comes from.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title?\r\n\r\n<b>Description</b>\r\nBriefly describe the content being pulled so that your users will know what they are seeing.\r\n\r\n<b>URL to RSS file</b>\r\nProvide the exact URL (starting with http://) to the syndicated content\'s RDF or RSS file. The syndicated content will be downloaded from this URL hourly.','14,21');
INSERT INTO help VALUES (37,'US English','Edit','Syndicated Content','<b>Title</b>\r\nSee <i>Add Syndicated Content</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Syndicated Content</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Syndicated Content</i> for details.\r\n\r\n<b>URL to RSS file</b>\r\nSee <i>Add Syndicated Content</i> for details.\r\n','14,21');
INSERT INTO help VALUES (38,'US English','Add','Events Calendar','Events calendars are used on many intranets to keep track of internal dates that affect a whole organization. Also events calendars on consumer sites are a great way to let your customers know what events you\'ll be attending and what promotions you\'ll be having.\r\n\r\n<b>Title</b>\r\nWhat is the title of this events calendar?\r\n\r\n<b>Display the title?</b>\r\nDo you want the title to be displayed?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process WebGUI macros in the content of the events calendar? Turning this off can increase performance on busy sites.\r\n\r\n<b>Description</b>\r\nBriefly describe what this events calendar details.\r\n','14,21,19');
INSERT INTO help VALUES (39,'US English','Edit','Events Calendar','<b>Title</b>\r\nSee <i>Add Events Calendar</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Events Calendar</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add Events Calendar</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Events Calendar</i> for details.\r\n\r\n<b>Add / Edit Events</b>\r\nOn the edit screen you\'ll notice that there are options to add, edit, and delete the events in your events calendar. The properties for events are <i>name</i>, <i>description</i>, <i>start date</i>, and <i>end date</i>.\r\n\r\n<i>Note:</i> Events that have already happened will not be displayed on the events calendar.','14,21,19');
INSERT INTO help VALUES (40,'US English','Add','F.A.Q.','It seems that almost every web site, intranet, and extranet in the world has a frequently asked questions area. This widget helps you build one too.\r\n\r\n<b>Title</b>\r\nWhat is the title for this FAQ section?\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process macros contained in the FAQ content? Turning this off will increase performance on busy sites.\r\n\r\n<b>Description</b>\r\nBriefly describe what this FAQ covers.\r\n','14,21,19');
INSERT INTO help VALUES (41,'US English','Edit','F.A.Q.','<b>Title</b>\r\nSee <i>Add F.A.Q.</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add F.A.Q.</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add F.A.Q.</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add F.A.Q.</i> for details.\r\n\r\n<b>Add / Edit Questions</b>\r\nOn the edit screen you\'ll notice options for adding, editing, deleting, and reordering the questions in your FAQ. The two properties of FAQ questions are <i>question</i> and <i>answer</i>.\r\n\r\n','14,21,19');
INSERT INTO help VALUES (42,'US English','Add','Search (MnoGo)','The <a href=\"http://www.mnogosearch.org\">Mno Go Search engine</a> is one of the most popular and powerful open-source search engines on the market. It is so good that we figured that there was no reason to reinvent the wheel so we incorperated it into WebGUI.\r\n\r\n<b>Title</b>\r\nWhat is the title of this search?\r\n\r\n<b>Display the title?</b>\r\nDo you want to display the title?\r\n\r\n<b>Description</b>\r\nBriefly describe what is available through this search engine.\r\n\r\n<b>DSN</b>\r\n<b>D</b>ata <b>S</b>ource <b>N</b>ame is the unique identifier that Perl uses to describe the location of your database. It takes the format of DBI:[driver]:[database name]:[host]. This DSN needs to point to where your Mno Go Indexer stored the spider results. If you are uncertain how to set up the Mno Go Search Engine and Indexer <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides support and training services.\r\n\r\n<i>Example:</i> DBI:mysql:WebGUI:localhost\r\n\r\n<b>Database User</b>\r\nThe username you use to connect to the DSN.\r\n\r\n<b>Database Password</b>\r\nThe password you use to connect to the DSN.\r\n','14,21');
INSERT INTO help VALUES (43,'US English','Edit','Search (MnoGo)','<b>Title</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>DSN</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>Database User</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>Database Password</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n','14,21');
INSERT INTO help VALUES (44,'US English','Add','User Submission System','User submission systems are a great way to add a sense of community to any site as well as get free content from your users.\r\n\r\n<b>Title</b>\r\nWhat is the title for this user submission system?\r\n\r\n<b>Display the title?</b>\r\nWould you like the title displayed?\r\n\r\n<b>Description</b>\r\nBriefly describe why this user submission system is here and what should be submitted to it.\r\n\r\n<b>Who can contribute?</b>\r\nWhat group is allowed to contribute content?\r\n\r\n<b>Submissions Per Page</b>\r\nHow many submissions should be listed per page in the submissions index?\r\n\r\n<b>Default Status</b>\r\nShould submissions be set to <i>approved</i>, <i>pending</i>, or <i>denied</i> by default?\r\n\r\n<i>Note:</i> If you set the default status to pending, then be prepared to monitor the pending queue under the Admin menu.\r\n','14,21');
INSERT INTO help VALUES (45,'US English','Edit','User Submission System','<b>Title</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Who can contribute?</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Submissions Per Page</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Default Status</b>\r\nSee <i>Add User Submission System</i> for details.\r\n','14,21');
INSERT INTO help VALUES (46,'US English','Empty','Trash','If you choose to empty your trash, any items contained in it will be lost forever. If you\'re unsure about a few items, it might be best to cut them to your clipboard before you empty the trash.','0');
INSERT INTO settings VALUES ('ldapURL','ldap://ldap.mycompany.com:389/o=MyCompany');
INSERT INTO settings VALUES ('ldapId','shortname');
INSERT INTO settings VALUES ('ldapIdName','LDAP Shortname');
INSERT INTO settings VALUES ('ldapPasswordName','LDAP Password');
INSERT INTO settings VALUES ('authMethod','WebGUI');
alter table user add column authMethod varchar(30) NOT NULL default 'WebGUI';
alter table user add column ldapURL text;
alter table user add column connectDN varchar(255) default NULL;

Binary file not shown.

View file

@ -0,0 +1,5 @@
alter table Poll add column graphWidth_temp int after active;
update Poll set graphWidth_temp=graphWidth;
alter table Poll drop graphWidth;
alter table Poll change graphWidth_temp graphWidth int;

View file

@ -0,0 +1,62 @@
INSERT INTO SiteMap VALUES (-1,0,0);
delete from help;
INSERT INTO help VALUES (1,'US English','Add','Page','Think of pages as containers for content. For instance, if you want to write a letter to the editor of your favorite magazine you\'d get out a notepad (or open a word processor) and start filling it with your thoughts. The same is true with WebGUI. Create a page, then add your content to the page.\r\n\r\n<b>Title</b>\r\nThe title of the page is what your users will use to navigate through the site. Titles should be descriptive, but not very long.\r\n\r\n<b>Meta Tags</b>\r\nMeta tags are used by some search engines to associate key words to a particular page. There is a great site called <a href=\"http://www.metatagbuilder.com/\">Meta Tag Builder</a> that will help you build meta tags if you\'ve never done it before.\r\n\r\n<i>Advanced Users:</i> If you have other things (like JavaScript) you usually put in the &lt;head&gt; area of your pages, you may put them here as well.','0');
INSERT INTO help VALUES (2,'US English','Edit','Page','<b>Title</b>\r\nSee <i>Add Page</i> for details.\r\n\r\n<b>Page URL</b>\r\nWhen you create a page a url for the page is generated based on the page title. If you are unhappy with the url that was chosen, you can change it here.\r\n\r\n<b>Meta Tags</b>\r\nSee <i>Add Page</i> for details.\r\n\r\n<b>Style</b>\r\nBy 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 <i>Add Style</i> for more details.\r\n\r\n<b>Recurse Style</b>\r\nIf you check the box below to the style pull-down menu, all of the pages below this page will take on the style you\'ve chosen for this page.\r\n\r\n<b>Owner</b>\r\nThe owner of a page is usually the person who created the page.\r\n\r\n<b>Owner can view?</b>\r\nCan the owner view the page or not?\r\n\r\n<b>Owner can edit?</b>\r\nCan the owner edit the page or not? Be careful, if you decide that the owner cannot edit the page and you do not belong to the page group, then you\'ll lose the ability to edit this page.\r\n\r\n<b>Group</b>\r\nA group is assigned to every page for additional privilege control. Pick a group from the pull-down menu.\r\n\r\n<b>Group can view?</b>\r\nCan members of this group view this page?\r\n\r\n<b>Group can edit?</b>\r\nCan members of this group edit this page?\r\n\r\n<b>Anybody can view?</b>\r\nCan any visitor or member regardless of the group and owner view this page?\r\n\r\n<b>Anybody can edit?</b>\r\nCan any visitor or member regardless of the group and owner edit this page?\r\n\r\n<b>Recurse Privileges</b>\r\nYou can optionally give these privileges to all pages under this page.','9');
INSERT INTO help VALUES (3,'US English','Delete','Page','Deleting a page can create a big mess if you are uncertain about what you are doing. When you delete a page you are also deleting the content it contains, all sub-pages connected to this page, and all the content they contain. Be certain that you have already moved all the content you wish to keep before you delete a page.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (4,'US English','Delete','Style','When you delete a style all pages using that style will be reverted to the fail safe (default) style. To ensure uninterrupted viewing, you should be sure that no pages are using a style before you delete it.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (5,'US English','Add','User','See <b>Manage Users</b> for additional details.\r\n\r\n<b>Username</b>\r\nUsername is a unique identifier for a user. Sometimes called a handle, it is also how the user will be known on the site. (<i>Note:</i> Administrators have unlimited power in the WebGUI system. This also means they are capable of breaking the system. If you rename or create a user, be careful not to use a username already in existance.)\r\n\r\n<b>Password</b>\r\nA password is used to ensure that the user is who s/he says s/he is.\r\n\r\n<b>Authentication Method</b>\r\nSee <i>Edit Settings</i> for details.\r\n\r\n<b>LDAP URL</b>\r\nSee <i>Edit Settings</i> for details.\r\n\r\n<b>Connect DN</b>\r\nThe Connect DN is the <b>cn</b> (or common name) of a given user in your LDAP database. It should be specified as <b>cn=John Doe</b>. This is, in effect, the username that will be used to authenticate this user against your LDAP server.\r\n\r\n<b>Email Address</b>\r\nThe user\'s email address. This must only be specified if the user will partake in functions that require email.\r\n\r\n<b>ICQ UIN</b>\r\nThe <a href=\"http://www.icq.com\">ICQ</a> UIN is the \"User ID Number\" on the ICQ network. ICQ is a very popular instant messaging platform.\r\n\r\n<b>Groups</b>\r\nGroups displays which groups the user is in. Groups that are highlighted are groups that the user is assigned to. Those that are not highlighted are other groups that can be assigned. Note that you must hold down CTRL to select multiple groups.','0');
INSERT INTO help VALUES (6,'US English','Edit','User','<b>Username</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Password</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Authentication Method</b>\r\nSee <i>Edit Settings</i> for details.\r\n\r\n<b>LDAP URL</b>\r\nSee <i>Edit Settings</i> for details.\r\n\r\n<b>Connect DN</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Email Address</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>ICQ UIN</b>\r\nSee <i>Add User</i> for details.\r\n\r\n<b>Groups</b>\r\nSee <i>Add User</i> for details.\r\n\r\n','12');
INSERT INTO help VALUES (7,'US English','Delete','User','There is no need to ever actually delete a user. If you are concerned with locking out a user, then simply change their password. If you truely wish to delete a user, then please keep in mind that there are consequences. If you delete a user any content that they added to the site via widgets (like message boards and user contributions) will remain on the site. However, if another user tries to visit the deleted user\'s profile they will get an error message. Also if the user ever is welcomed back to the site, there is no way to give him/her access to his/her old content items except by re-adding the user to the users table manually.\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (8,'US English','Manage','User','Users are the accounts in the system that are given rights to do certain things. There are two default users built into the system: Admin and Visitor.\r\n\r\n<b>Admin</b>\r\nAdmin is exactly what you\'d expect. It is a user with unlimited rights in the WebGUI environment. If it can be done, this user has the rights to do it.\r\n\r\n<b>Visitor</b>\r\nVisitor is exactly the opposite of Admin. Visitor has no rights what-so-ever. By default any user who is not logged in is seen as the user Visitor.','0');
INSERT INTO help VALUES (9,'US English','Manage','Style','Styles are used to manage the look and feel of your WebGUI pages. With WebGUI, you can have an unlimited number of styles, so your site can take on as many looks as you like. You could have some pages that look like your company\'s brochure, and some pages that look like Yahoo!&reg;. You could even have some pages that look like pages in a book. Using style management, you have ultimate control over all your designs.\r\n\r\nThere are three styles built in to WebGUI: Fail Safe, Plain Black Software, and Yahoo!&reg;. These styles are not meant to be edited, but rather to give you samples of what\'s possible.\r\n\r\n<b>Fail Safe</b>\r\nWhen you delete a style that is still in use on some pages, the Fail Safe style will be applied to those pages. This style has a white background and simple navigation.\r\n\r\n<b>Plain Black Software</b>\r\nThis is the simple design used on the Plain Black Software site.\r\n\r\n<b>Yahoo!&reg;</b>\r\nThis is the design of the Yahoo!&reg; site. (Yahoo!&reg; has not given us permission to use their design. It is simply an example.)','0');
INSERT INTO help VALUES (10,'US English','Manage','Group','Groups are used to subdivide privileges and responsibilities within the WebGUI system. For instance, you may be building a site for a classroom situation. In that case you might set up a different group for each class that you teach. You would then apply those groups to the pages that are designed for each class.\r\n\r\nThere are four groups built into WebGUI. They are Admins, Content Managers, Visitors, and Registered Users.\r\n\r\n<b>Admins</b>\r\nAdmins are users who have unlimited privileges within WebGUI. A user should only be added to the admin group if they oversee the system. Usually only one to three people will be added to this group.\r\n\r\n<b>Content Managers</b>\r\nContent managers are users who have privileges to add, edit, and delete content from various areas on the site. The content managers group should not be used to control individual content areas within the site, but to determine whether a user can edit content at all. You should set up additional groups to separate content areas on the site.\r\n\r\n<b>Registered Users</b>\r\nWhen users are added to the system they are put into the registered users group. A user should only be removed from this group if their account is deleted or if you wish to punish a troublemaker.\r\n\r\n<b>Visitors</b>\r\nVisitors are users who are not logged in using an account on the system. Also, if you wish to punish a registered user you could remove him/her from the Registered Users group and insert him/her into the Visitors group.','0');
INSERT INTO help VALUES (11,'US English','Edit','Style','<b>Style Name</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n<b>Header</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n<b>Footer</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n<b>Style Sheet</b>\r\nSee <i>Add Style</i> for details.\r\n\r\n','18,19');
INSERT INTO help VALUES (12,'US English','Edit','Settings','Settings are items that allow you to adjust WebGUI to your particular needs.\r\n\r\n<b>Path to WebGUI Extras</b>\r\nThe web-path to the directory containing WebGUI images and javascript files.\r\n\r\n<b>Maximum Attachment Size</b>\r\nThe maximum size of files allowed to be uploaded to this site. This applies to all widgets that allow uploaded files and images (like Article and User Contributions). This size is measured in kilobytes.\r\n\r\n<b>Web Attachment Path</b>\r\nThe web-path of the directory where attachments are to be stored.\r\n\r\n<b>Server Attachment Path</b>\r\nThe local path of the directory where attachments are to be stored. (Perhaps /var/www/public/uploads) Be sure that the web server has the rights to write to that directory.\r\n\r\n<b>Company Name</b>\r\nThe name of your company. It will appear on all emails and anywhere you use the Company Name macro.\r\n\r\n<b>Company Email Address</b>\r\nA general email address at your company. This is the address that all automated messages will come from. It can also be used via the WebGUI macro system.\r\n\r\n<b>Company URL</b>\r\nThe primary URL of your company. This will appear on all automated emails sent from the WebGUI system. It is also available via the WebGUI macro system.\r\n\r\n<b>Anonymous Registration</b>\r\nDo you wish visitors to your site to be able to register themselves?\r\n\r\n<b>Authentication Method (default)</b>\r\nWhat should the default authentication method be for new accounts that are created? The two available options are WebGUI and LDAP. WebGUI authentication means that the users will authenticate against the username and password stored in the WebGUI database. LDAP authentication means that users will authenticate against an external LDAP server.\r\n\r\n<i>Note:</i> Authentication settings can be customized on a per user basis.\r\n\r\n<b>LDAP URL (default)</b>\r\nThe default url to your LDAP server. The LDAP URL takes the form of <b>ldap://[server]:[port]/[base DN]</b>. Example: ldap://ldap.mycompany.com:389/o=MyCompany.\r\n\r\n<b>LDAP Identity</b>\r\nThe LDAP Identity is the unique identifier in the LDAP server that the user will be identified against. Often this field is <b>shortname</b>, which takes the form of first initial + last name. Example: jdoe. Therefore if you specify the LDAP identity to be <i>shortname</i> then Jon Doe would enter <i>jdoe</i> during the registration process.\r\n\r\n<b>LDAP Identity Name</b>\r\nThe label used to describe the LDAP Identity to the user. For instance, some companies use an LDAP server for their proxy server users to authenticate against. In the documentation or training already provided to their users, the LDAP identity is known as their <i>Web Username</b>. So you could enter that label here for consitency.\r\n\r\n<b>LDAP Password Name</b>\r\nJust as the LDAP Identity Name is a label, so is the LDAP Password Name. Use this label as you would LDAP Identity Name.\r\n\r\n<b>Not Found Page</b>\r\nIf a page that a user requests is not found in the system, the user can be redirected to the home page or to an error page where they can attempt to find what they were looking for. You decide which is better for your users.\r\n\r\n<b>Session Timeout</b>\r\nThe time (in seconds) that a user session remains active (before needing to log in again). This timeout is reset each time a visitor hits a page. Therefore if you set the timeout for 8 hours, a user would have to log in again if s/he hadn\'t visited the site for 8 hours.\r\n\r\n1800 = half hour\r\n3600 = 1 hour\r\n28000 = 8 hours\r\n86400 = 1 day\r\n604800 = 1 week\r\n1209600 = 2 weeks\r\n\r\n<b>SMTP Server</b>\r\nThis is the address of your local mail server. It is needed for all features that use the Internet email system (such as password recovery).\r\n\r\n\r\n','0');
INSERT INTO help VALUES (13,'US English','Edit','Group','<b>Group Name</b>\r\nSee <i>Add Group</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Group</i> for details.\r\n','0');
INSERT INTO help VALUES (14,'US English','Delete','Widget','This function permanently deletes the selected widget from a page. If you are unsure whether you wish to delete this content you may be better served to cut the content to the clipboard until you are certain you wish to delete it.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (15,'US English','Delete','Group','As the function suggests you\'ll be deleting a group and removing all users from the group. Be careful not to orphan users from pages they should have access to by deleting a group that is in use.\r\n\r\nAs with any delete operation, you are prompted to be sure you wish to proceed with the delete. If you answer yes, the delete will proceed and there is no recovery possible. If you answer no you\'ll be returned to the prior screen.','0');
INSERT INTO help VALUES (16,'US English','Add','Style','Styles are WebGUI macro enabled. See <i>Using Macros</i> for more information.\r\n\r\n<b>Style Name</b>\r\nA unique name to describe what this style looks like at a glance. The name has no effect on the actual look of the style.\r\n\r\n<b>Header</b>\r\nThe header is the start of the look of your site. It is helpful to look at your design and cut it into three pieces. The top and left of your design is the header. The center part is the content, and the right and bottom is the footer. Cut the HTML from your header and paste it in the space provided.\r\n\r\nIf you are in need of assistance for creating a look for your site, or if you need help cutting apart your design, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides support services for a small fee.\r\n\r\nMany people will add WebGUI macros to their header for automated navigation, and other features.\r\n\r\n<b>Footer</b>\r\nThe footer is the end of the look for your site. It is the right and bottom portion of your design. You may also place WebGUI macros in your footer.\r\n\r\n<b>Style Sheet</b>\r\nPlace your style sheet entries here. Style sheets are used to control colors, sizes, and other properties of the elements on your site. See <i>Using Style Sheets</i> for more information.\r\n\r\n<i>Advanced Users:</i> for greater performance create your stylesheet on the file system (call it something like webgui.css) and add an entry like this to this area: \r\n&lt;link href=\"/webgui.css\" rel=\"stylesheet\" rev=\"stylesheet\" type=\"text/css\"&gt;','18,19');
INSERT INTO help VALUES (17,'US English','Add','Group','See <i>Manage Group</i> for a description of grouping functions and the default groups.\r\n\r\n<b>Group Name</b>\r\nA name for the group. It is best if the name is descriptive so you know what it is at a glance.\r\n\r\n<b>Description</b>\r\nA longer description of the group so that other admins and content managers (or you if you forget) will know what the purpose of this group is.','0');
INSERT INTO help VALUES (22,'US English','Edit','SQL Report','<b>Title</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Display Title?</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Process Macros</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Template</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Query</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>DSN</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Database User</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Database Password</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n<b>Convert carriage returns?</b>\r\nSee <i>Add SQL Report</i> for details.\r\n\r\n','19,14,21');
INSERT INTO help VALUES (18,'US English','Using','Style Sheets','<a href=\"http://www.w3.org/Style/CSS/\">Cascading Style Sheets (CSS)</a> are a great way to manage the look and feel of any web site. They are used extensively in WebGUI.\r\n\r\nIf you are unfamiliar with how to use CSS, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides training classes on XHTML and CSS. Alternatively, Bradsoft makes an excellent CSS editor called <a href=\"http://www.bradsoft.com/topstyle/index.asp\">Top Style</a>.\r\n\r\nThe following is a list of classes used to control the look of WebGUI:\r\n\r\n<b>A</b>\r\nThe links throughout the style.\r\n\r\n<b>BODY</b>\r\nThe default setup of all pages within a style.\r\n\r\n<b>H1</b>\r\nThe headers on every page.\r\n\r\n<b>.accountOptions</b>\r\nThe links that appear under the login and account update forms.\r\n\r\n<b>.adminBar </b>\r\nThe bar that appears at the top of the page when you\'re in admin mode.\r\n\r\n<b>.boardMenu </b>\r\nThe menu on the message boards.\r\n\r\n<b>.boardMessage </b>\r\nThe full message text.\r\n\r\n<b>.boardTitle </b>\r\nThe title of the message board.\r\n\r\n<b>.content</b>\r\nThe main content area on all pages of the style.\r\n\r\n<b>.crumbTrail </b>\r\nThe crumb trail (if you\'re using that macro).\r\n\r\n<b>.eventTitle </b>\r\nThe title of an individual event.\r\n\r\n<b>.faqQuestion</b>\r\nAn F.A.Q. question. To distinguish it from an answer.\r\n\r\n<b>.formDescription </b>\r\nThe tags on all forms next to the form elements. \r\n\r\n<b>.formSubtext </b>\r\nThe tags below some form elements.\r\n\r\n<b>.highlight </b>\r\nDenotes a highlighted item, such as which message you are viewing within a list.\r\n\r\n<b>.horizontalMenu </b>\r\nThe horizontal menu (if you use a horizontal menu macro).\r\n\r\n<b>.loginBox</b>\r\nThe login box macro.\r\n\r\n<b>.pagination </b>\r\nThe Previous and Next links on pages with pagination.\r\n\r\n<b>.pollAnswer </b>\r\nAn answer on a poll.\r\n\r\n<b>.pollColor </b>\r\nThe color of the percentage bar on a poll.\r\n\r\n<b>.pollQuestion </b>\r\nThe question on a poll.\r\n\r\n<b>.tableData </b>\r\nThe data rows on things like message boards and user contributions.\r\n\r\n<b>.tableHeader </b>\r\nThe headings of columns on things like message boards and user contributions.\r\n\r\n<b>.verticalMenu </b>\r\nThe vertical menu (if you use a verticall menu macro).\r\n\r\n','11,16');
INSERT INTO help VALUES (19,'US English','Using','Macros','WebGUI macros are used to create dynamic content within otherwise static content. For instance, you may wish to show which user is logged in on every page, or you may wish to have a dynamically built menu or crumb trail. \r\n\r\nMacros always begin with a carat (^) and follow with one other character. Some macros can be extended/configured by taking the format of ^<i>x</i><b>config text</b>^/<i>x</i>. The following is a description of all the macros in the WebGUI system.\r\n\r\n<b>^a or ^a^/a - My Account Link</b>\r\nA link to your account information. In addition you can change the link text by creating a macro like this <b>^aAccount Info^/a</b>.\r\n\r\n<b>^C - Crumb Trail</b>\r\nA dynamically generated crumb trail to the current page.\r\n\r\n<b>^D or ^D^/D - Date</b>\r\nThe current date and time.\r\n\r\nYou can configure the date by using date formatting symbols. For instance if you created a macro like this <b>^D%c %D, %y^/D</b> it would output <b>September 26, 2001</b>. The following are the available date formatting symbols:\r\n<span style=\"font-family: courier;\">\r\n %% = %\r\n %y = 4 digit year\r\n %Y = 2 digit year\r\n %m = 2 digit month\r\n %M = variable digit month\r\n %c = month name\r\n %d = 2 digit day of month\r\n %D = variable digit day of month\r\n %w = day of week name\r\n %h = 2 digit base 12 hour\r\n %H = variable digit base 12 hour\r\n %j = 2 digit base 24 hour\r\n %J = variable digit base 24 hour\r\n %p = lower case am/pm\r\n %P = upper case AM/PM\r\n</span>\r\n<b>^f - Full Menu (Vertical)</b>\r\nDisplays a complete menu listing for all pages on the site, sort of like a site map.\r\n\r\n<b>^F - 2 Level Menu (Vertical)</b>\r\nDisplays the first two levels of the menuing hierarchy at all times.\r\n\r\n<b>^h - 3 Level Menu (Vertical)</b>\r\nDisplays the first three levels of the menuing hierarchy at all times.\r\n\r\n<b>^H or ^H^/H - Home Link</b>\r\nA link to the home page of this site. In addition you can change the link text by creating a macro like this <b>^HGo Home^/H</b>.\r\n\r\n<b>^j - 2 Level, Current Level Menu (Vertical)</b>\r\nDisplays the next two levels of the menuing hierarchy.\r\n\r\n<b>^J - 3 Level, Current Level Menu (Vertical)</b>\r\nDisplays the next three levels of the menuing hierarchy.\r\n\r\n<b>^L - Login</b>\r\nA small login form.\r\n\r\n<b>^M - Current Menu (Vertical)</b>\r\nA vertical menu containing the sub-pages at the current level.\r\n\r\n<b>^m - Current Menu (Horizontal)</b>\r\nA horizontal menu containing the sub-pages at the current level.\r\n\r\n<b>^P - Previous Menu (Vertical)</b>\r\nA vertical menu containing the sub-pages at the previous level.\r\n\r\n<b>^p - Previous Menu (Horizontal)</b>\r\nA horizontal menu containing the sub-pages at the previous level.\r\n\r\n<b>^r or ^r^/r - Make Page Printable</b>\r\nCreates a link to remove the style from a page to make it printable. In addition you can change the link text by creating a macro like this <b>^rPRINT!^/r</b>.\r\n\r\n<b>^T - Top Level Menu (Vertical)</b>\r\nA vertical menu containing the main pages of the site (aka the sub-pages from the home page).\r\n\r\n<b>^t - Top Level Menu (Horizontal)</b>\r\nA vertical menu containing the main pages of the site (aka the sub-pages from the home page).\r\n\r\n<b>^^ - Carat</b>\r\nSince the carat symbol is used to start all macros, this macro is in place just in case you really wanted to use a carat somewhere.\r\n\r\n<b>^/ - System URL</b>\r\nThe URL to the gateway script (including the domain for this site). This is often used within pages so that if your development server is on a domain different than your production server that your URLs will still worked when moved.\r\n\r\n<b>^\\ - Page URL</b>\r\nThe URL to the current page (including the domain for this site). This is often used within pages so that if your development server is on a domain different than your production server that your URLs will still worked when moved.\r\n\r\n<b>^@ - Username</b>\r\nThe username of the currently logged in user.\r\n\r\n<b>^# - User ID</b>\r\nThe user id of the currently logged in user.\r\n\r\n<b>^* - Random Number</b>\r\nA randomly generated number. This is often used on images (such as banner ads) that you want to ensure do not cache.\r\n\r\n','11,16,12');
INSERT INTO help VALUES (20,'US English','Add','SQL Report','SQL Reports are perhaps the most powerful widget in the WebGUI arsenal. They allow a user to query data from any database that they have access to. This is great for getting sales figures from your Accounting database or even summarizing all the message boards on your web site.\r\n\r\n<b>Title</b>\r\nThe title of this report.\r\n\r\n<b>Display Title?</b>\r\nDo you wish to display the title of the report? If so, check the box.\r\n\r\n<b>Process Macros</b>\r\nDo you wish to process WebGUI Macros on this report? If so, check the box.\r\n\r\n<b>Description</b>\r\nDescribe the content of this report so your users will better understand what the report is all about.\r\n\r\n<b>Template</b>\r\nLayout a template of how this report should look. Usually you\'ll use HTML tables to generate a report. An example is included below.\r\n\r\nThere are 11 special macro characters used in generating SQL Reports. They are ^-, ^0, ^1, ^2, ^3, ^4, ^5, ^6, ^7, ^8, and ^9. These macros will be processed regardless of whether you checked the process macros box above. The ^- macro represents split points in the document where the report will begin and end looping. The numeric macros represent the data fields that will be returned from your query. Note that you may only have 10 fields returned per row in your query.\r\n\r\n<i>Sample Template:</i>\r\n&lt;table&gt;\r\n&lt;tr&gt;&lt;th&gt;Employee Name&lt;/th&gt;&lt;th&gt;Employee #&lt;/th&gt;&lt;th&gt;Vacation Days Remaining&lt;/th&gt;&lt;th&gt;Monthly Salary&lt;/th&gt;&lt;/tr&gt;\r\n^-\r\n&lt;tr&gt;&lt;td&gt;^0&lt;/td&gt;&lt;td&gt;^1&lt;/td&gt;&lt;td&gt;^2&lt;/td&gt;&lt;td&gt;^3&lt;/td&gt;&lt;/tr&gt;\r\n^-\r\n&lt;/table&gt;\r\n\r\n<b>Query</b>\r\nThis is a standard SQL query. If you are unfamiliar with SQL, <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides training courses in SQL and database management.\r\n\r\n<b>DSN</b>\r\n<b>D</b>ata <b>S</b>ource <b>N</b>ame is the unique identifier that Perl uses to describe the location of your database. It takes the format of DBI:[driver]:[database name]:[host]. \r\n\r\n<i>Example:</i> DBI:mysql:WebGUI:localhost\r\n\r\n<b>Database User</b>\r\nThe username you use to connect to the DSN.\r\n\r\n<b>Database Password</b>\r\nThe password you use to connect to the DSN.\r\n\r\n<b>Convert carriage returns?</b>\r\nDo you wish to convert the carriage returns in the resultant data to HTML breaks (&lt;br&gt;).\r\n','19,14,21');
INSERT INTO help VALUES (21,'US English','Using','Widget','Widgets are the true power of WebGUI. Widgets are tiny pluggable applications built to run under WebGUI. Message boards and polls are examples of widgets.\r\n\r\nTo add a widget to a page, first go to that page, then select <i>Add Content...</i> from the upper left corner of your screen. Each widget has it\'s own help so be sure to read the help if you\'re not sure how to use a widget.\r\n','0');
INSERT INTO help VALUES (23,'US English','Add','Article','Articles are the Swiss Army knife of WebGUI. Most pieces of static content can be added via the Article widget.\r\n\r\n<b>Title</b>\r\nWhat\'s the title for this content? Even if you don\'t wish the title to appear, it\'s a good idea to title your content so that if it is ever copied to the clipboard it will have a name.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title listed above?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process WebGUI macros on this article? Unchecking this box will not process macros and will speed up page execution.\r\n\r\n<b>Start Date</b>\r\nWhat date do you want this article to appear on the site? Dates are in the format of MM/DD/YYYY. You can use the JavaScript wizard to choose your date from a calendar by clicking on the <i>set date</i> button. By default the date is set to 01/01/2000.\r\n\r\n<b>End Date</b>\r\nWhat date do you want this article to be removed from the site? By default the date is set to 100 years in the future, 01/01/2100.\r\n\r\n<b>Body</b>\r\nThe body of the article is where all the content goes. You may feel free to add HTML tags as necessary to format your content. Be sure to put a &lt;p&gt; between paragraphs to add white space to your content.\r\n\r\n<b>Image</b>\r\nChoose an image (.jpg, .gif, .png) file from your hard drive. This file will be uploaded to the server and displayed in the upper-right corner of your article.\r\n\r\n<b>Link Title</b>\r\nIf you wish to add a link to your article, enter the title of the link in this field. \r\n\r\n<i>Example:</i> Google\r\n\r\n<b>Link URL</b>\r\nIf you added a link title, now add the URL (uniform resource locator) here. \r\n\r\n<i>Example:</i> http://www.google.com\r\n\r\n<b>Attachment</b>\r\nIf you wish to attach a word processor file, a zip file, or any other file for download by your users, then choose it from your hard drive.\r\n','14,21');
INSERT INTO help VALUES (24,'US English','Edit','Article','<b>Title</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Start Date</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>End Date</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Body</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Image</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Link Title</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Link URL</b>\r\nSee <i>Add Article</i> for details.\r\n\r\n<b>Attachment</b>\r\nSee <i>Add Article</i> for details.\r\n','14,21');
INSERT INTO help VALUES (25,'US English','Add','Extra Column','Extra columns allow you to change the layout of your page for one page only. If you wish to have multiple columns on all your pages. Perhaps you should consider altering the <i>style</i> applied to your pages. \r\n\r\nColumns are always added from left to right. Therefore any existing content will be on the left of the new column.\r\n\r\n<b>Spacer</b>\r\nSpacer is the amount of space between your existing content and your new column. It is measured in pixels.\r\n\r\n<b>Width</b>\r\nWidth is the actual width of the new column to be added. Width is measured in pixels.\r\n\r\n<b>StyleSheet Class</b>\r\nBy default the <i>content</i> style (which is the style the body of your site should be using) that is applied to all columns. However, if you\'ve created a style specifically for columns, then feel free to modify this class.\r\n','14,21,9,18');
INSERT INTO help VALUES (26,'US English','Edit','Extra Column','<b>Spacer</b>\r\nSee <i>Add Extra Column</b> for details.\r\n\r\n<b>Width</b>\r\nSee <i>Add Extra Column</b> for details.\r\n\r\n<b>StyleSheet Class</b>\r\nSee <i>Add Extra Column</b> for details.\r\n','14,21,9,18');
INSERT INTO help VALUES (27,'US English','Add','Widget','You can add widgets by selecting from the <i>Add Content</i> pulldown menu.','0');
INSERT INTO help VALUES (28,'US English','Add','Poll','Polls can be used to get the impressions of your users on various topics.\r\n\r\n<b>Title</b>\r\nThe title of the poll. Even if you don\'t wish to display the title you should fill out this field so this poll will have a name if it is ever placed in the clipboard.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to disply the title?\r\n\r\n<b>Description</b>\r\nYou may provide a description for this poll, or give the user some background information.\r\n\r\n<b>Active</b>\r\nIf this box is checked, then users will be able to vote. Otherwise they\'ll only be able to see the results of the poll.\r\n\r\n<b>Who can vote?</b>\r\nChoose a group that can vote on this poll.\r\n\r\n<b>Graph Width</b>\r\nThe width of the poll results graph. The width is measured in pixels.\r\n\r\n<b>Question</b>\r\nWhat is the question you\'d like to ask your users?\r\n\r\n<b>Answers</b>\r\nEnter the possible answers to your question. Enter only one answer per line. Polls are only capable of 20 possible answers.\r\n','14,21,19');
INSERT INTO help VALUES (29,'US English','Edit','Poll','<b>Title</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Active</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Who can vote?</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Graph Width</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Question</b>\r\nSee <i>Add Poll</i> for details.\r\n\r\n<b>Answers</b>\r\nSee <i>Add Poll</i> for details.\r\n','14,21,19');
INSERT INTO help VALUES (30,'US English','Add','Site Map','Site maps are used to provide additional navigation in WebGUI. You could set up a traditional site map that would display a hierarchical view of all the pages in the site. On the other hand, you could use site maps to provide extra navigation at certain levels in your site.\r\n\r\n<b>Title</b>\r\nWhat title would you give to this site map? You should fill this field out even if you don\'t wish it to be displayed.\r\n\r\n<b>Display Title</b>\r\nShould the title be displayed?\r\n\r\n<b>Description</b>\r\nEnter a description as to why this site map is here and what purpose it serves.\r\n\r\n<b>Starting from this level?</b>\r\nIf the site map should display the page tree starting from this level, then check this box. If you wish the site map to start from the home page then uncheck it.\r\n\r\n<b>Show only one level?</b>\r\nShould the site map display only the current level of pages or all pages from this point forward? \r\n','14,21,19');
INSERT INTO help VALUES (31,'US English','Edit','Site Map','<b>Title</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Display Title</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Starting from this level?</b>\r\nSee <i>Add Site Map</i> for details.\r\n\r\n<b>Show only one level?</b>\r\nSee <i>Add Site Map</i> for details.\r\n','14,21,19');
INSERT INTO help VALUES (32,'US English','Add','Message Board','Message boards, also called Forums and/or Discussions, are a great way to add community to any site or intranets. Many companies use message boards internally to collaborate on projects.\r\n\r\n<b>Title</b>\r\nThe name of this board.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title?\r\n\r\n<b>Description</b>\r\nBriefly describe what should be displayed on this message board.\r\n\r\n<b>Who can post?</b>\r\nWhat group can post to this message board?\r\n\r\n<b>Messages Per Page</b>\r\nWhen a visitor first comes to a message board s/he will be presented with a listing of all the topics (aka threads) of the message board. If a board is popular, it will quickly have many topics. The messages per page attribute allows you to specify how many topics should be shown on one page.\r\n\r\n<b>Edit Timeout</b>\r\nHow long after a user has posted to the board will their message be available for them to edit. This timeout is measured in hours.\r\n\r\n<i>Note:</i> Don\'t set this limit too high. One of the great things about message boards is that they are an accurate record of a discussion. If you allow editing for a long time, then a user has a chance to go back and change his/her mind a long time after the original statement was made.\r\n','14,21,19');
INSERT INTO help VALUES (33,'US English','Edit','Message Board','<b>Title</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Who can post?</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Messages Per Page</b>\r\nSee <i>Add Message Board</i> for details.\r\n\r\n<b>Edit Timeout</b>\r\nSee <i>Add Message Board</i> for details.\r\n','14,21,19');
INSERT INTO help VALUES (34,'US English','Add','Link List','Link lists are just what they sound like, a list of links. Many sites have a links section, and this just automates the process.\r\n\r\n<b>Title</b>\r\nWhat is the title of this link list?\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title of this list?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process macros on the contents of this link list? Turning this off will increase performance slightly on busy sites.\r\n\r\n<b>Description</b>\r\nDescribe the purpose of the links in this list.','14,21,19');
INSERT INTO help VALUES (35,'US English','Edit','Link List','<b>Title</b>\r\nSee <i>Add Link List</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Link List</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add Link List</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Link List</i> for details.\r\n\r\n<b>Adding / Editing Links</b>\r\nYou\'ll notice at the bottom of the Edit screen that there are some options to add, edit, delete and reorder the links in your link lists. This process works exactly as the process for doing the same with widgets and pages. The three properties of links are <i>name</i>, <i>url</i>, and <i>description</i>.\r\n','14,21,19');
INSERT INTO help VALUES (36,'US English','Add','Syndicated Content','Syndicated content is content that is pulled from another site using the RDF/RSS specification. This technology is often used to pull headlines from various news sites like <a href=\"http://www.cnn.com\">CNN</a> and <a href=\"http://slashdot.org\">Slashdot</a>. It can, of course, be used for other things like sports scores, stock market info, etc.\r\n\r\nYou can find a list of syndicated content at <a href=\"http://my.userland.com\">http://my.userland.com</a>. You will need to register with an account to browse their listing of content. Also, the list contained there is by no means a complete list of all the syndicated content on the internet.\r\n\r\n<b>Title</b>\r\nWhat is the title for this content? This is often the title of the site that the content comes from.\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title?\r\n\r\n<b>Description</b>\r\nBriefly describe the content being pulled so that your users will know what they are seeing.\r\n\r\n<b>URL to RSS file</b>\r\nProvide the exact URL (starting with http://) to the syndicated content\'s RDF or RSS file. The syndicated content will be downloaded from this URL hourly.','14,21');
INSERT INTO help VALUES (37,'US English','Edit','Syndicated Content','<b>Title</b>\r\nSee <i>Add Syndicated Content</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Syndicated Content</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Syndicated Content</i> for details.\r\n\r\n<b>URL to RSS file</b>\r\nSee <i>Add Syndicated Content</i> for details.\r\n','14,21');
INSERT INTO help VALUES (38,'US English','Add','Events Calendar','Events calendars are used on many intranets to keep track of internal dates that affect a whole organization. Also events calendars on consumer sites are a great way to let your customers know what events you\'ll be attending and what promotions you\'ll be having.\r\n\r\n<b>Title</b>\r\nWhat is the title of this events calendar?\r\n\r\n<b>Display the title?</b>\r\nDo you want the title to be displayed?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process WebGUI macros in the content of the events calendar? Turning this off can increase performance on busy sites.\r\n\r\n<b>Description</b>\r\nBriefly describe what this events calendar details.\r\n','14,21,19');
INSERT INTO help VALUES (39,'US English','Edit','Events Calendar','<b>Title</b>\r\nSee <i>Add Events Calendar</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Events Calendar</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add Events Calendar</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Events Calendar</i> for details.\r\n\r\n<b>Add / Edit Events</b>\r\nOn the edit screen you\'ll notice that there are options to add, edit, and delete the events in your events calendar. The properties for events are <i>name</i>, <i>description</i>, <i>start date</i>, and <i>end date</i>.\r\n\r\n<i>Note:</i> Events that have already happened will not be displayed on the events calendar.','14,21,19');
INSERT INTO help VALUES (40,'US English','Add','F.A.Q.','It seems that almost every web site, intranet, and extranet in the world has a frequently asked questions area. This widget helps you build one too.\r\n\r\n<b>Title</b>\r\nWhat is the title for this FAQ section?\r\n\r\n<b>Display the title?</b>\r\nDo you wish to display the title?\r\n\r\n<b>Process macros?</b>\r\nDo you wish to process macros contained in the FAQ content? Turning this off will increase performance on busy sites.\r\n\r\n<b>Description</b>\r\nBriefly describe what this FAQ covers.\r\n','14,21,19');
INSERT INTO help VALUES (41,'US English','Edit','F.A.Q.','<b>Title</b>\r\nSee <i>Add F.A.Q.</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add F.A.Q.</i> for details.\r\n\r\n<b>Process macros?</b>\r\nSee <i>Add F.A.Q.</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add F.A.Q.</i> for details.\r\n\r\n<b>Add / Edit Questions</b>\r\nOn the edit screen you\'ll notice options for adding, editing, deleting, and reordering the questions in your FAQ. The two properties of FAQ questions are <i>question</i> and <i>answer</i>.\r\n\r\n','14,21,19');
INSERT INTO help VALUES (42,'US English','Add','Search (MnoGo)','The <a href=\"http://www.mnogosearch.org\">Mno Go Search engine</a> is one of the most popular and powerful open-source search engines on the market. It is so good that we figured that there was no reason to reinvent the wheel so we incorperated it into WebGUI.\r\n\r\n<b>Title</b>\r\nWhat is the title of this search?\r\n\r\n<b>Display the title?</b>\r\nDo you want to display the title?\r\n\r\n<b>Description</b>\r\nBriefly describe what is available through this search engine.\r\n\r\n<b>DSN</b>\r\n<b>D</b>ata <b>S</b>ource <b>N</b>ame is the unique identifier that Perl uses to describe the location of your database. It takes the format of DBI:[driver]:[database name]:[host]. This DSN needs to point to where your Mno Go Indexer stored the spider results. If you are uncertain how to set up the Mno Go Search Engine and Indexer <a href=\"http://www.plainblack.com\">Plain Black Software</a> provides support and training services.\r\n\r\n<i>Example:</i> DBI:mysql:WebGUI:localhost\r\n\r\n<b>Database User</b>\r\nThe username you use to connect to the DSN.\r\n\r\n<b>Database Password</b>\r\nThe password you use to connect to the DSN.\r\n','14,21');
INSERT INTO help VALUES (43,'US English','Edit','Search (MnoGo)','<b>Title</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>DSN</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>Database User</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n\r\n<b>Database Password</b>\r\nSee <i>Add Search (MnoGo)</i> for details.\r\n','14,21');
INSERT INTO help VALUES (44,'US English','Add','User Submission System','User submission systems are a great way to add a sense of community to any site as well as get free content from your users.\r\n\r\n<b>Title</b>\r\nWhat is the title for this user submission system?\r\n\r\n<b>Display the title?</b>\r\nWould you like the title displayed?\r\n\r\n<b>Description</b>\r\nBriefly describe why this user submission system is here and what should be submitted to it.\r\n\r\n<b>Who can contribute?</b>\r\nWhat group is allowed to contribute content?\r\n\r\n<b>Submissions Per Page</b>\r\nHow many submissions should be listed per page in the submissions index?\r\n\r\n<b>Default Status</b>\r\nShould submissions be set to <i>approved</i>, <i>pending</i>, or <i>denied</i> by default?\r\n\r\n<i>Note:</i> If you set the default status to pending, then be prepared to monitor the pending queue under the Admin menu.\r\n','14,21');
INSERT INTO help VALUES (45,'US English','Edit','User Submission System','<b>Title</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Display the title?</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Description</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Who can contribute?</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Submissions Per Page</b>\r\nSee <i>Add User Submission System</i> for details.\r\n\r\n<b>Default Status</b>\r\nSee <i>Add User Submission System</i> for details.\r\n','14,21');
INSERT INTO help VALUES (46,'US English','Empty','Trash','If you choose to empty your trash, any items contained in it will be lost forever. If you\'re unsure about a few items, it might be best to cut them to your clipboard before you empty the trash.','0');
delete from page where pageId=4;
INSERT INTO page VALUES (4,0,'Page Not Found',3,1,1,1,1,1,0,1,0,1,NULL,'page_not_found');
INSERT INTO settings VALUES ('anonymousRegistration','yes');
INSERT INTO settings VALUES ('notFoundPage','1');
INSERT INTO widget 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 <a href=\"^/\">Home Page</a>.',1,1001744792,3,1001744968,3);
alter table session add column userId int;
delete from session;

View file

View file

@ -0,0 +1,2 @@
alter table event add column recurringEventId int not null;
INSERT INTO incrementer VALUES ('recurringEventId',1);

View file

@ -0,0 +1,323 @@
alter table users add column icq_temp varchar(30);
update users set icq_temp=icq;
alter table users drop icq;
alter table users change icq_temp icq varchar(30);
alter table users add column language varchar(30) not null default 'English' after connectDN;
alter table Article change body body mediumtext;
INSERT INTO settings VALUES ('recoverPasswordEmail','Someone (probably you) requested your account information be sent. Your password has been reset. The following represents your new account information:');
CREATE TABLE international (
internationalId int(11) NOT NULL default '0',
language varchar(30) NOT NULL default 'English',
message text,
PRIMARY KEY (internationalId,language)
) TYPE=MyISAM;
INSERT INTO international VALUES (1,'English','Add content...');
INSERT INTO international VALUES (2,'English','Page');
INSERT INTO international VALUES (3,'English','Paste from clipboard...');
INSERT INTO international VALUES (4,'English','Manage settings.');
INSERT INTO international VALUES (5,'English','Manage groups.');
INSERT INTO international VALUES (6,'English','Manage styles.');
INSERT INTO international VALUES (7,'English','Manage users.');
INSERT INTO international VALUES (8,'English','View page not found.');
INSERT INTO international VALUES (9,'English','View clipboard.');
INSERT INTO international VALUES (10,'English','View trash.');
INSERT INTO international VALUES (11,'English','Empy trash.');
INSERT INTO international VALUES (12,'English','Turn admin off.');
INSERT INTO international VALUES (13,'English','View help index.');
INSERT INTO international VALUES (14,'English','View pending submissions.');
INSERT INTO international VALUES (15,'English','January');
INSERT INTO international VALUES (16,'English','February');
INSERT INTO international VALUES (17,'English','March');
INSERT INTO international VALUES (18,'English','April');
INSERT INTO international VALUES (19,'English','May');
INSERT INTO international VALUES (20,'English','June');
INSERT INTO international VALUES (21,'English','July');
INSERT INTO international VALUES (22,'English','August');
INSERT INTO international VALUES (23,'English','September');
INSERT INTO international VALUES (24,'English','October');
INSERT INTO international VALUES (25,'English','November');
INSERT INTO international VALUES (26,'English','December');
INSERT INTO international VALUES (27,'English','Sunday');
INSERT INTO international VALUES (28,'English','Monday');
INSERT INTO international VALUES (29,'English','Tuesday');
INSERT INTO international VALUES (30,'English','Wednesday');
INSERT INTO international VALUES (31,'English','Thursday');
INSERT INTO international VALUES (32,'English','Friday');
INSERT INTO international VALUES (33,'English','Saturday');
INSERT INTO international VALUES (34,'English','set date');
INSERT INTO international VALUES (35,'English','Administrative Function');
INSERT INTO international VALUES (36,'English','You must be an administrator to perform this function. Please contact one of your administrators. The following is a list of the administrators for this system:');
INSERT INTO international VALUES (37,'English','Permission Denied!');
INSERT INTO international VALUES (38,'English','You do not have sufficient privileges to perform this operation. Please <a href=\"^\\?op=displayLogin\">log in with an account</a> that has sufficient privileges before attempting this operation.');
INSERT INTO international VALUES (39,'English','You do not have sufficient privileges to access this page.');
INSERT INTO international VALUES (41,'English','You\'re attempting to remove a vital component of the WebGUI system. If you were allowed to continue WebGUI may cease to function.');
INSERT INTO international VALUES (40,'English','Vital Component');
INSERT INTO international VALUES (42,'English','Please Confirm');
INSERT INTO international VALUES (43,'English','Are you certain that you wish to delete this content?');
INSERT INTO international VALUES (44,'English','Yes, I\'m sure.');
INSERT INTO international VALUES (45,'English','No, I made a mistake.');
INSERT INTO international VALUES (46,'English','My Account');
INSERT INTO international VALUES (47,'English','Home');
INSERT INTO international VALUES (48,'English','Hello');
INSERT INTO international VALUES (49,'English','Click <a href=\"^\\?op=logout\">here</a> to log out.');
INSERT INTO international VALUES (50,'English','Username');
INSERT INTO international VALUES (51,'English','Password');
INSERT INTO international VALUES (52,'English','login');
INSERT INTO international VALUES (53,'English','Make Page Printable');
INSERT INTO international VALUES (54,'English','Create Account');
INSERT INTO international VALUES (55,'English','Password (confirm)');
INSERT INTO international VALUES (56,'English','Email Address');
INSERT INTO international VALUES (57,'English','This is only necessary if you wish to use features that require Email.');
INSERT INTO international VALUES (58,'English','I already have an account.');
INSERT INTO international VALUES (59,'English','I forgot my password.');
INSERT INTO international VALUES (60,'English','Are you certain you want to deactivate your account. If you proceed your account information will be lost permanently.');
INSERT INTO international VALUES (61,'English','Update Account Information');
INSERT INTO international VALUES (62,'English','save');
INSERT INTO international VALUES (63,'English','Turn admin on.');
INSERT INTO international VALUES (64,'English','Log out.');
INSERT INTO international VALUES (65,'English','Please deactivate my account permanently.');
INSERT INTO international VALUES (66,'English','Log In');
INSERT INTO international VALUES (67,'English','Create a new account.');
INSERT INTO international VALUES (68,'English','The account information you supplied is invalid. Either the account does not exist or the username/password combination was incorrect.');
INSERT INTO international VALUES (69,'English','Please contact your system administrator for assistance.');
INSERT INTO international VALUES (70,'English','Error');
INSERT INTO international VALUES (71,'English','Recover password');
INSERT INTO international VALUES (72,'English','recover');
INSERT INTO international VALUES (73,'English','Log in.');
INSERT INTO international VALUES (74,'English','Account Information');
INSERT INTO international VALUES (75,'English','Your account information has been sent to your email address.');
INSERT INTO international VALUES (76,'English','That email address is not in our databases.');
INSERT INTO international VALUES (77,'English','That account name is already in use by another member of this site. Please try a different username. The following are some suggestions:');
INSERT INTO international VALUES (78,'English','Your passwords did not match. Please try again.');
INSERT INTO international VALUES (79,'English','Cannot connect to LDAP server.');
INSERT INTO international VALUES (80,'English','Account created successfully!');
INSERT INTO international VALUES (81,'English','Account updated successfully!');
INSERT INTO international VALUES (82,'English','Administrative functions...');
INSERT INTO international VALUES (83,'English','Add Group');
INSERT INTO international VALUES (84,'English','Group Name');
INSERT INTO international VALUES (85,'English','Description');
INSERT INTO international VALUES (86,'English','Are you certain you wish to delete this group? Beware that deleting a group is permanent and will remove all privileges associated with this group.');
INSERT INTO international VALUES (87,'English','Edit Group');
INSERT INTO international VALUES (88,'English','Users In Group');
INSERT INTO international VALUES (89,'English','Groups');
INSERT INTO international VALUES (90,'English','Add new group.');
INSERT INTO international VALUES (91,'English','Previous Page');
INSERT INTO international VALUES (92,'English','Next Page');
INSERT INTO international VALUES (93,'English','Help');
INSERT INTO international VALUES (94,'English','See also');
INSERT INTO international VALUES (95,'English','Help Index');
INSERT INTO international VALUES (96,'English','Sorted By Action');
INSERT INTO international VALUES (97,'English','Sorted by Object');
INSERT INTO international VALUES (98,'English','Add Page');
INSERT INTO international VALUES (99,'English','Title');
INSERT INTO international VALUES (100,'English','Meta Tags');
INSERT INTO international VALUES (101,'English','Are you certain that you wish to delete this page, its content, and all items under it?');
INSERT INTO international VALUES (102,'English','Edit Page');
INSERT INTO international VALUES (103,'English','Page Specifics');
INSERT INTO international VALUES (104,'English','Page URL');
INSERT INTO international VALUES (105,'English','Style');
INSERT INTO international VALUES (106,'English','Check to give this style to all sub-pages.');
INSERT INTO international VALUES (107,'English','Privileges');
INSERT INTO international VALUES (108,'English','Owner');
INSERT INTO international VALUES (109,'English','Owner can view?');
INSERT INTO international VALUES (110,'English','Owner can edit?');
INSERT INTO international VALUES (111,'English','Group');
INSERT INTO international VALUES (112,'English','Group can view?');
INSERT INTO international VALUES (113,'English','Group can edit?');
INSERT INTO international VALUES (114,'English','Anybody can view?');
INSERT INTO international VALUES (115,'English','Anybody can edit?');
INSERT INTO international VALUES (116,'English','Check to give these privileges to all sub-pages.');
INSERT INTO international VALUES (117,'English','Edit Authentication Settings');
INSERT INTO international VALUES (118,'English','Anonymous Registration');
INSERT INTO international VALUES (119,'English','Authentication Method (default)');
INSERT INTO international VALUES (120,'English','LDAP URL (default)');
INSERT INTO international VALUES (121,'English','LDAP Identity (default)');
INSERT INTO international VALUES (122,'English','LDAP Identity Name');
INSERT INTO international VALUES (123,'English','LDAP Password Name');
INSERT INTO international VALUES (124,'English','Edit Company Information');
INSERT INTO international VALUES (125,'English','Company Name');
INSERT INTO international VALUES (126,'English','Company Email Address');
INSERT INTO international VALUES (127,'English','Company URL');
INSERT INTO international VALUES (128,'English','Edit File Settings');
INSERT INTO international VALUES (129,'English','Path to WebGUI Extras');
INSERT INTO international VALUES (130,'English','Maximum Attachment Size');
INSERT INTO international VALUES (131,'English','Web Attachment Path');
INSERT INTO international VALUES (132,'English','Server Attachment Path');
INSERT INTO international VALUES (133,'English','Edit Mail Settings');
INSERT INTO international VALUES (134,'English','Recover Password Message');
INSERT INTO international VALUES (135,'English','SMTP Server');
INSERT INTO international VALUES (136,'English','Home Page');
INSERT INTO international VALUES (137,'English','Page Not Found Page');
INSERT INTO international VALUES (138,'English','Yes');
INSERT INTO international VALUES (139,'English','No');
INSERT INTO international VALUES (140,'English','Edit Miscellaneous Settings');
INSERT INTO international VALUES (141,'English','Not Found Page');
INSERT INTO international VALUES (142,'English','Session Timeout');
INSERT INTO international VALUES (143,'English','Manage Settings');
INSERT INTO international VALUES (144,'English','View Statistics');
INSERT INTO international VALUES (145,'English','WebGUI Build Version');
INSERT INTO international VALUES (146,'English','Active Sessions');
INSERT INTO international VALUES (147,'English','Viewable Pages');
INSERT INTO international VALUES (148,'English','Viewable Widgets');
INSERT INTO international VALUES (149,'English','Users');
INSERT INTO international VALUES (150,'English','Add Style');
INSERT INTO international VALUES (151,'English','Style Name');
INSERT INTO international VALUES (152,'English','Header');
INSERT INTO international VALUES (153,'English','Footer');
INSERT INTO international VALUES (154,'English','Style Sheet');
INSERT INTO international VALUES (155,'English','Are you certain you wish to delete this style and migrate all pages using this style to the \"Fail Safe\" style?');
INSERT INTO international VALUES (156,'English','Edit Style');
INSERT INTO international VALUES (157,'English','Styles');
INSERT INTO international VALUES (158,'English','Add a new style.');
INSERT INTO international VALUES (159,'English','Pending Submissions');
INSERT INTO international VALUES (160,'English','Date Submitted');
INSERT INTO international VALUES (161,'English','Submitted By');
INSERT INTO international VALUES (162,'English','Are you certain that you wish to purge all the pages and widgets in the trash?');
INSERT INTO international VALUES (163,'English','Add User');
INSERT INTO international VALUES (164,'English','Authentication Method');
INSERT INTO international VALUES (165,'English','LDAP URL');
INSERT INTO international VALUES (166,'English','Connect DN');
INSERT INTO international VALUES (167,'English','Are you certain you want to delete this user? Be warned that all this user\'s information will be lost permanently if you choose to proceed.');
INSERT INTO international VALUES (168,'English','Edit User');
INSERT INTO international VALUES (169,'English','Add a new user.');
INSERT INTO international VALUES (170,'English','search');
INSERT INTO international VALUES (171,'English','rich edit');
INSERT INTO international VALUES (172,'English','Article');
INSERT INTO international VALUES (173,'English','Add Article');
INSERT INTO international VALUES (174,'English','Display the title?');
INSERT INTO international VALUES (175,'English','Process macros?');
INSERT INTO international VALUES (176,'English','Start Date');
INSERT INTO international VALUES (177,'English','End Date');
INSERT INTO international VALUES (178,'English','Body');
INSERT INTO international VALUES (179,'English','Image');
INSERT INTO international VALUES (180,'English','Link Title');
INSERT INTO international VALUES (181,'English','Link URL');
INSERT INTO international VALUES (182,'English','Attachment');
INSERT INTO international VALUES (183,'English','Convert carriage returns?');
INSERT INTO international VALUES (184,'English','(Check if you aren\'t adding &lt;br&gt; manually.)');
INSERT INTO international VALUES (185,'English','Edit Article');
INSERT INTO international VALUES (186,'English','Delete');
INSERT INTO international VALUES (187,'English','Events Calendar');
INSERT INTO international VALUES (188,'English','Add Events Calendar');
INSERT INTO international VALUES (189,'English','Happens only once.');
INSERT INTO international VALUES (190,'English','Day');
INSERT INTO international VALUES (191,'English','Week');
INSERT INTO international VALUES (192,'English','Add Event');
INSERT INTO international VALUES (193,'English','Recurs every');
INSERT INTO international VALUES (194,'English','until');
INSERT INTO international VALUES (195,'English','Are you certain that you want to delete this event');
INSERT INTO international VALUES (197,'English','Edit Events Calendar');
INSERT INTO international VALUES (196,'English','<b>and</b> all of its recurring events');
INSERT INTO international VALUES (198,'English','Edit Event');
INSERT INTO international VALUES (199,'English','Extra Column');
INSERT INTO international VALUES (200,'English','Add Extra Column');
INSERT INTO international VALUES (201,'English','Spacer');
INSERT INTO international VALUES (202,'English','Width');
INSERT INTO international VALUES (203,'English','StyleSheet Class');
INSERT INTO international VALUES (204,'English','Edit Extra Column');
INSERT INTO international VALUES (205,'English','F.A.Q.');
INSERT INTO international VALUES (206,'English','Add F.A.Q.');
INSERT INTO international VALUES (207,'English','Add Question');
INSERT INTO international VALUES (208,'English','Question');
INSERT INTO international VALUES (209,'English','Answer');
INSERT INTO international VALUES (211,'English','Edit F.A.Q.');
INSERT INTO international VALUES (210,'English','Are you certain that you want to delete this question?');
INSERT INTO international VALUES (212,'English','Add a new question.');
INSERT INTO international VALUES (213,'English','Edit Question');
INSERT INTO international VALUES (214,'English','Link List');
INSERT INTO international VALUES (215,'English','Add Link');
INSERT INTO international VALUES (216,'English','URL');
INSERT INTO international VALUES (217,'English','Are you certain that you want to delete this link?');
INSERT INTO international VALUES (218,'English','Edit Link List');
INSERT INTO international VALUES (219,'English','Add Link List');
INSERT INTO international VALUES (220,'English','Edit Link');
INSERT INTO international VALUES (221,'English','Add a new link.');
INSERT INTO international VALUES (222,'English','Add Message Board');
INSERT INTO international VALUES (223,'English','Message Board');
INSERT INTO international VALUES (224,'English','Who can post?');
INSERT INTO international VALUES (225,'English','Messages Per Page');
INSERT INTO international VALUES (226,'English','Edit Timeout');
INSERT INTO international VALUES (227,'English','Edit Message Board');
INSERT INTO international VALUES (228,'English','Editing Message...');
INSERT INTO international VALUES (229,'English','Subject');
INSERT INTO international VALUES (230,'English','Message');
INSERT INTO international VALUES (231,'English','Posting New Message...');
INSERT INTO international VALUES (232,'English','no subject');
INSERT INTO international VALUES (233,'English','(eom)');
INSERT INTO international VALUES (234,'English','Posting Reply...');
INSERT INTO international VALUES (235,'English','Edit Message');
INSERT INTO international VALUES (236,'English','Post Reply');
INSERT INTO international VALUES (237,'English','Subject:');
INSERT INTO international VALUES (238,'English','Author:');
INSERT INTO international VALUES (239,'English','Date:');
INSERT INTO international VALUES (240,'English','Message ID:');
INSERT INTO international VALUES (241,'English','Previous Thread');
INSERT INTO international VALUES (242,'English','Back To Message List');
INSERT INTO international VALUES (243,'English','Next Thread');
INSERT INTO international VALUES (244,'English','Author');
INSERT INTO international VALUES (245,'English','Date');
INSERT INTO international VALUES (246,'English','Post New Message');
INSERT INTO international VALUES (247,'English','Thread Started');
INSERT INTO international VALUES (248,'English','Replies');
INSERT INTO international VALUES (249,'English','Last Reply');
INSERT INTO international VALUES (250,'English','Poll');
INSERT INTO international VALUES (251,'English','Add Poll');
INSERT INTO international VALUES (252,'English','Active');
INSERT INTO international VALUES (253,'English','Who can vote?');
INSERT INTO international VALUES (254,'English','Graph Width');
INSERT INTO international VALUES (255,'English','Question');
INSERT INTO international VALUES (256,'English','Answers');
INSERT INTO international VALUES (257,'English','(Enter one answer per line. No more than 20.)');
INSERT INTO international VALUES (258,'English','Edit Poll');
INSERT INTO international VALUES (259,'English','SQL Report');
INSERT INTO international VALUES (260,'English','Add SQL Report');
INSERT INTO international VALUES (261,'English','Template');
INSERT INTO international VALUES (262,'English','Query');
INSERT INTO international VALUES (263,'English','DSN');
INSERT INTO international VALUES (264,'English','Database User');
INSERT INTO international VALUES (265,'English','Database Password');
INSERT INTO international VALUES (266,'English','Edit SQL Report');
INSERT INTO international VALUES (267,'English','Error: The DSN specified is of an improper format.');
INSERT INTO international VALUES (268,'English','Error: The SQL specified is of an improper format.');
INSERT INTO international VALUES (269,'English','Error: There was a problem with the query.');
INSERT INTO international VALUES (270,'English','Error: Could not connect to the database.');
INSERT INTO international VALUES (271,'English','Syndicated Content');
INSERT INTO international VALUES (272,'English','Add Syndicated Content');
INSERT INTO international VALUES (273,'English','URL to RSS File');
INSERT INTO international VALUES (274,'English','Edit Syndicated Content');
INSERT INTO international VALUES (275,'English','Last Fetched');
INSERT INTO international VALUES (276,'English','Current Content');
INSERT INTO international VALUES (277,'English','User Submission System');
INSERT INTO international VALUES (278,'English','Add User Submission System');
INSERT INTO international VALUES (279,'English','Who can contribute?');
INSERT INTO international VALUES (280,'English','Submissions Per Page');
INSERT INTO international VALUES (281,'English','Approved');
INSERT INTO international VALUES (282,'English','Denied');
INSERT INTO international VALUES (283,'English','Pending');
INSERT INTO international VALUES (284,'English','Default Status');
INSERT INTO international VALUES (285,'English','Add Submission');
INSERT INTO international VALUES (286,'English','(Uncheck if you\'re writing an HTML submission.)');
INSERT INTO international VALUES (287,'English','Date Submitted');
INSERT INTO international VALUES (288,'English','Status');
INSERT INTO international VALUES (289,'English','Edit/Delete');
INSERT INTO international VALUES (290,'English','Untitiled');
INSERT INTO international VALUES (291,'English','Are you certain you wish to delete this submission?');
INSERT INTO international VALUES (292,'English','Edit User Submission System');
INSERT INTO international VALUES (293,'English','Edit Submission');
INSERT INTO international VALUES (294,'English','Post New Submission');
INSERT INTO international VALUES (295,'English','Date Submitted');
INSERT INTO international VALUES (296,'English','Submitted By');
INSERT INTO international VALUES (297,'English','Submitted By:');
INSERT INTO international VALUES (298,'English','Date Submitted:');
INSERT INTO international VALUES (299,'English','Approve');
INSERT INTO international VALUES (300,'English','Leave Pending');
INSERT INTO international VALUES (301,'English','Deny');
INSERT INTO international VALUES (302,'English','Edit');
INSERT INTO international VALUES (303,'English','Return To Submissions List');
INSERT INTO international VALUES (304,'English','Language');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,41 @@
INSERT INTO international VALUES (348,'WebGUI','English','Name');
INSERT INTO international VALUES (308,'WebGUI','Deutsch','Profil bearbeiten');
INSERT INTO international VALUES (309,'WebGUI','Deutsch','Name anzeigen?');
INSERT INTO international VALUES (310,'WebGUI','Deutsch','Kontaktinformationen anzeigen?');
INSERT INTO international VALUES (311,'WebGUI','Deutsch','Privatadresse anzeigen?');
INSERT INTO international VALUES (312,'WebGUI','Deutsch','Geschäftsadresse anzeigen?');
INSERT INTO international VALUES (313,'WebGUI','Deutsch','Zusätzliche Informationen anzeigen?');
INSERT INTO international VALUES (314,'WebGUI','Deutsch','Vorname');
INSERT INTO international VALUES (315,'WebGUI','Deutsch','Zweiter Vorname');
INSERT INTO international VALUES (316,'WebGUI','Deutsch','Nachname');
INSERT INTO international VALUES (317,'WebGUI','Deutsch','<a href=\"\"http://www.icq.com\"\">ICQ</a> UIN');
INSERT INTO international VALUES (318,'WebGUI','Deutsch','<a href=\"\"http://www.aol.com/aim/homenew.adp\"\">AIM</a> Id');
INSERT INTO international VALUES (319,'WebGUI','Deutsch','<a href=\"\"http://messenger.msn.com/\"\">MSN Messenger</a> Id');
INSERT INTO international VALUES (320,'WebGUI','Deutsch','<a href=\"\"http://messenger.yahoo.com/\"\">Yahoo! Messenger</a> Id');
INSERT INTO international VALUES (321,'WebGUI','Deutsch','Mobiltelefon');
INSERT INTO international VALUES (322,'WebGUI','Deutsch','Pager');
INSERT INTO international VALUES (323,'WebGUI','Deutsch','Strasse (privat)');
INSERT INTO international VALUES (324,'WebGUI','Deutsch','Ort (privat)');
INSERT INTO international VALUES (325,'WebGUI','Deutsch','Bundesland (privat)');
INSERT INTO international VALUES (326,'WebGUI','Deutsch','Postleitzahl (privat)');
INSERT INTO international VALUES (327,'WebGUI','Deutsch','Land (privat)');
INSERT INTO international VALUES (328,'WebGUI','Deutsch','Telefon (privat)');
INSERT INTO international VALUES (329,'WebGUI','Deutsch','Strasse (Büro)');
INSERT INTO international VALUES (330,'WebGUI','Deutsch','Ort (Büro)');
INSERT INTO international VALUES (331,'WebGUI','Deutsch','Bundesland (Büro)');
INSERT INTO international VALUES (332,'WebGUI','Deutsch','Postleitzahl (Büro)');
INSERT INTO international VALUES (333,'WebGUI','Deutsch','Land (Büro)');
INSERT INTO international VALUES (334,'WebGUI','Deutsch','Telefon (Büro)');
INSERT INTO international VALUES (335,'WebGUI','Deutsch','Geschlecht');
INSERT INTO international VALUES (336,'WebGUI','Deutsch','Geburtstag');
INSERT INTO international VALUES (337,'WebGUI','Deutsch','Homepage URL');
INSERT INTO international VALUES (338,'WebGUI','Deutsch','Profil bearbeiten');
INSERT INTO international VALUES (339,'WebGUI','Deutsch','männlich');
INSERT INTO international VALUES (340,'WebGUI','Deutsch','weiblich');
INSERT INTO international VALUES (341,'WebGUI','Deutsch','Profil bearbeiten.');
INSERT INTO international VALUES (342,'WebGUI','Deutsch','Benutzerkonto bearbeiten.');
INSERT INTO international VALUES (343,'WebGUI','Deutsch','Profil anschauen.');
INSERT INTO international VALUES (345,'WebGUI','Deutsch','Kein Mitglied');
INSERT INTO international VALUES (346,'WebGUI','Deutsch','Dieser Benutzer ist kein Mitglied. Wir haben keine weiteren Informationen über ihn.');
INSERT INTO international VALUES (347,'WebGUI','Deutsch','Profil anschauen von');

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
package WebGUI;
our $VERSION = "2.6.0";
our $VERSION = "2.7.0";
#-------------------------------------------------------------------
# WebGUI is Copyright 2001 Plain Black Software.
@ -34,6 +34,7 @@ sub _displayAdminBar {
@widgetArray = @_;
$hash{$session{page}{url}} = WebGUI::International::get(1);
$hash{$session{page}{url}.'?op=addPage'} = WebGUI::International::get(2);
$hash{$session{page}{url}.'?op=selectPackageToDeploy'} = WebGUI::International::get(376);
foreach $widget (@widgetArray) {
$widgetName = "WebGUI::Widget::".$widget."::widgetName";
$hash2{$session{page}{url}.'?func=add&widget='.$widget} = &$widgetName;
@ -44,11 +45,11 @@ sub _displayAdminBar {
#--clipboard paster
%hash2 = ();
$hash2{$session{page}{url}} = WebGUI::International::get(3);
%hash = WebGUI::SQL->buildHash("select pageId,title from page where parentId=2 order by title",$session{dbh});
%hash = WebGUI::SQL->buildHash("select pageId,title from page where parentId=2 order by title");
foreach $key (keys %hash) {
$hash2{$session{page}{url}.'?op=pastePage&pageId='.$key} = $hash{$key};
}
%hash = WebGUI::SQL->buildHash("select widgetId,title from widget where pageId=2 order by title",$session{dbh});
%hash = WebGUI::SQL->buildHash("select widgetId,title from widget where pageId=2 order by title");
foreach $key (keys %hash) {
$hash2{$session{page}{url}.'?func=paste&wid='.$key} = $hash{$key};
}
@ -59,20 +60,41 @@ sub _displayAdminBar {
%hash = (
$session{page}{url}.'?op=listGroups'=>WebGUI::International::get(5),
$session{page}{url}.'?op=manageSettings'=>WebGUI::International::get(4),
$session{page}{url}.'?op=listStyles'=>WebGUI::International::get(6),
$session{page}{url}.'?op=listUsers'=>WebGUI::International::get(7),
$session{env}{SCRIPT_NAME}.'/page_not_found'=>WebGUI::International::get(8),
$session{env}{SCRIPT_NAME}.'/clipboard'=>WebGUI::International::get(9),
$session{env}{SCRIPT_NAME}.'/trash'=>WebGUI::International::get(10),
$session{page}{url}.'?op=purgeTrash'=>WebGUI::International::get(11),
$session{page}{url}.'?op=viewStatistics'=>WebGUI::International::get(144)
);
}
%hash = ( $session{page}{url}.'?'=>WebGUI::International::get(82),
$session{page}{url}.'?op=switchOffAdmin'=>WebGUI::International::get(12),
if (WebGUI::Privilege::isInGroup(4,$session{user}{userId})) {
%hash = (
$session{env}{SCRIPT_NAME}.'/clipboard'=>WebGUI::International::get(9),
%hash
);
}
if (WebGUI::Privilege::isInGroup(5,$session{user}{userId})) {
%hash = (
$session{page}{url}.'?op=listStyles'=>WebGUI::International::get(6),
%hash
);
}
if (WebGUI::Privilege::isInGroup(6,$session{user}{userId})) {
%hash = (
$session{env}{SCRIPT_NAME}.'/packages'=>WebGUI::International::get(374),
%hash
);
}
%hash = (
$session{page}{url}.'?op=viewHelpIndex'=>WebGUI::International::get(13),
%hash
);
%hash = sortHash(%hash);
%hash = (
$session{page}{url}.'?'=>WebGUI::International::get(82),
$session{page}{url}.'?op=switchOffAdmin'=>WebGUI::International::get(12),
%hash
);
$adminSelect = WebGUI::Form::selectList("adminSelect",\%hash,"","","","goAdmin()");
#--output admin bar
$output = '
@ -107,9 +129,8 @@ sub _loadWidgets {
opendir (DIR,$session{config}{webguiRoot}.$widgetDir) or WebGUI::ErrorHandler::fatalError("Can't open widget directory!");
@files = readdir(DIR);
foreach $file (@files) {
if ($file ne "." && $file ne ".." && $file =~ /\.pm/) {
$file =~ s/\.pm//;
$widget[$i] = $file;
if ($file =~ /(.*?)\.pm$/) {
$widget[$i] = $1;
$use = "use WebGUI::Widget::".$widget[$i];
eval($use);
$i++;
@ -135,7 +156,7 @@ sub page {
if (exists $session{form}{widget}) {
$widgetType = $session{form}{widget};
} else {
($widgetType) = WebGUI::SQL->quickArray("select widgetType from widget where widgetId='$session{form}{wid}'",$session{dbh});
($widgetType) = WebGUI::SQL->quickArray("select widgetType from widget where widgetId='$session{form}{wid}'");
}
$cmd = "WebGUI::Widget::".$widgetType."::www_".$session{form}{func};
$functionOutput = &$cmd();
@ -149,12 +170,12 @@ sub page {
} else {
if (WebGUI::Privilege::canViewPage()) {
if ($session{var}{adminOn}) {
$pageEdit = '<br><a href="'.$session{page}{url}.'?op=editPage"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?op=cutPage"><img src="'.$session{setting}{lib}.'/cut.gif" border=0></a><a href="'.$session{page}{url}.'?op=deletePage"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?op=movePageUp"><img src="'.$session{setting}{lib}.'/leftArrow.gif" border=0></a><a href="'.$session{page}{url}.'?op=movePageDown"><img src="'.$session{setting}{lib}.'/rightArrow.gif" border=0></a>';
$pageEdit = '<br><img src="'.$session{setting}{lib}.'/page.gif" border=0 alt="Page Settings:"><a href="'.$session{page}{url}.'?op=editPage"><img src="'.$session{setting}{lib}.'/edit.gif" border=0 alt="Edit Page"></a><a href="'.$session{page}{url}.'?op=cutPage"><img src="'.$session{setting}{lib}.'/cut.gif" border=0 alt="Cut Page"></a><a href="'.$session{page}{url}.'?op=deletePage"><img src="'.$session{setting}{lib}.'/delete.gif" border=0 alt="Delete Page"></a><a href="'.$session{page}{url}.'?op=movePageUp"><img src="'.$session{setting}{lib}.'/pageUp.gif" border=0 alt="Move Page Up"></a><a href="'.$session{page}{url}.'?op=movePageDown"><img src="'.$session{setting}{lib}.'/pageDown.gif" border=0 alt="Move Page Down"></a></span>';
}
$sth = WebGUI::SQL->read("select widgetId, widgetType, position from widget where pageId=".$session{page}{pageId}." order by sequenceNumber, widgetId",$session{dbh});
$sth = WebGUI::SQL->read("select widgetId, widgetType, position from widget where pageId=".$session{page}{pageId}." order by sequenceNumber, widgetId");
while (@widgetList = $sth->array) {
if ($session{var}{adminOn}) {
$contentHash{$widgetList[2]} .= '<hr><a href="'.$session{page}{url}.'?func=edit&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?func=cut&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/cut.gif" border=0></a><a href="'.$session{page}{url}.'?wid='.$widgetList[0].'&func=delete"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveUp&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/upArrow.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveDown&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/downArrow.gif" border=0></a><a href="'.$session{page}{url}.'?func=jumpUp&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/jumpUp.gif" border=0></a><a href="'.$session{page}{url}.'?func=jumpDown&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/jumpDown.gif" border=0></a><br>';
$contentHash{$widgetList[2]} .= '<hr><a href="'.$session{page}{url}.'?func=edit&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0 alt="Edit"></a><a href="'.$session{page}{url}.'?func=cut&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/cut.gif" border=0 alt="Cut"></a><a href="'.$session{page}{url}.'?func=copy&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/copy.gif" border=0 alt="Copy"></a><a href="'.$session{page}{url}.'?wid='.$widgetList[0].'&func=delete"><img src="'.$session{setting}{lib}.'/delete.gif" border=0 alt="Delete"></a><a href="'.$session{page}{url}.'?func=moveUp&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/upArrow.gif" border=0 alt="Move Up"></a><a href="'.$session{page}{url}.'?func=moveDown&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/downArrow.gif" border=0 alt="Move Down"></a><a href="'.$session{page}{url}.'?func=jumpUp&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/jumpUp.gif" border=0 alt="Move to Top"></a><a href="'.$session{page}{url}.'?func=jumpDown&wid='.$widgetList[0].'"><img src="'.$session{setting}{lib}.'/jumpDown.gif" border=0 alt="Move to Bottom"></a><br>';
}
$cmd = "WebGUI::Widget::".$widgetList[1]."::www_view";
$contentHash{$widgetList[2]} .= &$cmd($widgetList[0])."<p>";

89
lib/WebGUI/Attachment.pm Normal file
View file

@ -0,0 +1,89 @@
package WebGUI::Attachment;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001 Plain Black Software.
#-------------------------------------------------------------------
# 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 File::Copy cp;
use File::Path;
use FileHandle;
use POSIX;
use strict;
use WebGUI::Session;
use WebGUI::Utility;
#-------------------------------------------------------------------
# eg: copy(filename,oldWidgetId,newWidgetId,oldSubId,newSubId);
sub copy {
my ($a, $b, $newFile, $oldFile);
if ($_[0] ne "") {
$oldFile = $session{setting}{attachmentDirectoryLocal}.'/'.$_[1];
if ($_[3] ne "") {
$oldFile .= '/'.$_[3]
}
$oldFile .= '/'.$_[0];
$newFile = $session{setting}{attachmentDirectoryLocal}.'/'.$_[2];
if ($_[4] ne "") {
$newFile .= '/'.$_[4]
}
mkdir ($newFile,0755);
$newFile .= '/'.$_[0];
$a = FileHandle->new($oldFile,"r");
$b = FileHandle->new(">".$newFile);
cp($a,$b);
$a->close;
$b->close;
}
}
#-------------------------------------------------------------------
sub purgeWidget {
my ($dir);
$dir = $session{setting}{attachmentDirectoryLocal}.'/'.$_[0];
rmtree($dir);
}
#-------------------------------------------------------------------
# eg: save(formVarName,widgetId,optionallySubmissionId);
sub save {
my ($file, $filename, $bytesread, $buffer, $urlizedFilename, $path);
$filename = $session{cgi}->upload($_[0]);
if (defined $filename) {
if ($filename =~ /([^\/\\]+)$/) {
$urlizedFilename = $1;
} else {
$urlizedFilename = $filename;
}
$urlizedFilename = urlize($urlizedFilename);
$path = $session{setting}{attachmentDirectoryLocal}."/".$_[1]."/";
mkdir ($path,0755);
if ($_[2] ne "") {
$path = $path.$_[2].'/';
mkdir ($path,0755);
}
$file = FileHandle->new(">".$path.$urlizedFilename);
if (defined $file) {
binmode $file;
while ($bytesread=read($filename,$buffer,1024)) {
print $file $buffer;
}
close($file);
} else {
return "";
}
return $urlizedFilename;
} else {
return "";
}
}
1;

View file

@ -16,25 +16,31 @@ use WebGUI::DateTime;
use WebGUI::International;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Utility;
#-------------------------------------------------------------------
sub traverseReplyTree {
my ($sth, @data, $html, $depth, $i);
for ($i=0;$i<=$_[1];$i++) {
$depth .= "&nbsp;&nbsp;";
}
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost,userId from discussion where pid=$_[0] order by messageId", $session{dbh});
while (@data = $sth->array) {
$html .= '<tr';
if ($session{form}{mid} eq $data[0]) {
$html .= ' class="highlight"';
}
$html .= '><td class="tableData">'.$depth.'<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.substr($data[1],0,30).'</a></td><td class="tableData"><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$data[4].'">'.$data[2].'</a></td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").'</td></tr>';
$html .= traverseReplyTree($data[0],$_[1]+1);
}
$sth->finish;
return $html;
sub _duplicateReplyTree {
my (@row, $sth, %data, $newMessageId);
$sth = WebGUI::SQL->read("select * from discussion where pid=$_[0] order by messageId");
while (%data = $sth->hash) {
$newMessageId = getNextId("messageId");
WebGUI::SQL->write("insert into discussion values ($newMessageId, $_[2], $_[3], $_[1], $data{userId}, ".quote($data{username}).", ".quote($data{subject}).", ".quote($data{message}).", $data{dateOfPost}, $_[4])");
_duplicateReplyTree($data{messageId},$newMessageId,$_[2],$_[3],$_[4]);
}
$sth->finish;
}
#-------------------------------------------------------------------
sub duplicate {
my ($sth, %data, $newMessageId, $oldSubId, $newSubId);
$oldSubId = $_[2] || 0;
$newSubId = $_[3] || 0;
$sth = WebGUI::SQL->read("select * from discussion where widgetId=$_[0] and pid=0 and subId=$oldSubId order by messageId");
while (%data = $sth->hash) {
$newMessageId = getNextId("messageId");
WebGUI::SQL->write("insert into discussion values ($newMessageId, $newMessageId, $_[1], 0, $data{userId}, ".quote($data{username}).", ".quote($data{subject}).", ".quote($data{message}).", $data{dateOfPost}, $newSubId)");
_duplicateReplyTree($data{messageId},$newMessageId,$newMessageId,$_[1],$newSubId);
}
$sth->finish;
}
#-------------------------------------------------------------------
@ -64,7 +70,7 @@ sub editMessageSave {
if ($session{form}{message} eq "") {
$session{form}{subject} .= ' '.WebGUI::International::get(233);
}
WebGUI::SQL->write("update discussion set subject=".quote($session{form}{subject}).", message=".quote("\n --- (Edited at ".localtime(time)." by $session{user}{username}) --- \n\n".$session{form}{message}).", subId='$session{form}{sid}' where messageId=$session{form}{mid}",$session{dbh});
WebGUI::SQL->write("update discussion set subject=".quote($session{form}{subject}).", message=".quote("\n --- (Edited at ".localtime(time)." by $session{user}{username}) --- \n\n".$session{form}{message}).", subId='$session{form}{sid}' where messageId=$session{form}{mid}");
return showMessage();
}
@ -72,7 +78,7 @@ sub editMessageSave {
sub getMessage {
my (%message);
tie %message, 'Tie::CPHash';
%message = WebGUI::SQL->quickHash("select * from discussion where messageId=$_[0]",$session{dbh});
%message = WebGUI::SQL->quickHash("select * from discussion where messageId=$_[0]");
$message{message} =~ s/\n/\<br\>/g;
return %message;
}
@ -102,14 +108,14 @@ sub postNewMessageSave {
$session{form}{subject} .= ' '.WebGUI::International::get(233);
}
$mid = getNextId("messageId");
WebGUI::SQL->write("insert into discussion values ($mid, $mid, $session{form}{wid}, 0, $session{user}{userId}, ".quote($session{user}{username}).", ".quote($session{form}{subject}).", ".quote($session{form}{message}).", ".time().", '$session{form}{sid}')",$session{dbh});
WebGUI::SQL->write("insert into discussion values ($mid, $mid, $session{form}{wid}, 0, $session{user}{userId}, ".quote($session{user}{username}).", ".quote($session{form}{subject}).", ".quote($session{form}{message}).", ".time().", '$session{form}{sid}')");
return "";
}
#-------------------------------------------------------------------
sub postReply {
my ($html, $subject);
($subject) = WebGUI::SQL->quickArray("select subject from discussion where messageId=$session{form}{mid}", $session{dbh});
($subject) = WebGUI::SQL->quickArray("select subject from discussion where messageId=$session{form}{mid}");
$subject = "Re: ".$subject;
$html = '<h1>'.WebGUI::International::get(234).'</h1>';
$html .= '<form action="'.$session{page}{url}.'" method="post"><table>';
@ -135,11 +141,16 @@ sub postReplySave {
$session{form}{subject} .= ' '.WebGUI::International::get(233);
}
$mid = getNextId("messageId");
($rid) = WebGUI::SQL->quickArray("select rid from discussion where messageId=$session{form}{mid}",$session{dbh});
WebGUI::SQL->write("insert into discussion values ($mid, $rid, $session{form}{wid}, $session{form}{mid}, $session{user}{userId}, ".quote($session{user}{username}).", ".quote($session{form}{subject}).", ".quote($session{form}{message}).", ".time().", '$session{form}{sid}')", $session{dbh});
($rid) = WebGUI::SQL->quickArray("select rid from discussion where messageId=$session{form}{mid}");
WebGUI::SQL->write("insert into discussion values ($mid, $rid, $session{form}{wid}, $session{form}{mid}, $session{user}{userId}, ".quote($session{user}{username}).", ".quote($session{form}{subject}).", ".quote($session{form}{message}).", ".time().", '$session{form}{sid}')");
return "";
}
#-------------------------------------------------------------------
sub purgeWidget {
WebGUI::SQL->write("delete from discussion where widgetId=$_[0]",$_[1]);
}
#-------------------------------------------------------------------
sub showMessage {
my ($html, %message);
@ -168,5 +179,24 @@ sub showReplyTree {
return $html;
}
#-------------------------------------------------------------------
sub traverseReplyTree {
my ($sth, @data, $html, $depth, $i);
for ($i=0;$i<=$_[1];$i++) {
$depth .= "&nbsp;&nbsp;";
}
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost,userId from discussion where pid=$_[0] order by messageId");
while (@data = $sth->array) {
$html .= '<tr';
if ($session{form}{mid} eq $data[0]) {
$html .= ' class="highlight"';
}
$html .= '><td class="tableData">'.$depth.'<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.substr($data[1],0,30).'</a></td><td class="tableData"><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$data[4].'">'.$data[2].'</a></td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").'</td></tr>';
$html .= traverseReplyTree($data[0],$_[1]+1);
}
$sth->finish;
return $html;
}
1;

View file

@ -34,7 +34,7 @@ sub get {
if (defined $international{$language}{$_[0]}) { # a little caching never hurts =)
$output = $international{$language}{$_[0]};
} else {
($output) = WebGUI::SQL->quickArray("select message from international where internationalId=$_[0] and namespace='$namespace' and language='$language'",$session{dbh});
($output) = WebGUI::SQL->quickArray("select message from international where internationalId=$_[0] and namespace='$namespace' and language='$language'");
if ($output eq "" && $language ne "English") {
$output = get($_[0],$namespace,"English");
}

View file

@ -39,11 +39,10 @@ sub process {
opendir (DIR,$session{config}{webguiRoot}.$macroDir) or WebGUI::ErrorHandler::fatalError("Can't open macro directory!");
@files = readdir(DIR);
foreach $file (@files) {
if ($file ne "." && $file ne ".." && $file =~ /\.pm/) {
$file =~ s/\.pm//;
$cmd = "use WebGUI::Macro::".$file;
if ($file =~ /(.*?)\.pm$/) {
$cmd = "use WebGUI::Macro::".$1;
eval($cmd);
$cmd = "WebGUI::Macro::".$file."::process";
$cmd = "WebGUI::Macro::".$1."::process";
$output = &$cmd($output);
}
}

View file

@ -19,14 +19,12 @@ use WebGUI::SQL;
sub _recurseCrumbTrail {
my ($sth, %data, $output);
tie %data, 'Tie::CPHash';
%data = WebGUI::SQL->quickHash("select pageId,parentId,title,urlizedTitle from page where pageId=$_[0]",$session
{dbh});
%data = WebGUI::SQL->quickHash("select pageId,parentId,title,urlizedTitle from page where pageId=$_[0]");
if ($data{pageId} > 1) {
$output .= _recurseCrumbTrail($data{parentId});
}
if ($data{title} ne "") {
$output .= '<a class="crumbTrail" href="'.$session{env}{SCRIPT_NAME}.'/'.$data{urlizedTitle}.'">'.$data{title}.'</a> &gt; '
;
$output .= '<a class="crumbTrail" href="'.$session{env}{SCRIPT_NAME}.'/'.$data{urlizedTitle}.'">'.$data{title}.'</a> &gt; ';
}
return $output;
}

View file

@ -28,8 +28,8 @@ sub _replacement {
#-------------------------------------------------------------------
sub _reversePageTree {
my ($sth, @data, $output, $parentId);
($parentId) = WebGUI::SQL->quickArray("select parentId from page where pageId='$_[0]'",$session{dbh});
$sth = WebGUI::SQL->read("select pageId,parentId,title,urlizedTitle from page where parentId=$_[0] order by sequenceNumber",$session{dbh});
($parentId) = WebGUI::SQL->quickArray("select parentId from page where pageId='$_[0]'");
$sth = WebGUI::SQL->read("select pageId,parentId,title,urlizedTitle from page where parentId=$_[0] order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[0])) {
if ($_[1] == $data[0]) {

View file

@ -24,7 +24,7 @@ sub _replacement {
if ($param[1] eq "") {
$param[1] = 0;
}
@data = WebGUI::SQL->quickArray("select pageId,title,urlizedTitle from page where urlizedTitle='$param[0]'",$session{dbh});
@data = WebGUI::SQL->quickArray("select pageId,title,urlizedTitle from page where urlizedTitle='$param[0]'");
$temp = '<span class="verticalMenu">';
if (defined $data[0] && WebGUI::Privilege::canViewPage($data[0])) {
$temp .= traversePageTree($data[0],1,$param[1]);
@ -46,7 +46,7 @@ sub process {
if ($depth eq "") {
$depth = 0;
}
@data = WebGUI::SQL->quickArray("select pageId,title,urlizedTitle from page where urlizedTitle='$pageTitle'",$session{dbh});
@data = WebGUI::SQL->quickArray("select pageId,title,urlizedTitle from page where urlizedTitle='$pageTitle'");
$temp = '<span class="verticalMenu">';
if (defined $data[0] && WebGUI::Privilege::canViewPage($data[0])) {
$temp .= traversePageTree($data[0],1,$depth);

View file

@ -36,7 +36,7 @@ sub traversePageTree {
$depth .= "&nbsp;&nbsp;&nbsp;";
}
if ($_[1] < $toLevel) {
$sth = WebGUI::SQL->read("select urlizedTitle, title, pageId from page where parentId='$_[0]' order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select urlizedTitle, title, pageId from page where parentId='$_[0]' order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
$output .= $depth.'<a class="verticalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[0].'">'.$data[1].'</a><br>';

View file

@ -20,7 +20,7 @@ sub _replacement {
my ($temp, @data, $sth, $first);
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{pageId} order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{pageId} order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {
@ -45,7 +45,7 @@ sub process {
if ($output =~ /\^m/) {
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{pageId} order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{pageId} order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {

View file

@ -21,7 +21,7 @@ sub _replacement {
my ($temp, @data, $sth, $first);
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{parentId} order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{parentId} order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {
@ -46,7 +46,7 @@ sub process {
if ($output =~ /\^p/) {
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{parentId} order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{parentId} order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {

View file

@ -22,8 +22,8 @@ sub _replacement {
$pageTitle = $1;
$temp = '<span class="horizontalMenu">';
$first = 1;
($parentId) = WebGUI::SQL->quickArray("select pageId from page where urlizedTitle='$pageTitle'",$session{dbh});
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId='$parentId' order by sequenceNumber",$session{dbh});
($parentId) = WebGUI::SQL->quickArray("select pageId from page where urlizedTitle='$pageTitle'");
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId='$parentId' order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {
@ -50,8 +50,8 @@ sub process {
$pageTitle = $1;
$temp = '<span class="horizontalMenu">';
$first = 1;
($parentId) = WebGUI::SQL->quickArray("select pageId from page where urlizedTitle='$pageTitle'",$session{dbh});
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId='$parentId' order by sequenceNumber",$session{dbh});
($parentId) = WebGUI::SQL->quickArray("select pageId from page where urlizedTitle='$pageTitle'");
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId='$parentId' order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {

View file

@ -20,7 +20,7 @@ sub _replacement {
my ($temp, @data, $sth, $first);
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=1 order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=1 order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {
@ -45,7 +45,7 @@ sub process {
if ($output =~ /\^t/) {
$temp = '<span class="horizontalMenu">';
$first = 1;
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=1 order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=1 order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
if ($first) {

View file

@ -12,21 +12,21 @@ package WebGUI::MessageLog;
use strict;
use WebGUI::Session;
use WebGUI::Utility;
use WebGUI::SQL;
#-------------------------------------------------------------------
sub addEntry {
my ($user, %userLanguage, $messageLogId, %message);
$messageLogId = getNextId("messageLogId");
if ($_[0] ne "") {
($userLanguage{$_[0]}) = WebGUI::SQL->quickArray("select language from users where userId=$_[0]",$session{dbh});
($userLanguage{$_[0]}) = WebGUI::SQL->quickArray("select language from users where userId=$_[0]");
}
if ($_[1] ne "") {
%userLanguage = (WebGUI::SQL->buildHash("select users.userId,users.language from groupings,users where groupings.groupId=$_[1] and groupings.userId=users.userId",$session{dbh}),%userLanguage);
%userLanguage = (WebGUI::SQL->buildHash("select users.userId,users.language from groupings,users where groupings.groupId=$_[1] and groupings.userId=users.userId"),%userLanguage);
}
%message = WebGUI::SQL->buildHash("select language,message from international where internationalId=$_[3] and namespace='$_[4]'",$session{dbh});
%message = WebGUI::SQL->buildHash("select language,message from international where internationalId=$_[3] and namespace='$_[4]'");
foreach $user (keys %userLanguage) {
WebGUI::SQL->write("insert into messageLog values ($messageLogId,$user,".quote($message{$userLanguage{$user}}).",".quote($_[2]).",".time().")",$session{dbh});
WebGUI::SQL->write("insert into messageLog values ($messageLogId,$user,".quote($message{$userLanguage{$user}}).",".quote($_[2]).",".time().")");
# here is where we'll trigger communication with external systems like email
}
}
@ -37,9 +37,9 @@ sub completeEntry {
$completeMessage = WebGUI::International::get(350);
# unfortunately had to loop through reading and writing because I couldn't
# find a concatination function that worked the same in all DB servers
$sth = WebGUI::SQL->read("select message,userId from messageLog where messageLogId=$_[0]",$session{dbh});
$sth = WebGUI::SQL->read("select message,userId from messageLog where messageLogId=$_[0]");
while (@data = $sth->array) {
WebGUI::SQL->write("update messageLog set message=".quote($completeMessage.": ".$data[0]).", dateOfEntry=".time()." where messageLogId='$_[0]' and userId=$data[1]",$session{dbh});
WebGUI::SQL->write("update messageLog set message=".quote($completeMessage.": ".$data[0]).", dateOfEntry=".time()." where messageLogId='$_[0]' and userId=$data[1]");
}
$sth->finish;
}

View file

@ -15,6 +15,7 @@ use WebGUI::Operation::Account;
use WebGUI::Operation::Admin;
use WebGUI::Operation::Group;
use WebGUI::Operation::Help;
use WebGUI::Operation::Package;
use WebGUI::Operation::Page;
use WebGUI::Operation::Search;
use WebGUI::Operation::Settings;

View file

@ -22,11 +22,12 @@ use WebGUI::International;
use WebGUI::Mail;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
our @ISA = qw(Exporter);
our @EXPORT = qw(&www_viewMessageLog &www_viewProfile &www_editProfile &www_editProfileSave &www_createAccount &www_deactivateAccount &www_deactivateAccountConfirm &www_displayAccount &www_displayLogin &www_login &www_logout &www_recoverPassword &www_recoverPasswordFinish &www_saveAccount &www_updateAccount);
our @EXPORT = qw(&www_viewMessageLog &www_viewProfile &www_editProfile &www_editProfileSave &www_createAccount &www_deactivateAccount &www_deactivateAccountConfirm &www_displayAccount &www_displayLogin &www_login &www_logout &www_recoverPassword &www_recoverPasswordFinish &www_createAccountSave &www_updateAccount);
our %ldapStatusCode = ( 0=>'success (0)', 1=>'Operations Error (1)', 2=>'Protocol Error (2)', 3=>'Time Limit Exceeded (3)', 4=>'Size Limit Exceeded (4)', 5=>'Compare False (5)', 6=>'Compare True (6)', 7=>'Auth Method Not Supported (7)', 8=>'Strong Auth Required (8)', 9=>'Referral (10)', 11=>'Admin Limit Exceeded (11)', 12=>'Unavailable Critical Extension (12)', 13=>'Confidentiality Required (13)', 14=>'Sasl Bind In Progress (14)', 15=>'No Such Attribute (16)', 17=>'Undefined Attribute Type (17)', 18=>'Inappropriate Matching (18)', 19=>'Constraint Violation (19)', 20=>'Attribute Or Value Exists (20)', 21=>'Invalid Attribute Syntax (21)', 32=>'No Such Object (32)', 33=>'Alias Problem (33)', 34=>'Invalid DN Syntax (34)', 36=>'Alias Dereferencing Problem (36)', 48=>'Inappropriate Authentication (48)', 49=>'Invalid Credentials (49)', 50=>'Insufficient Access Rights (50)', 51=>'Busy (51)', 52=>'Unavailable (52)', 53=>'Unwilling To Perform (53)', 54=>'Loop Detect (54)', 64=>'Naming Violation (64)', 65=>'Object Class Violation (65)', 66=>'Not Allowed On Non Leaf (66)', 67=>'Not Allowed On RDN (67)', 68=>'Entry Already Exists (68)', 69=>'Object Class Mods Prohibited (69)', 71=>'Affects Multiple DSAs (71)', 80=>'other (80)');
#-------------------------------------------------------------------
@ -62,7 +63,7 @@ sub _hasBadPassword {
#-------------------------------------------------------------------
sub _hasBadUsername {
my ($otherUser);
($otherUser) = WebGUI::SQL->quickArray("select username from users where username='$_[0]'",$session{dbh});
($otherUser) = WebGUI::SQL->quickArray("select username from users where username='$_[0]'");
if (($otherUser ne "" && $otherUser ne $session{user}{username}) || $_[0] eq "") {
return 1;
} else {
@ -93,8 +94,8 @@ sub www_createAccount {
$output .= www_displayLogin();
} else {
$output .= '<h1>'.WebGUI::International::get(54).'</h1>';
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
$output .= WebGUI::Form::hidden("op","saveAccount");
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","createAccountSave");
$output .= '<table>';
unless ($session{setting}{authMethod} eq "LDAP" && $session{setting}{usernameBinding} eq "yes") {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(50).'</td><td>'.WebGUI::Form::text("username",20,30).'</td></tr>';
@ -109,7 +110,7 @@ sub www_createAccount {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(55).'</td><td>'.WebGUI::Form::password("identifier2",20,30).'</td></tr>';
}
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(56).'</td><td>'.WebGUI::Form::text("email",20,255).'<span class="formSubtext"><br>'.WebGUI::International::get(57).'</span></td></tr>';
%language = WebGUI::SQL->buildHash("select distinct(language) from international",$session{dbh});
%language = WebGUI::SQL->buildHash("select distinct(language) from international");
$array[0] = "English";
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(304).'</td><td>'.WebGUI::Form::selectList("language",\%language,\@array).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
@ -125,6 +126,68 @@ sub www_createAccount {
return $output;
}
#-------------------------------------------------------------------
sub www_createAccountSave {
my ($username, $uri, $ldap, $port, %args, $search, $connectDN, $auth, $output, $error, $uid, $registeredUserExpire, $encryptedPassword);
if ($session{setting}{authMethod} eq "LDAP" && $session{setting}{usernameBinding} eq "yes") {
$username = $session{form}{ldapId};
} else {
$username = $session{form}{username};
}
if (_hasBadUsername($username)) {
$error = WebGUI::International::get(77);
$error .= ' "'.$username.'too", ';
$error .= '"'.$username.'2", ';
$error .= '"'.$username.'_'.WebGUI::DateTime::epochToHuman(time(),"%y").'"';
$error .= '<p>';
}
if (_hasBadPassword($session{form}{identifier1},$session{form}{identifier2})) {
$error .= WebGUI::International::get(78);
}
if ($session{setting}{authMethod} eq "LDAP") {
$uri = URI->new($session{setting}{ldapURL});
if ($uri->port < 1) {
$port = 389;
} else {
$port = $uri->port;
}
%args = (port => $port);
$ldap = Net::LDAP->new($uri->host, %args) or $error .= WebGUI::International::get(79);
$ldap->bind;
$search = $ldap->search (base => $uri->dn, filter => $session{setting}{ldapId}."=".$session{form}{ldapId});
if (defined $search->entry(0)) {
$connectDN = "cn=".$search->entry(0)->get_value("cn");
$ldap->unbind;
$ldap = Net::LDAP->new($uri->host, %args) or $error .= WebGUI::International::get(79);
$auth = $ldap->bind(dn=>$connectDN, password=>$session{form}{ldapPassword});
if ($auth->code == 48 || $auth->code == 49) {
$error .= WebGUI::International::get(68);
WebGUI::ErrorHandler::warn("Invalid LDAP information for registration of LDAP ID: ".$session{form}{ldapId});
} elsif ($auth->code > 0) {
$error .= 'LDAP error "'.$ldapStatusCode{$auth->code}.'" occured. '.WebGUI::International::get(69);
WebGUI::ErrorHandler::warn("LDAP error: ".$ldapStatusCode{$auth->code});
}
$ldap->unbind;
} else {
$error .= WebGUI::International::get(68);
WebGUI::ErrorHandler::warn("Invalid LDAP information for registration of LDAP ID: ".$session{form}{ldapId});
}
}
if ($error eq "") {
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier1});
$uid = getNextId("userId");
WebGUI::SQL->write("insert into users (userId,username,identifier,email,authMethod,ldapURL,connectDN,language) values ($uid, ".quote($username).", ".quote($encryptedPassword).", ".quote($session{form}{email}).", ".quote($session{setting}{authMethod}).", ".quote($session{setting}{ldapURL}).", ".quote($connectDN).", ".quote($session{form}{language}).")");
($registeredUserExpire) = WebGUI::SQL->quickArray("select expireAfter from groups where groupId=2");
WebGUI::SQL->write("insert into groupings values (2,$uid,".(time()+$registeredUserExpire).")");
_login($uid,$encryptedPassword);
$output .= WebGUI::International::get(80).'<p>';
$output .= www_displayAccount();
} else {
$output = "<h1>".WebGUI::International::get(70)."</h1>".$error.www_createAccount();
}
return $output;
}
#-------------------------------------------------------------------
sub www_deactivateAccount {
my ($output);
@ -142,8 +205,8 @@ sub www_deactivateAccount {
#-------------------------------------------------------------------
sub www_deactivateAccountConfirm {
if ($session{user}{userId} != 1) {
WebGUI::SQL->write("delete from users where userId=$session{user}{userId}",$session{dbh});
WebGUI::SQL->write("delete from groupings where userId=$session{user}{userId}",$session{dbh});
WebGUI::SQL->write("delete from users where userId=$session{user}{userId}");
WebGUI::SQL->write("delete from groupings where userId=$session{user}{userId}");
WebGUI::Session::end($session{var}{sessionId});
_login(1,"null");
}
@ -155,7 +218,7 @@ sub www_displayAccount {
my ($output, %hash, @array);
if ($session{user}{userId} != 1) {
$output .= '<h1>'.WebGUI::International::get(61).'</h1>';
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","updateAccount");
$output .= '<table>';
if ($session{user}{authMethod} eq "LDAP" && $session{setting}{usernameBinding} eq "yes") {
@ -172,7 +235,7 @@ sub www_displayAccount {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(55).'</td><td>'.WebGUI::Form::password("identifier2",20,30,"password").'</td></tr>';
}
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(56).'</td><td>'.WebGUI::Form::text("email",20,255,$session{user}{email}).'<span class="formSubtext"><br>'.WebGUI::International::get(57).'</span></td></tr>';
%hash = WebGUI::SQL->buildHash("select distinct(language) from international",$session{dbh});
%hash = WebGUI::SQL->buildHash("select distinct(language) from international");
$array[0] = $session{user}{language};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(304).'</td><td>'.WebGUI::Form::selectList("language",\%hash,\@array).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
@ -192,7 +255,7 @@ sub www_displayLogin {
$output .= www_displayAccount();
} else {
$output .= '<h1>'.WebGUI::International::get(66).'</h1>';
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","login");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(50).'</td><td>'.WebGUI::Form::text("username",20,30).'</td></tr>';
@ -218,7 +281,7 @@ sub www_editProfile {
%gender = ('male'=>WebGUI::International::get(339),'female'=>WebGUI::International::get(340));
if ($session{user}{userId} != 1) {
$output .= '<h1>'.WebGUI::International::get(338).'</h1>';
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editProfileSave");
$output .= WebGUI::Form::hidden("uid",$session{user}{userId});
$output .= '<table>';
@ -270,7 +333,7 @@ sub www_editProfile {
#-------------------------------------------------------------------
sub www_editProfileSave {
if ($session{user}{userId} != 1) {
WebGUI::SQL->write("update users set firstName=".quote($session{form}{firstName}).", middleName=".quote($session{form}{middleName}).", lastName=".quote($session{form}{lastName}).", icq=".quote($session{form}{icq}).", aim=".quote($session{form}{aim}).", msnIM=".quote($session{form}{msnIM}).", yahooIM=".quote($session{form}{yahooIM}).", homeAddress=".quote($session{form}{homeAddress}).", homeCity=".quote($session{form}{homeCity}).", homeState=".quote($session{form}{homeState}).", homeZip=".quote($session{form}{homeZip}).", homeCountry=".quote($session{form}{homeCountry}).", homePhone=".quote($session{form}{homePhone}).", workAddress=".quote($session{form}{workAddress}).", workCity=".quote($session{form}{workCity}).", workState=".quote($session{form}{workState}).", workZip=".quote($session{form}{workZip}).", workCountry=".quote($session{form}{workCountry}).", workPhone=".quote($session{form}{workPhone}).", cellPhone=".quote($session{form}{cellPhone}).", pager=".quote($session{form}{pager}).", gender=".quote($session{form}{gender}).", birthdate=".quote($session{form}{birthdate}).", homepage=".quote($session{form}{homepage})." where userId=".$session{form}{uid},$session{dbh});
WebGUI::SQL->write("update users set firstName=".quote($session{form}{firstName}).", middleName=".quote($session{form}{middleName}).", lastName=".quote($session{form}{lastName}).", icq=".quote($session{form}{icq}).", aim=".quote($session{form}{aim}).", msnIM=".quote($session{form}{msnIM}).", yahooIM=".quote($session{form}{yahooIM}).", homeAddress=".quote($session{form}{homeAddress}).", homeCity=".quote($session{form}{homeCity}).", homeState=".quote($session{form}{homeState}).", homeZip=".quote($session{form}{homeZip}).", homeCountry=".quote($session{form}{homeCountry}).", homePhone=".quote($session{form}{homePhone}).", workAddress=".quote($session{form}{workAddress}).", workCity=".quote($session{form}{workCity}).", workState=".quote($session{form}{workState}).", workZip=".quote($session{form}{workZip}).", workCountry=".quote($session{form}{workCountry}).", workPhone=".quote($session{form}{workPhone}).", cellPhone=".quote($session{form}{cellPhone}).", pager=".quote($session{form}{pager}).", gender=".quote($session{form}{gender}).", birthdate=".quote($session{form}{birthdate}).", homepage=".quote($session{form}{homepage})." where userId=".$session{form}{uid});
return www_displayAccount();
} else {
return www_displayLogin();
@ -280,7 +343,7 @@ sub www_editProfileSave {
#-------------------------------------------------------------------
sub www_login {
my ($uri, $port, $ldap, %args, $auth, $error, $uid,$pass,$authMethod, $ldapURL, $connectDN, $success);
($uid,$pass,$authMethod, $ldapURL, $connectDN) = WebGUI::SQL->quickArray("select userId,identifier,authMethod,ldapURL,connectDN from users where username=".quote($session{form}{username}),$session{dbh});
($uid,$pass,$authMethod, $ldapURL, $connectDN) = WebGUI::SQL->quickArray("select userId,identifier,authMethod,ldapURL,connectDN from users where username=".quote($session{form}{username}));
if ($authMethod eq "LDAP") {
$uri = URI->new($ldapURL);
if ($uri->port < 1) {
@ -331,7 +394,7 @@ sub www_recoverPassword {
$output .= www_displayAccount();
} else {
$output .= '<h1>'.WebGUI::International::get(71).'</h1>';
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","recoverPasswordFinish");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(56).'</td><td>'.WebGUI::Form::text("email",20,255).'</td></tr>';
@ -351,13 +414,13 @@ sub www_recoverPassword {
#-------------------------------------------------------------------
sub www_recoverPasswordFinish {
my ($sth, $username, $encryptedPassword, $userId, $password, $flag, $message, $output);
$sth = WebGUI::SQL->read("select username, userId from users where email=".quote($session{form}{email}),$session{dbh});
$sth = WebGUI::SQL->read("select username, userId from users where email=".quote($session{form}{email}));
while (($username,$userId) = $sth->array) {
foreach (0,1,2,3,4,5) {
$password .= chr(ord('A') + randint(32));
}
$encryptedPassword = Digest::MD5::md5_base64($password);
WebGUI::SQL->write("update users set identifier='$encryptedPassword' where userId='$userId'",$session{dbh});
WebGUI::SQL->write("update users set identifier='$encryptedPassword' where userId='$userId'");
$flag = 1;
$message = $session{setting}{recoverPasswordEmail};
$message .= "\n".WebGUI::International::get(50).": ".$username."\n";
@ -375,67 +438,6 @@ sub www_recoverPasswordFinish {
return $output;
}
#-------------------------------------------------------------------
sub www_saveAccount {
my ($username, $uri, $ldap, $port, %args, $search, $connectDN, $auth, $output, $error, $uid, $encryptedPassword);
if ($session{setting}{authMethod} eq "LDAP" && $session{setting}{usernameBinding} eq "yes") {
$username = $session{form}{ldapId};
} else {
$username = $session{form}{username};
}
if (_hasBadUsername($username)) {
$error = WebGUI::International::get(77);
$error .= ' "'.$username.'too", ';
$error .= '"'.$username.'2", ';
$error .= '"'.$username.'_'.WebGUI::DateTime::epochToHuman(time(),"%y").'"';
$error .= '<p>';
}
if (_hasBadPassword($session{form}{identifier1},$session{form}{identifier2})) {
$error .= WebGUI::International::get(78);
}
if ($session{setting}{authMethod} eq "LDAP") {
$uri = URI->new($session{setting}{ldapURL});
if ($uri->port < 1) {
$port = 389;
} else {
$port = $uri->port;
}
%args = (port => $port);
$ldap = Net::LDAP->new($uri->host, %args) or $error .= WebGUI::International::get(79);
$ldap->bind;
$search = $ldap->search (base => $uri->dn, filter => $session{setting}{ldapId}."=".$session{form}{ldapId});
if (defined $search->entry(0)) {
$connectDN = "cn=".$search->entry(0)->get_value("cn");
$ldap->unbind;
$ldap = Net::LDAP->new($uri->host, %args) or $error .= WebGUI::International::get(79);
$auth = $ldap->bind(dn=>$connectDN, password=>$session{form}{ldapPassword});
if ($auth->code == 48 || $auth->code == 49) {
$error .= WebGUI::International::get(68);
WebGUI::ErrorHandler::warn("Invalid LDAP information for registration of LDAP ID: ".$session{form}{ldapId});
} elsif ($auth->code > 0) {
$error .= 'LDAP error "'.$ldapStatusCode{$auth->code}.'" occured. '.WebGUI::International::get(69);
WebGUI::ErrorHandler::warn("LDAP error: ".$ldapStatusCode{$auth->code});
}
$ldap->unbind;
} else {
$error .= WebGUI::International::get(68);
WebGUI::ErrorHandler::warn("Invalid LDAP information for registration of LDAP ID: ".$session{form}{ldapId});
}
}
if ($error eq "") {
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier1});
$uid = getNextId("userId");
WebGUI::SQL->write("insert into users (userId,username,identifier,email,authMethod,ldapURL,connectDN,language) values ($uid, ".quote($username).", ".quote($encryptedPassword).", ".quote($session{form}{email}).", ".quote($session{setting}{authMethod}).", ".quote($session{setting}{ldapURL}).", ".quote($connectDN).", ".quote($session{form}{language}).")",$session{dbh});
WebGUI::SQL->write("insert into groupings values (2,$uid)",$session{dbh});
_login($uid,$encryptedPassword);
$output .= WebGUI::International::get(80).'<p>';
$output .= www_displayAccount();
} else {
$output = "<h1>".WebGUI::International::get(70)."</h1>".$error.www_createAccount();
}
return $output;
}
#-------------------------------------------------------------------
sub www_updateAccount {
my ($output, $error, $encryptedPassword, $passwordStatement);
@ -457,7 +459,7 @@ sub www_updateAccount {
}
if ($error eq "") {
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier1});
WebGUI::SQL->write("update users set username=".quote($session{form}{username}).$passwordStatement.", email=".quote($session{form}{email}).", language=".quote($session{form}{language})." where userId=".$session{user}{userId},$session{dbh});
WebGUI::SQL->write("update users set username=".quote($session{form}{username}).$passwordStatement.", email=".quote($session{form}{email}).", language=".quote($session{form}{language})." where userId=".$session{user}{userId});
if ($passwordStatement ne "") {
_login($session{user}{userId},$encryptedPassword);
}
@ -478,7 +480,7 @@ sub www_viewMessageLog {
my (@data, $output, $sth, @row, $i, $dataRows, $prevNextBar);
if (WebGUI::Privilege::isInGroup(2,$session{user}{userId})) {
$output = '<h1>'.WebGUI::International::get(159).'</h1>';
$sth = WebGUI::SQL->read("select messageLogId,message,url,dateOfEntry from messageLog where userId=$session{user}{userId} order by dateOfEntry desc",$session{dbh});
$sth = WebGUI::SQL->read("select messageLogId,message,url,dateOfEntry from messageLog where userId=$session{user}{userId} order by dateOfEntry desc");
while (@data = $sth->array) {
$row[$i] = '<tr><td class="tableData">';
if ($data[2] ne "") {
@ -513,7 +515,7 @@ sub www_viewMessageLog {
#-------------------------------------------------------------------
sub www_viewProfile {
my ($output, %user);
%user = WebGUI::SQL->quickHash("select * from users where userId='$session{form}{uid}'",$session{dbh});
%user = WebGUI::SQL->quickHash("select * from users where userId='$session{form}{uid}'");
if ($user{username} eq "") {
WebGUI::Privilege::notMember();
} elsif ($session{user}{userId} != 1) {

View file

@ -22,7 +22,7 @@ our @EXPORT = qw(&www_switchOffAdmin &www_switchOnAdmin);
#-------------------------------------------------------------------
sub www_switchOffAdmin {
if ($session{var}{sessionId}) {
WebGUI::SQL->write("update session set adminOn=0 where sessionId='$session{var}{sessionId}'",$session{dbh});
WebGUI::SQL->write("update session set adminOn=0 where sessionId='$session{var}{sessionId}'");
WebGUI::Session::refreshSessionVars($session{var}{sessionId});
return "";
} else {
@ -33,7 +33,7 @@ sub www_switchOffAdmin {
#-------------------------------------------------------------------
sub www_switchOnAdmin {
if ($session{var}{sessionId}) {
WebGUI::SQL->write("update session set adminOn=1 where sessionId='$session{var}{sessionId}'",$session{dbh});
WebGUI::SQL->write("update session set adminOn=1 where sessionId='$session{var}{sessionId}'");
WebGUI::Session::refreshSessionVars($session{var}{sessionId});
return "";
} else {

View file

@ -13,10 +13,12 @@ package WebGUI::Operation::Group;
use Exporter;
use strict;
use Tie::CPHash;
use WebGUI::DateTime;
use WebGUI::Form;
use WebGUI::International;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
@ -27,14 +29,15 @@ our @EXPORT = qw(&www_addGroup &www_addGroupSave &www_deleteGroup &www_deleteGro
sub www_addGroup {
my ($output);
if (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=17&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(17);
$output .= '<h1>'.WebGUI::International::get(83).'</h1>';
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","addGroupSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(84).'</td><td>'.WebGUI::Form::text("groupName",20,30).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'').'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(84),WebGUI::Form::text("groupName",20,30));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",''));
$output .= tableFormRow(WebGUI::International::get(367),WebGUI::Form::text("expireAfter",20,30,314496000));
$output .= formSave();
$output .= '</table>';
$output .= '</form> ';
} else {
@ -47,7 +50,7 @@ sub www_addGroup {
sub www_addGroupSave {
my ($output);
if ($session{var}{sessionId}) {
WebGUI::SQL->write("insert into groups values (".getNextId("groupId").", ".quote($session{form}{groupName}).", ".quote($session{form}{description}).")",$session{dbh});
WebGUI::SQL->write("insert into groups values (".getNextId("groupId").", ".quote($session{form}{groupName}).", ".quote($session{form}{description}).", '$session{form}{expireAfter}')");
$output = www_listGroups();
} else {
$output = WebGUI::Privilege::adminOnly();
@ -61,7 +64,7 @@ sub www_deleteGroup {
if ($session{form}{gid} < 26) {
return WebGUI::Privilege::vitalComponent();
} elsif (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=15&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(15);
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(86).'<p>';
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deleteGroupConfirm&gid='.$session{form}{gid}.'">'.WebGUI::International::get(44).'</a>';
@ -77,8 +80,8 @@ sub www_deleteGroupConfirm {
if ($session{form}{gid} < 26) {
return WebGUI::Privilege::vitalComponent();
} elsif (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("delete from groups where groupId=$session{form}{gid}",$session{dbh});
WebGUI::SQL->write("delete from groupings where groupId=$session{form}{gid}",$session{dbh});
WebGUI::SQL->write("delete from groups where groupId=$session{form}{gid}");
WebGUI::SQL->write("delete from groupings where groupId=$session{form}{gid}");
return www_listGroups();
} else {
return WebGUI::Privilege::adminOnly();
@ -87,28 +90,33 @@ sub www_deleteGroupConfirm {
#-------------------------------------------------------------------
sub www_editGroup {
my ($output, $sth, %group, @user);
my ($output, $sth, %group, %hash);
tie %group, 'Tie::CPHash';
tie %hash, 'Tie::CPHash';
if (WebGUI::Privilege::isInGroup(3)) {
%group = WebGUI::SQL->quickHash("select * from groups where groupId=$session{form}{gid}",$session{dbh});
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=17&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
%group = WebGUI::SQL->quickHash("select * from groups where groupId=$session{form}{gid}");
$output .= helpLink(17);
$output .= '<h1>'.WebGUI::International::get(87).'</h1>';
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editGroupSave");
$output .= WebGUI::Form::hidden("gid",$session{form}{gid});
$output .= '<table>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(84).'</td><td>'.WebGUI::Form::text("groupName",20,30,$group{groupName}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$group{description}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(88).'</td><td valign="top">';
$sth = WebGUI::SQL->read("select users.username,users.userId from users,groupings where groupings.groupId=$session{form}{gid} and groupings.userId=users.userId order by users.username",$session{dbh});
while (@user = $sth->array) {
$output .= '<a href="'.$session{page}{url}.'?op=editUser&uid='.$user[1].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a> <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$user[1].'">'.$user[0].'</a><br>';
}
$sth->finish;
$output .= '<br></td></tr>';
$output .= tableFormRow(WebGUI::International::get(84),WebGUI::Form::text("groupName",20,30,$group{groupName}));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$group{description}));
$output .= tableFormRow(WebGUI::International::get(367),WebGUI::Form::text("expireAfter",20,30,$group{expireAfter}));
$output .= formSave();
$output .= '</table>';
$output .= '</form> ';
$output .= '<h1>'.WebGUI::International::get(88).'</h1>';
$output .= '<table><tr><td class="tableHeader">&nbsp;</td><td class="tableHeader">'.WebGUI::International::get(50).'</td><td class="tableHeader">'.WebGUI::International::get(369).'</td></tr>';
$sth = WebGUI::SQL->read("select users.username,users.userId,groupings.expireDate from groupings,users where groupings.groupId=$session{form}{gid} and groupings.userId=users.userId order by users.username");
while (%hash = $sth->hash) {
$output .= '<tr><td><a href="'.$session{page}{url}.'?op=deleteGrouping&uid='.$hash{userId}.'&gid='.$session{form}{gid}.'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?op=editGrouping&uid='.$hash{userId}.'&gid='.$session{form}{gid}.'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a></td>';
$output .= '<td class="tableData"><a href="'.$session{page}{url}.'/op=editUser&uid='.$hash{userId}.'">'.$hash{username}.'</a></td>';
$output .= '<td class="tableData">'.epochToHuman($hash{expireDate},"%M/%D/%y").'</td></tr>';
}
$sth->finish;
$output .= '</table>';
} else {
$output = WebGUI::Privilege::adminOnly();
}
@ -118,7 +126,7 @@ sub www_editGroup {
#-------------------------------------------------------------------
sub www_editGroupSave {
if (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("update groups set groupName=".quote($session{form}{groupName}).", description=".quote($session{form}{description})." where groupId=".$session{form}{gid},$session{dbh});
WebGUI::SQL->write("update groups set groupName=".quote($session{form}{groupName}).", description=".quote($session{form}{description}).", expireAfter='$session{form}{expireAfter}' where groupId=".$session{form}{gid});
return www_listGroups();
} else {
return WebGUI::Privilege::adminOnly();
@ -129,15 +137,15 @@ sub www_editGroupSave {
sub www_listGroups {
my ($output, $dataRows, $prevNextBar, $sth, @data, @row, $i);
if (WebGUI::Privilege::isInGroup(3)) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=10&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output = helpLink(10);
$output .= '<h1>'.WebGUI::International::get(89).'</h1>';
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=addGroup">'.WebGUI::International::get(90).'</a></div>';
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
$sth = WebGUI::SQL->read("select groupId,groupName,description from groups where groupName<>'Reserved' order by groupName",$session{dbh});
$sth = WebGUI::SQL->read("select groupId,groupName,description from groups where groupName<>'Reserved' order by groupName");
while (@data = $sth->array) {
$row[$i] = '<tr><td valign="top"><a href="'.$session{page}{url}.'?op=deleteGroup&gid='.$data[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?op=editGroup&gid='.$data[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a></td>';
$row[$i] .= '<td valign="top">'.$data[1].'</td>';
$row[$i] .= '<td valign="top">'.$data[2].'</td></tr>';
$row[$i] = '<tr><td valign="top" class="tableData"><a href="'.$session{page}{url}.'?op=deleteGroup&gid='.$data[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?op=editGroup&gid='.$data[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a></td>';
$row[$i] .= '<td valign="top" class="tableData">'.$data[1].'</td>';
$row[$i] .= '<td valign="top" class="tableData">'.$data[2].'</td></tr>';
$i++;
}
$sth->finish;

View file

@ -16,28 +16,28 @@ use Tie::CPHash;
use WebGUI::International;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Utility;
our @ISA = qw(Exporter);
our @EXPORT = qw(&www_viewHelp &www_viewHelpIndex);
#-------------------------------------------------------------------
sub www_viewHelp {
my ($output, %help, @data, $sth, %seeAlso);
my ($output, %help, @data, $sth, %seeAlso, $namespace);
$namespace = $session{form}{namespace} || "WebGUI";
tie %help, 'Tie::CPHash';
%help = WebGUI::SQL->quickHash("select * from help where helpId=$session{form}{hid} and namespace='$session{form}{namespace}' and language='$session{user}{language}'",$session{dbh});
%help = WebGUI::SQL->quickHash("select * from help where helpId=$session{form}{hid} and namespace='$namespace' and language='$session{user}{language}'");
$output = '<h1>'.WebGUI::International::get(93).': '.$help{action}.' '.$help{object}.'</h1>';
$help{body} =~ s/\n/\<br\>/g;
$output .= $help{body};
$output .= '<p><b>'.WebGUI::International::get(94).':';
$sth = WebGUI::SQL->read("select helpId, action, object, namespace from help where object='$help{object}' and action<>'$help{action}' and language='$session{user}{language}' order by action",$session{dbh});
$sth = WebGUI::SQL->read("select helpId, action, object, namespace from help where object='$help{object}' and action<>'$help{action}' and language='$session{user}{language}' order by action");
while (@data = $sth->array) {
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'&namespace='.$data[3].'">'.$data[1].' '.$data[2].'</a>,';
}
$sth->finish;
$sth = WebGUI::SQL->read("select helpId, namespace from helpSeeAlso where seeAlsoId in ($help{seeAlso})",$session{dbh});
$sth = WebGUI::SQL->read("select helpId, namespace from helpSeeAlso where seeAlsoId in ($help{seeAlso})");
while (@data = $sth->array) {
%seeAlso = WebGUI::SQL->quickHash("select helpId,namespace,action,object from help where helpId='$data[0]' and namespace='$data[1]' and language='$session{user}{language}'",$session{dbh});
%seeAlso = WebGUI::SQL->quickHash("select helpId,namespace,action,object from help where helpId='$data[0]' and namespace='$data[1]' and language='$session{user}{language}'");
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelp&hid='.$seeAlso{helpId}.'&namespace='.$seeAlso{namespace}.'">'.$seeAlso{action}.' '.$seeAlso{object}.'</a>,';
}
$sth->finish;
@ -50,7 +50,7 @@ sub www_viewHelpIndex {
my ($sth, @data, $output, $previous);
$output = '<h1>'.WebGUI::International::get(95).'</h1>';
$output .= '<table width="100%"><tr><td valign="top"><b>'.WebGUI::International::get(96).'</b><p>';
$sth = WebGUI::SQL->read("select helpId, action, object, namespace from help where language='$session{user}{language}' order by action,object",$session{dbh});
$sth = WebGUI::SQL->read("select helpId, action, object, namespace from help where language='$session{user}{language}' order by action,object");
while (@data = $sth->array) {
if ($data[1] ne $previous) {
$output .= '<p><b>'.$data[1].'</b><br>';
@ -60,7 +60,7 @@ sub www_viewHelpIndex {
}
$sth->finish;
$output .= '</td><td valign="top"><b>'.WebGUI::International::get(97).'</b><p>';
$sth = WebGUI::SQL->read("select helpId, object, action, namespace from help where language='$session{user}{language}' order by object,action",$session{dbh});
$sth = WebGUI::SQL->read("select helpId, object, action, namespace from help where language='$session{user}{language}' order by object,action");
while (@data = $sth->array) {
if ($data[1] ne $previous) {
$output .= '<p><b>'.$data[1].'</b><br>';

View file

@ -0,0 +1,83 @@
package WebGUI::Operation::Package;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001 Plain Black Software.
#-------------------------------------------------------------------
# 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 qw(vars subs);
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
our @ISA = qw(Exporter);
our @EXPORT = qw(&www_deployPackage &www_selectPackageToDeploy);
#-------------------------------------------------------------------
sub _duplicateWidgets {
my ($b, $widgetId, $widgetType, $func);
$b = WebGUI::SQL->read("select widgetId, widgetType from widget where pageId=$_[0]");
while (($widgetId,$widgetType) = $b->array) {
$func = "WebGUI::Widget::".$widgetType."::duplicate";
&$func($widgetId,$_[1]);
}
$b->finish;
}
#-------------------------------------------------------------------
sub _recursePageTree {
my ($a, %package, %newParent, $newPageId);
tie %newParent, 'Tie::CPHash';
tie %package, 'Tie::CPHash';
%newParent = WebGUI::SQL->quickHash("select * from page where pageId=$_[1]");
_duplicateWidgets($_[0],$_[1]);
$a = WebGUI::SQL->read("select * from page where parentId=$_[0]");
while (%package = $a->hash) {
$newPageId = getNextId("pageId");
WebGUI::SQL->write("insert into page values ($newPageId,$_[1],".quote($package{title}).",$newParent{styleId},$session{user}{userId},$newParent{ownerView},$newParent{ownerEdit},$newParent{groupId},$newParent{groupView},$newParent{groupEdit},$newParent{worldView},$newParent{worldEdit},$package{sequenceNumber},".quote($package{metaTags}).",".quote($package{urlizedTitle}).",$package{defaultMetaTags},".quote($package{template}).")");
_recursePageTree($package{pageId},$newPageId);
}
$a->finish;
}
#-------------------------------------------------------------------
sub www_selectPackageToDeploy {
my ($output, %data, $sth, $flag);
if (WebGUI::Privilege::canEditPage()) {
tie %data,'Tie::CPHash';
$output = helpLink(30);
$output .= '<h1>'.WebGUI::International::get(375).'</h1>';
$output .= '<ul>';
$sth = WebGUI::SQL->read("select * from page where parentId=5");
while (%data = $sth->hash) {
$output .= '<li> <a href="'.$session{page}{url}.'?op=deployPackage&pid='.$data{pageId}.'">'.$data{title}.'</a>';
$flag = 1;
}
$sth->finish;
$output .= WebGUI::International::get(377) unless $flag;
$output .= '</ul>';
return $output;
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_deployPackage {
if (WebGUI::Privilege::canEditPage()) {
_recursePageTree($session{form}{pid},$session{page}{pageId});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
1;

View file

@ -16,6 +16,7 @@ use WebGUI::Form;
use WebGUI::International;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Template;
use WebGUI::Utility;
@ -26,9 +27,9 @@ our @EXPORT = qw(&www_movePageUp &www_movePageDown &www_addPage &www_addPageSave
#-------------------------------------------------------------------
sub _recursivelyChangePrivileges {
my ($sth, $pageId);
$sth = WebGUI::SQL->read("select pageId from page where parentId=$_[0]",$session{dbh});
$sth = WebGUI::SQL->read("select pageId from page where parentId=$_[0]");
while (($pageId) = $sth->array) {
WebGUI::SQL->write("update page set ownerId=$session{form}{ownerId}, ownerView=$session{form}{ownerView}, ownerEdit=$session{form}{ownerEdit}, groupId='$session{form}{groupId}', groupView=$session{form}{groupView}, groupEdit=$session{form}{groupEdit}, worldView=$session{form}{worldView}, worldEdit=$session{form}{worldEdit} where pageId=$pageId",$session{dbh});
WebGUI::SQL->write("update page set ownerId=$session{form}{ownerId}, ownerView=$session{form}{ownerView}, ownerEdit=$session{form}{ownerEdit}, groupId='$session{form}{groupId}', groupView=$session{form}{groupView}, groupEdit=$session{form}{groupEdit}, worldView=$session{form}{worldView}, worldEdit=$session{form}{worldEdit} where pageId=$pageId");
_recursivelyChangePrivileges($pageId);
}
$sth->finish;
@ -37,9 +38,9 @@ sub _recursivelyChangePrivileges {
#-------------------------------------------------------------------
sub _recursivelyChangeStyle {
my ($sth, $pageId);
$sth = WebGUI::SQL->read("select pageId from page where parentId=$_[0]",$session{dbh});
$sth = WebGUI::SQL->read("select pageId from page where parentId=$_[0]");
while (($pageId) = $sth->array) {
WebGUI::SQL->write("update page set styleId=$session{form}{styleId} where pageId=$pageId",$session{dbh});
WebGUI::SQL->write("update page set styleId=$session{form}{styleId} where pageId=$pageId");
_recursivelyChangeStyle($pageId);
}
$sth->finish;
@ -48,9 +49,9 @@ sub _recursivelyChangeStyle {
#-------------------------------------------------------------------
sub _reorderPages {
my ($sth, $i, $pid);
$sth = WebGUI::SQL->read("select pageId from page where parentId=$_[0] order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select pageId from page where parentId=$_[0] order by sequenceNumber");
while (($pid) = $sth->array) {
WebGUI::SQL->write("update page set sequenceNumber='$i' where pageId=$pid",$session{dbh});
WebGUI::SQL->write("update page set sequenceNumber='$i' where pageId=$pid");
$i++;
}
$sth->finish;
@ -61,19 +62,19 @@ sub www_addPage {
my ($output, @array, %hash);
tie %hash, "Tie::IxHash";
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output = helpLink(1);
$output .= '<h1>'.WebGUI::International::get(98).'</h1>';
$output .= '<form method="post" action="'.$session{page}{url}.'">';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","addPageSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$session{form}{title}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$session{form}{title}));
%hash = sortHash(WebGUI::Template::getList());
$array[0] = "Default";
$output .= '<script language="JavaScript"> function updateTemplateImage(template) { document.template.src = "'.$session{setting}{lib}.'/templates/"+template+".gif"; } </script>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(356).'</td><td>'.WebGUI::Form::selectList("template",\%hash, \@array, 1, 0, "updateTemplateImage(this.form.template.value)").'<br><img src="'.$session{setting}{lib}.'/templates/Default.gif" name="template"></td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(100).'</td><td>'.WebGUI::Form::textArea("metaTags",$session{form}{metaTags}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(307).'</td><td>'.WebGUI::Form::checkbox("defaultMetaTags",1,1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(356),WebGUI::Form::selectList("template",\%hash, \@array, 1, 0, "updateTemplateImage(this.form.template.value)").'<br><img src="'.$session{setting}{lib}.'/templates/Default.gif" name="template">');
$output .= tableFormRow(WebGUI::International::get(100),WebGUI::Form::textArea("metaTags",$session{form}{metaTags}));
$output .= tableFormRow(WebGUI::International::get(307),WebGUI::Form::checkbox("defaultMetaTags",1,1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -85,12 +86,12 @@ sub www_addPage {
sub www_addPageSave {
my ($urlizedTitle, $test, $nextSeq);
if (WebGUI::Privilege::canEditPage()) {
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from page where parentId=$session{page}{pageId}",$session{dbh});
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from page where parentId=$session{page}{pageId}");
$urlizedTitle = urlize($session{form}{title});
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$urlizedTitle'",$session{dbh})) {
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$urlizedTitle'")) {
$urlizedTitle .= 2;
}
WebGUI::SQL->write("insert into page values (".getNextId("pageId").", $session{page}{pageId}, ".quote($session{form}{title}).", $session{page}{styleId}, $session{user}{userId}, $session{page}{ownerView}, $session{page}{ownerEdit}, $session{page}{groupId}, $session{page}{groupView}, $session{page}{groupEdit}, $session{page}{worldView}, $session{page}{worldEdit}, '$nextSeq', ".quote($session{form}{metaTags}).", '$urlizedTitle', '$session{form}{defaultMetaTags}', '$session{form}{template}')",$session{dbh});
WebGUI::SQL->write("insert into page values (".getNextId("pageId").", $session{page}{pageId}, ".quote($session{form}{title}).", $session{page}{styleId}, $session{user}{userId}, $session{page}{ownerView}, $session{page}{ownerEdit}, $session{page}{groupId}, $session{page}{groupView}, $session{page}{groupEdit}, $session{page}{worldView}, $session{page}{worldEdit}, '$nextSeq', ".quote($session{form}{metaTags}).", '$urlizedTitle', '$session{form}{defaultMetaTags}', '$session{form}{template}')");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -102,7 +103,7 @@ sub www_cutPage {
if ($session{page}{pageId} < 26) {
return WebGUI::Privilege::vitalComponent();
} elsif (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update page set parentId=2 where pageId=".$session{page}{pageId},$session{dbh});
WebGUI::SQL->write("update page set parentId=2 where pageId=".$session{page}{pageId});
_reorderPages($session{page}{parentId});
WebGUI::Session::refreshPageInfo($session{page}{parentId});
return "";
@ -117,7 +118,7 @@ sub www_deletePage {
if ($session{page}{pageId} < 26) {
return WebGUI::Privilege::vitalComponent();
} elsif (WebGUI::Privilege::canEditPage()) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=3&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(3);
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(101).'<p>';
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deletePageConfirm">'.WebGUI::International::get(44).'</a>';
@ -133,7 +134,7 @@ sub www_deletePageConfirm {
if ($session{page}{pageId} < 25) {
return WebGUI::Privilege::vitalComponent();
} elsif (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update page set parentId=3 where pageId=".$session{page}{pageId},$session{dbh});
WebGUI::SQL->write("update page set parentId=3 where pageId=".$session{page}{pageId});
_reorderPages($session{page}{parentId});
WebGUI::Session::refreshPageInfo($session{page}{parentId});
return "";
@ -148,46 +149,46 @@ sub www_editPage {
tie %hash, "Tie::IxHash";
if (WebGUI::Privilege::canEditPage()) {
%yesNo = ("0"=>"No", "1"=>"Yes");
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output = helpLink(1);
$output .= '<h1>'.WebGUI::International::get(102).'</h1>';
$output .= '<form method="post" action="'.$session{page}{url}.'">';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editPageSave");
$output .= '<table>';
$output .= '<tr><td colspan=2><b>'.WebGUI::International::get(103).'</b></td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$session{page}{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(104).'</td><td>'.WebGUI::Form::text("urlizedTitle",20,128,$session{page}{urlizedTitle}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$session{page}{title}));
$output .= tableFormRow(WebGUI::International::get(104),WebGUI::Form::text("urlizedTitle",20,128,$session{page}{urlizedTitle}));
%hash = sortHash(WebGUI::Template::getList());
$array[0] = $session{page}{template};
$output .= '<script language="JavaScript"> function updateTemplateImage(template) { document.template.src = "'.$session{setting}{lib}.'/templates/"+template+".gif"; } </script>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(356).'</td><td>'.WebGUI::Form::selectList("template",\%hash,\@array,1,0,"updateTemplateImage(this.form.template.value)").'<br><img src="'.$session{setting}{lib}.'/templates/'.$session{page}{template}.'.gif" name="template"></td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(100).'</td><td>'.WebGUI::Form::textArea("metaTags",$session{page}{metaTags}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(307).'</td><td>'.WebGUI::Form::checkbox("defaultMetaTags",1,$session{page}{defaultMetaTags}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(356),WebGUI::Form::selectList("template",\%hash,\@array,1,0,"updateTemplateImage(this.form.template.value)").'<br><img src="'.$session{setting}{lib}.'/templates/'.$session{page}{template}.'.gif" name="template">');
$output .= tableFormRow(WebGUI::International::get(100),WebGUI::Form::textArea("metaTags",$session{page}{metaTags}));
$output .= tableFormRow(WebGUI::International::get(307),WebGUI::Form::checkbox("defaultMetaTags",1,$session{page}{defaultMetaTags}));
$output .= '<tr><td colspan=2><hr size=1><b>'.WebGUI::International::get(105).'</b></td></tr>';
%hash = WebGUI::SQL->buildHash("select styleId,name from style where name<>'Reserved' order by name",$session{dbh});
%hash = WebGUI::SQL->buildHash("select styleId,name from style where name<>'Reserved' order by name");
$array[0] = $session{page}{styleId};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(105).'</td><td>'.WebGUI::Form::selectList("styleId",\%hash,\@array).' <span class="formSubtext"><a href="'.$session{page}{url}.'?op=listStyles">'.WebGUI::International::get(6).'</a></span></td></tr>';
$output .= '<tr><td class="formDescription"></td><td>'.WebGUI::Form::checkbox("recurseStyle","yes").' <span class="formSubtext">'.WebGUI::International::get(106).'</span></td></tr>';
$output .= tableFormRow(WebGUI::International::get(105),WebGUI::Form::selectList("styleId",\%hash,\@array).' <span class="formSubtext"><a href="'.$session{page}{url}.'?op=listStyles">'.WebGUI::International::get(6).'</a></span>');
$output .= tableFormRow("",WebGUI::Form::checkbox("recurseStyle","yes").' <span class="formSubtext">'.WebGUI::International::get(106).'</span>');
$output .= '<tr><td colspan=2><hr size=1><b>'.WebGUI::International::get(107).'</b></td></tr>';
%hash = WebGUI::SQL->buildHash("select users.userId,users.username from users,groupings where groupings.groupId=4 and groupings.userId=users.userId order by users.username",$session{dbh});
%hash = WebGUI::SQL->buildHash("select users.userId,users.username from users,groupings where groupings.groupId=4 and groupings.userId=users.userId order by users.username");
$array[0] = $session{page}{ownerId};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(108).'</td><td>'.WebGUI::Form::selectList("ownerId",\%hash,\@array).' <span class="formSubtext"><a href="'.$session{page}{url}.'?op=listUsers">'.WebGUI::International::get(7).'</a></span></td></tr>';
$output .= tableFormRow(WebGUI::International::get(108),WebGUI::Form::selectList("ownerId",\%hash,\@array).' <span class="formSubtext"><a href="'.$session{page}{url}.'?op=listUsers">'.WebGUI::International::get(7).'</a></span>');
$array[0] = $session{page}{ownerView};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(109).'</td><td>'.WebGUI::Form::selectList("ownerView",\%yesNo,\@array).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(109),WebGUI::Form::selectList("ownerView",\%yesNo,\@array));
$array[0] = $session{page}{ownerEdit};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(110).'</td><td>'.WebGUI::Form::selectList("ownerEdit",\%yesNo,\@array).'</td></tr>';
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName",$session{dbh});
$output .= tableFormRow(WebGUI::International::get(110),WebGUI::Form::selectList("ownerEdit",\%yesNo,\@array));
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName");
$array[0] = $session{page}{groupId};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(111).'</td><td>'.WebGUI::Form::selectList("groupId",\%hash,\@array).' <span class="formSubtext"><a href="'.$session{page}{url}.'?op=listGroups">'.WebGUI::International::get(5).'</a></span></td></tr>';
$output .= tableFormRow(WebGUI::International::get(111),WebGUI::Form::selectList("groupId",\%hash,\@array).' <span class="formSubtext"><a href="'.$session{page}{url}.'?op=listGroups">'.WebGUI::International::get(5).'</a></span>');
$array[0] = $session{page}{groupView};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(112).'</td><td>'.WebGUI::Form::selectList("groupView",\%yesNo,\@array).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(112),WebGUI::Form::selectList("groupView",\%yesNo,\@array));
$array[0] = $session{page}{groupEdit};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(113).'</td><td>'.WebGUI::Form::selectList("groupEdit",\%yesNo,\@array).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(113),WebGUI::Form::selectList("groupEdit",\%yesNo,\@array));
$array[0] = $session{page}{worldView};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(114).'</td><td>'.WebGUI::Form::selectList("worldView",\%yesNo,\@array).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(114),WebGUI::Form::selectList("worldView",\%yesNo,\@array));
$array[0] = $session{page}{worldEdit};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(115).'</td><td>'.WebGUI::Form::selectList("worldEdit",\%yesNo,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription"></td><td>'.WebGUI::Form::checkbox("recursePrivs","yes").' <span class="formSubtext">'.WebGUI::International::get(116).'</span></td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(115),WebGUI::Form::selectList("worldEdit",\%yesNo,\@array));
$output .= tableFormRow("",WebGUI::Form::checkbox("recursePrivs","yes").' <span class="formSubtext">'.WebGUI::International::get(116).'</span>');
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -200,10 +201,10 @@ sub www_editPageSave {
my (%parent, $urlizedTitle, $test);
if (WebGUI::Privilege::canEditPage()) {
$urlizedTitle = urlize($session{form}{urlizedTitle});
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$urlizedTitle' and pageId<>$session{page}{pageId}",$session{dbh})) {
while (($test) = WebGUI::SQL->quickArray("select urlizedTitle from page where urlizedTitle='$urlizedTitle' and pageId<>$session{page}{pageId}")) {
$urlizedTitle .= 2;
}
WebGUI::SQL->write("update page set title=".quote($session{form}{title}).", styleId=$session{form}{styleId}, ownerId=$session{form}{ownerId}, ownerView=$session{form}{ownerView}, ownerEdit=$session{form}{ownerEdit}, groupId='$session{form}{groupId}', groupView=$session{form}{groupView}, groupEdit=$session{form}{groupEdit}, worldView=$session{form}{worldView}, worldEdit=$session{form}{worldEdit}, metaTags=".quote($session{form}{metaTags}).", urlizedTitle='$urlizedTitle', defaultMetaTags='$session{form}{defaultMetaTags}', template='$session{form}{template}' where pageId=$session{page}{pageId}",$session{dbh});
WebGUI::SQL->write("update page set title=".quote($session{form}{title}).", styleId=$session{form}{styleId}, ownerId=$session{form}{ownerId}, ownerView=$session{form}{ownerView}, ownerEdit=$session{form}{ownerEdit}, groupId='$session{form}{groupId}', groupView=$session{form}{groupView}, groupEdit=$session{form}{groupEdit}, worldView=$session{form}{worldView}, worldEdit=$session{form}{worldEdit}, metaTags=".quote($session{form}{metaTags}).", urlizedTitle='$urlizedTitle', defaultMetaTags='$session{form}{defaultMetaTags}', template='$session{form}{template}' where pageId=$session{page}{pageId}");
if ($session{form}{recurseStyle} eq "yes") {
_recursivelyChangeStyle($session{page}{pageId});
}
@ -221,11 +222,11 @@ sub www_editPageSave {
sub www_movePageDown {
my (@data, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from page where pageId=$session{page}{pageId}",$session{dbh});
@data = WebGUI::SQL->quickArray("select pageId from page where parentId=$session{page}{parentId} and sequenceNumber=$thisSeq+1",$session{dbh});
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from page where pageId=$session{page}{pageId}");
@data = WebGUI::SQL->quickArray("select pageId from page where parentId=$session{page}{parentId} and sequenceNumber=$thisSeq+1");
if ($data[0] ne "") {
WebGUI::SQL->write("update page set sequenceNumber=sequenceNumber+1 where pageId=$session{page}{pageId}",$session{dbh});
WebGUI::SQL->write("update page set sequenceNumber=sequenceNumber-1 where pageId=$data[0]",$session{dbh});
WebGUI::SQL->write("update page set sequenceNumber=sequenceNumber+1 where pageId=$session{page}{pageId}");
WebGUI::SQL->write("update page set sequenceNumber=sequenceNumber-1 where pageId=$data[0]");
}
return "";
} else {
@ -237,11 +238,11 @@ sub www_movePageDown {
sub www_movePageUp {
my (@data, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from page where pageId=$session{page}{pageId}",$session{dbh});
@data = WebGUI::SQL->quickArray("select pageId from page where parentId=$session{page}{parentId} and sequenceNumber=$thisSeq-1",$session{dbh});
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from page where pageId=$session{page}{pageId}");
@data = WebGUI::SQL->quickArray("select pageId from page where parentId=$session{page}{parentId} and sequenceNumber=$thisSeq-1");
if ($data[0] ne "") {
WebGUI::SQL->write("update page set sequenceNumber=sequenceNumber-1 where pageId=$session{page}{pageId}",$session{dbh});
WebGUI::SQL->write("update page set sequenceNumber=sequenceNumber+1 where pageId=$data[0]",$session{dbh});
WebGUI::SQL->write("update page set sequenceNumber=sequenceNumber-1 where pageId=$session{page}{pageId}");
WebGUI::SQL->write("update page set sequenceNumber=sequenceNumber+1 where pageId=$data[0]");
}
return "";
} else {
@ -252,9 +253,9 @@ sub www_movePageUp {
#-------------------------------------------------------------------
sub www_pastePage {
my ($output, $nextSeq);
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from page where parentId=$session{page}{pageId}",$session{dbh});
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from page where parentId=$session{page}{pageId}");
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update page set parentId=$session{page}{pageId}, sequenceNumber='$nextSeq' where pageId=$session{form}{pageId}",$session{dbh});
WebGUI::SQL->write("update page set parentId=$session{page}{pageId}, sequenceNumber='$nextSeq' where pageId=$session{form}{pageId}");
_reorderPages($session{page}{pageId});
return "";
} else {
@ -264,3 +265,4 @@ sub www_pastePage {
1;

View file

@ -16,6 +16,7 @@ use Tie::IxHash;
use WebGUI::International;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
@ -26,7 +27,7 @@ our @EXPORT = qw(&www_search);
sub www_search {
my ($dataRows, $prevNextBar, $output, %page, @keyword, $pageId, $term, %result, $sth, @data, @row, $i);
tie %result,'Tie::IxHash';
$output = '<form method="post" action="'.$session{page}{url}.'">';
$output = formHeader();
$output .= WebGUI::Form::hidden("op","search");
$output .= WebGUI::Form::text("keywords",40,100,$session{form}{keywords});
$output .= WebGUI::Form::submit(WebGUI::International::get(364));
@ -34,34 +35,34 @@ sub www_search {
if ($session{form}{keywords} ne "") {
@keyword = split(" ",$session{form}{keywords});
foreach $term (@keyword) {
$sth = WebGUI::SQL->read("select pageId from page where title like '%".$term."%' and pageId > 25",$session{dbh});
$sth = WebGUI::SQL->read("select pageId from page where title like '%".$term."%' and pageId > 25");
while (@data = $sth->array) {
$result{$data[0]} += 5;
}
$sth->finish;
$sth = WebGUI::SQL->read("select pageId from page where metaTags like '%".$term."%' and pageId > 25",$session{dbh});
$sth = WebGUI::SQL->read("select pageId from page where metaTags like '%".$term."%' and pageId > 25");
while (@data = $sth->array) {
$result{$data[0]} += 1;
}
$sth->finish;
$sth = WebGUI::SQL->read("select pageId from widget where title like '%".$term."%' and pageId > 25",$session{dbh});
$sth = WebGUI::SQL->read("select pageId from widget where title like '%".$term."%' and pageId > 25");
while (@data = $sth->array) {
$result{$data[0]} += 5;
}
$sth->finish;
$sth = WebGUI::SQL->read("select pageId from widget where description like '%".$term."%' and pageId > 25",$session{dbh});
$sth = WebGUI::SQL->read("select pageId from widget where description like '%".$term."%' and pageId > 25");
while (@data = $sth->array) {
$result{$data[0]} += 2;
}
$sth->finish;
$sth = WebGUI::SQL->read("select widget.pageId from Article,widget where Article.widgetId=widget.widgetId and Article.body like '%".$term."%'",$session{dbh});
$sth = WebGUI::SQL->read("select widget.pageId from Article,widget where Article.widgetId=widget.widgetId and Article.body like '%".$term."%'");
while (@data = $sth->array) {
$result{$data[0]} += 2;
}
$sth->finish;
%result = sortHashDescending(%result);
foreach $pageId (keys %result) {
%page = WebGUI::SQL->quickHash("select pageId, title, urlizedTitle from page where pageId=$pageId",$session{dbh});
%page = WebGUI::SQL->quickHash("select pageId, title, urlizedTitle from page where pageId=$pageId");
$row[$i] = '<li><a href="'.$session{ENV}{SCRIPT_NAME}.'/'.$page{urlizedTitle}.'">'.$page{title}.'</a>';
$i++;
}

View file

@ -16,8 +16,8 @@ use WebGUI::Form;
use WebGUI::International;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
our @ISA = qw(Exporter);
our @EXPORT = qw(&www_editProfileSettings &www_editProfileSettingsSave &www_editAuthenticationSettings &www_editAuthenticationSettingsSave &www_editCompanyInformation &www_editCompanyInformationSave &www_editFileSettings &www_editFileSettingsSave &www_editMailSettings &www_editMailSettingsSave &www_editMiscSettings &www_editMiscSettingsSave &www_manageSettings);
@ -28,22 +28,22 @@ sub www_editAuthenticationSettings {
%authMethod = ('WebGUI'=>'WebGUI', 'LDAP'=>'LDAP');
%yesNo = ('yes'=>WebGUI::International::get(138), 'no'=>WebGUI::International::get(139));
if (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=2&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(2);
$output .= '<h1>'.WebGUI::International::get(117).'</h1>';
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editAuthenticationSettingsSave");
$output .= '<table>';
$array[0] = $session{setting}{anonymousRegistration};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(118).'</td><td>'.WebGUI::Form::selectList("anonymousRegistration",\%yesNo, \@array).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(118),WebGUI::Form::selectList("anonymousRegistration",\%yesNo, \@array));
$array[0] = $session{setting}{authMethod};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(119).'</td><td>'.WebGUI::Form::selectList("authMethod",\%authMethod, \@array).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(119),WebGUI::Form::selectList("authMethod",\%authMethod, \@array));
$array[0] = $session{setting}{usernameBinding};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(306).'</td><td>'.WebGUI::Form::selectList("usernameBinding",\%yesNo, \@array).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(120).'</td><td>'.WebGUI::Form::text("ldapURL",30,2048,$session{setting}{ldapURL}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(121).'</td><td>'.WebGUI::Form::text("ldapId",30,100,$session{setting}{ldapId}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(122).'</td><td>'.WebGUI::Form::text("ldapIdName",30,100,$session{setting}{ldapIdName}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(123).'</td><td>'.WebGUI::Form::text("ldapPasswordName",30,100,$session{setting}{ldapPasswordName}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(306),WebGUI::Form::selectList("usernameBinding",\%yesNo, \@array));
$output .= tableFormRow(WebGUI::International::get(120),WebGUI::Form::text("ldapURL",30,2048,$session{setting}{ldapURL}));
$output .= tableFormRow(WebGUI::International::get(121),WebGUI::Form::text("ldapId",30,100,$session{setting}{ldapId}));
$output .= tableFormRow(WebGUI::International::get(122),WebGUI::Form::text("ldapIdName",30,100,$session{setting}{ldapIdName}));
$output .= tableFormRow(WebGUI::International::get(123),WebGUI::Form::text("ldapPasswordName",30,100,$session{setting}{ldapPasswordName}));
$output .= formSave();
$output .= '</table>';
$output .= '</form> ';
} else {
@ -55,13 +55,13 @@ sub www_editAuthenticationSettings {
#-------------------------------------------------------------------
sub www_editAuthenticationSettingsSave {
if (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("update settings set value=".quote($session{form}{authMethod})." where name='authMethod'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{ldapURL})." where name='ldapURL'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{ldapId})." where name='ldapId'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{ldapIdName})." where name='ldapIdName'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{ldapPasswordName})." where name='ldapPasswordName'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{anonymousRegistration})." where name='anonymousRegistration'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{usernameBinding})." where name='usernameBinding'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{authMethod})." where name='authMethod'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{ldapURL})." where name='ldapURL'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{ldapId})." where name='ldapId'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{ldapIdName})." where name='ldapIdName'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{ldapPasswordName})." where name='ldapPasswordName'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{anonymousRegistration})." where name='anonymousRegistration'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{usernameBinding})." where name='usernameBinding'");
return www_manageSettings();
} else {
return WebGUI::Privilege::adminOnly();
@ -72,15 +72,15 @@ sub www_editAuthenticationSettingsSave {
sub www_editCompanyInformation {
my ($output);
if (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=6&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(6);
$output .= '<h1>'.WebGUI::International::get(124).'</h1>';
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editCompanyInformationSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(125).'</td><td>'.WebGUI::Form::text("companyName",30,255,$session{setting}{companyName}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(126).'</td><td>'.WebGUI::Form::text("companyEmail",30,255,$session{setting}{companyEmail}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(127).'</td><td>'.WebGUI::Form::text("companyURL",30,2048,$session{setting}{companyURL}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(125),WebGUI::Form::text("companyName",30,255,$session{setting}{companyName}));
$output .= tableFormRow(WebGUI::International::get(126),WebGUI::Form::text("companyEmail",30,255,$session{setting}{companyEmail}));
$output .= tableFormRow(WebGUI::International::get(127),WebGUI::Form::text("companyURL",30,2048,$session{setting}{companyURL}));
$output .= formSave();
$output .= '</table>';
$output .= '</form> ';
} else {
@ -92,9 +92,9 @@ sub www_editCompanyInformation {
#-------------------------------------------------------------------
sub www_editCompanyInformationSave {
if (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("update settings set value=".quote($session{form}{companyName})." where name='companyName'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{companyEmail})." where name='companyEmail'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{companyURL})." where name='companyURL'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{companyName})." where name='companyName'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{companyEmail})." where name='companyEmail'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{companyURL})." where name='companyURL'");
return www_manageSettings();
} else {
return WebGUI::Privilege::adminOnly();
@ -105,16 +105,16 @@ sub www_editCompanyInformationSave {
sub www_editFileSettings {
my ($output);
if (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=11&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(11);
$output .= '<h1>'.WebGUI::International::get(128).'</h1>';
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editFileSettingsSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(129).'</td><td>'.WebGUI::Form::text("lib",30,255,$session{setting}{lib}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(130).'</td><td>'.WebGUI::Form::text("maxAttachmentSize",30,11,$session{setting}{maxAttachmentSize}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(131).'</td><td>'.WebGUI::Form::text("attachmentDirectoryWeb",30,255,$session{setting}{attachmentDirectoryWeb}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(132).'</td><td>'.WebGUI::Form::text("attachmentDirectoryLocal",30,255,$session{setting}{attachmentDirectoryLocal}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(129),WebGUI::Form::text("lib",30,255,$session{setting}{lib}));
$output .= tableFormRow(WebGUI::International::get(130),WebGUI::Form::text("maxAttachmentSize",30,11,$session{setting}{maxAttachmentSize}));
$output .= tableFormRow(WebGUI::International::get(131),WebGUI::Form::text("attachmentDirectoryWeb",30,255,$session{setting}{attachmentDirectoryWeb}));
$output .= tableFormRow(WebGUI::International::get(132),WebGUI::Form::text("attachmentDirectoryLocal",30,255,$session{setting}{attachmentDirectoryLocal}));
$output .= formSave();
$output .= '</table>';
$output .= '</form> ';
} else {
@ -126,10 +126,10 @@ sub www_editFileSettings {
#-------------------------------------------------------------------
sub www_editFileSettingsSave {
if (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("update settings set value=".quote($session{form}{lib})." where name='lib'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{maxAttachmentSize})." where name='maxAttachmentSize'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{attachmentDirectoryWeb})." where name='attachmentDirectoryWeb'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{attachmentDirectoryLocal})." where name='attachmentDirectoryLocal'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{lib})." where name='lib'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{maxAttachmentSize})." where name='maxAttachmentSize'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{attachmentDirectoryWeb})." where name='attachmentDirectoryWeb'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{attachmentDirectoryLocal})." where name='attachmentDirectoryLocal'");
return www_manageSettings();
} else {
return WebGUI::Privilege::adminOnly();
@ -140,14 +140,14 @@ sub www_editFileSettingsSave {
sub www_editMailSettings {
my ($output);
if (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=13&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(13);
$output .= '<h1>'.WebGUI::International::get(133).'</h1>';
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editMailSettingsSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(134).'</td><td>'.WebGUI::Form::textArea("recoverPasswordEmail",$session{setting}{recoverPasswordEmail}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(135).'</td><td>'.WebGUI::Form::text("smtpServer",30,255,$session{setting}{smtpServer}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(134),WebGUI::Form::textArea("recoverPasswordEmail",$session{setting}{recoverPasswordEmail}));
$output .= tableFormRow(WebGUI::International::get(135),WebGUI::Form::text("smtpServer",30,255,$session{setting}{smtpServer}));
$output .= formSave();
$output .= '</table>';
$output .= '</form> ';
} else {
@ -159,8 +159,8 @@ sub www_editMailSettings {
#-------------------------------------------------------------------
sub www_editMailSettingsSave {
if (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("update settings set value=".quote($session{form}{recoverPasswordEmail})." where name='recoverPasswordEmail'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{smtpServer})." where name='smtpServer'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{recoverPasswordEmail})." where name='recoverPasswordEmail'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{smtpServer})." where name='smtpServer'");
return www_manageSettings();
} else {
return WebGUI::Privilege::adminOnly();
@ -172,15 +172,15 @@ sub www_editMiscSettings {
my ($output, @array, %notFoundPage);
%notFoundPage = (1=>WebGUI::International::get(136), 4=>WebGUI::International::get(137));
if (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=24&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(24);
$output .= '<h1>'.WebGUI::International::get(140).'</h1>';
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editMiscSettingsSave");
$output .= '<table>';
$array[0] = $session{setting}{notFoundPage};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(141).'</td><td>'.WebGUI::Form::selectList("notFoundPage",\%notFoundPage,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(142).'</td><td>'.WebGUI::Form::text("sessionTimeout",30,11,$session{setting}{sessionTimeout}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(141),WebGUI::Form::selectList("notFoundPage",\%notFoundPage,\@array));
$output .= tableFormRow(WebGUI::International::get(142),WebGUI::Form::text("sessionTimeout",30,11,$session{setting}{sessionTimeout}));
$output .= formSave();
$output .= '</table>';
$output .= '</form> ';
} else {
@ -192,8 +192,8 @@ sub www_editMiscSettings {
#-------------------------------------------------------------------
sub www_editMiscSettingsSave {
if (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("update settings set value=".quote($session{form}{sessionTimeout})." where name='sessionTimeout'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{notFoundPage})." where name='notFoundPage'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{sessionTimeout})." where name='sessionTimeout'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{notFoundPage})." where name='notFoundPage'");
return www_manageSettings();
} else {
return WebGUI::Privilege::adminOnly();
@ -205,22 +205,22 @@ sub www_editProfileSettings {
my ($output, @array, %yesNo);
%yesNo = ('1'=>WebGUI::International::get(138), '0'=>WebGUI::International::get(139));
if (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=22&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(22);
$output .= '<h1>'.WebGUI::International::get(308).'</h1>';
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editProfileSettingsSave");
$output .= '<table>';
$array[0] = $session{setting}{profileName};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(309).'</td><td>'.WebGUI::Form::selectList("profileName",\%yesNo,\@array).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(309),WebGUI::Form::selectList("profileName",\%yesNo,\@array));
$array[0] = $session{setting}{profileExtraContact};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(310).'</td><td>'.WebGUI::Form::selectList("profileExtraContact",\%yesNo,\@array).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(310),WebGUI::Form::selectList("profileExtraContact",\%yesNo,\@array));
$array[0] = $session{setting}{profileHome};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(311).'</td><td>'.WebGUI::Form::selectList("profileHome",\%yesNo,\@array).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(311),WebGUI::Form::selectList("profileHome",\%yesNo,\@array));
$array[0] = $session{setting}{profileWork};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(312).'</td><td>'.WebGUI::Form::selectList("profileWork",\%yesNo,\@array).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(312),WebGUI::Form::selectList("profileWork",\%yesNo,\@array));
$array[0] = $session{setting}{profileMisc};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(313).'</td><td>'.WebGUI::Form::selectList("profileMisc",\%yesNo,\@array).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(313),WebGUI::Form::selectList("profileMisc",\%yesNo,\@array));
$output .= formSave();
$output .= '</table>';
$output .= '</form> ';
} else {
@ -232,11 +232,11 @@ sub www_editProfileSettings {
#-------------------------------------------------------------------
sub www_editProfileSettingsSave {
if (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileName})." where name='profileName'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileExtraContact})." where name='profileExtraContact'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileHome})." where name='profileHome'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileWork})." where name='profileWork'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileMisc})." where name='profileMisc'",$session{dbh});
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileName})." where name='profileName'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileExtraContact})." where name='profileExtraContact'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileHome})." where name='profileHome'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileWork})." where name='profileWork'");
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileMisc})." where name='profileMisc'");
return www_manageSettings();
} else {
return WebGUI::Privilege::adminOnly();
@ -247,7 +247,7 @@ sub www_editProfileSettingsSave {
sub www_manageSettings {
my ($output);
if (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(12);
$output .= '<h1>'.WebGUI::International::get(143).'</h1>';
$output .= '<ul>';
$output .= '<li><a href="'.$session{page}{url}.'?op=editAuthenticationSettings">'.WebGUI::International::get(117).'</a>';

View file

@ -18,6 +18,7 @@ use strict;
use WebGUI::International;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
our @ISA = qw(Exporter);
@ -37,19 +38,19 @@ sub www_viewStatistics {
$response = $userAgent->request($request);
$version = $response->content;
chomp $version;
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(12);
$output .= '<h1>'.WebGUI::International::get(144).'</h1>';
$output .= '<table>';
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(145).'</td><td class="tableData">'.$WebGUI::VERSION.' ('.WebGUI::International::get(349).': '.$version.')</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from session",$session{dbh});
($data) = WebGUI::SQL->quickArray("select count(*) from session");
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(146).'</td><td class="tableData">'.$data.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*)+1 from page where parentId>25",$session{dbh});
($data) = WebGUI::SQL->quickArray("select count(*)+1 from page where parentId>25");
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(147).'</td><td class="tableData">'.$data.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from page where pageId>25 or pageId=0",$session{dbh});
($data) = WebGUI::SQL->quickArray("select count(*) from page where pageId>25 or pageId=0");
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(148).'</td><td class="tableData">'.$data.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from users where userId>25",$session{dbh});
($data) = WebGUI::SQL->quickArray("select count(*) from users where userId>25");
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(149).'</td><td class="tableData">'.$data.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from groups where groupId>25",$session{dbh});
($data) = WebGUI::SQL->quickArray("select count(*) from groups where groupId>25");
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(89).'</td><td class="tableData">'.$data.'</td></tr>';
$output .= '</table>';
} else {

View file

@ -17,6 +17,7 @@ use WebGUI::Form;
use WebGUI::International;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
@ -27,16 +28,16 @@ our @EXPORT = qw(&www_copyStyle &www_addStyle &www_addStyleSave &www_deleteStyle
sub www_addStyle {
my ($output);
if (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=16&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(16);
$output .= '<h1>'.WebGUI::International::get(150).'</h1>';
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","addStyleSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(151).'</td><td>'.WebGUI::Form::text("name",20,30).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(152).'</td><td>'.WebGUI::Form::textArea("header",'',50,10).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(153).'</td><td>'.WebGUI::Form::textArea("footer",'',50,10).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(154).'</td><td>'.WebGUI::Form::textArea("styleSheet","<style>\n\n</style>",50,10).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(151),WebGUI::Form::text("name",20,30));
$output .= tableFormRow(WebGUI::International::get(152),WebGUI::Form::textArea("header",'',50,10));
$output .= tableFormRow(WebGUI::International::get(153),WebGUI::Form::textArea("footer",'',50,10));
$output .= tableFormRow(WebGUI::International::get(154),WebGUI::Form::textArea("styleSheet","<style>\n\n</style>",50,10));
$output .= formSave();
$output .= '</table>';
$output .= '</form> ';
} else {
@ -49,7 +50,7 @@ sub www_addStyle {
sub www_addStyleSave {
my ($output);
if (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("insert into style values (".getNextId("styleId").", ".quote($session{form}{name}).", ".quote($session{form}{header}).", ".quote($session{form}{footer}).", ".quote($session{form}{styleSheet}).")",$session{dbh});
WebGUI::SQL->write("insert into style values (".getNextId("styleId").", ".quote($session{form}{name}).", ".quote($session{form}{header}).", ".quote($session{form}{footer}).", ".quote($session{form}{styleSheet}).")");
$output = www_listStyles();
} else {
$output = WebGUI::Privilege::adminOnly();
@ -61,8 +62,8 @@ sub www_addStyleSave {
sub www_copyStyle {
my (%style);
if (WebGUI::Privilege::isInGroup(3)) {
%style = WebGUI::SQL->quickHash("select * from style where styleId=$session{form}{sid}",$session{dbh});
WebGUI::SQL->write("insert into style values (".getNextId("styleId").", ".quote('Copy of '.$style{name}).", ".quote($style{header}).", ".quote($style{footer}).", ".quote($style{styleSheet}).")",$session{dbh});
%style = WebGUI::SQL->quickHash("select * from style where styleId=$session{form}{sid}");
WebGUI::SQL->write("insert into style values (".getNextId("styleId").", ".quote('Copy of '.$style{name}).", ".quote($style{header}).", ".quote($style{footer}).", ".quote($style{styleSheet}).")");
return www_listStyles();
} else {
return WebGUI::Privilege::adminOnly();
@ -75,7 +76,8 @@ sub www_deleteStyle {
if ($session{form}{sid} < 26) {
return WebGUI::Privilege::vitalComponent();
} elsif (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=4&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>'.WebGUI::International::get(42).'</h1>';
$output .= helpLink(4);
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(155).'<p>';
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deleteStyleConfirm&sid='.$session{form}{sid}.'">'.WebGUI::International::get(44).'</a>';
$output .= '&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.$session{page}{url}.'?op=listStyles">'.WebGUI::International::get(45).'</a></div>';
@ -90,8 +92,8 @@ sub www_deleteStyleConfirm {
if ($session{form}{sid} < 26) {
return WebGUI::Privilege::vitalComponent();
} elsif (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("delete from style where styleId=".$session{form}{sid},$session{dbh});
WebGUI::SQL->write("update page set styleId=2 where styleId=".$session{form}{sid},$session{dbh});
WebGUI::SQL->write("delete from style where styleId=".$session{form}{sid});
WebGUI::SQL->write("update page set styleId=2 where styleId=".$session{form}{sid});
return www_listStyles();
} else {
return WebGUI::Privilege::adminOnly();
@ -103,18 +105,18 @@ sub www_editStyle {
my ($output, %style);
tie %style, 'Tie::CPHash';
if (WebGUI::Privilege::isInGroup(3)) {
%style = WebGUI::SQL->quickHash("select * from style where styleId=$session{form}{sid}",$session{dbh});
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=16&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
%style = WebGUI::SQL->quickHash("select * from style where styleId=$session{form}{sid}");
$output .= helpLink(16);
$output .= '<h1>'.WebGUI::International::get(156).'</h1>';
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editStyleSave");
$output .= WebGUI::Form::hidden("sid",$session{form}{sid});
$output .= '<table>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(151).'</td><td>'.WebGUI::Form::text("name",20,30,$style{name}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(152).'</td><td>'.WebGUI::Form::textArea("header",$style{header},50,10).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(153).'</td><td>'.WebGUI::Form::textArea("footer",$style{footer},50,10).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(154).'</td><td>'.WebGUI::Form::textArea("styleSheet",$style{styleSheet},50,10).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(151),WebGUI::Form::text("name",20,30,$style{name}));
$output .= tableFormRow(WebGUI::International::get(152),WebGUI::Form::textArea("header",$style{header},50,10));
$output .= tableFormRow(WebGUI::International::get(153),WebGUI::Form::textArea("footer",$style{footer},50,10));
$output .= tableFormRow(WebGUI::International::get(154),WebGUI::Form::textArea("styleSheet",$style{styleSheet},50,10));
$output .= formSave();
$output .= '</table>';
$output .= '</form> ';
} else {
@ -126,7 +128,7 @@ sub www_editStyle {
#-------------------------------------------------------------------
sub www_editStyleSave {
if (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("update style set name=".quote($session{form}{name}).", header=".quote($session{form}{header}).", footer=".quote($session{form}{footer}).", styleSheet=".quote($session{form}{styleSheet})." where styleId=".$session{form}{sid},$session{dbh});
WebGUI::SQL->write("update style set name=".quote($session{form}{name}).", header=".quote($session{form}{header}).", footer=".quote($session{form}{footer}).", styleSheet=".quote($session{form}{styleSheet})." where styleId=".$session{form}{sid});
return www_listStyles();
} else {
return WebGUI::Privilege::adminOnly();
@ -137,13 +139,13 @@ sub www_editStyleSave {
sub www_listStyles {
my ($output, $sth, @data, @row, $i, $prevNextBar, $dataRows);
if (WebGUI::Privilege::isInGroup(3)) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=9&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output = helpLink(9);
$output .= '<h1>'.WebGUI::International::get(157).'</h1>';
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=addStyle">'.WebGUI::International::get(158).'</a></div>';
$sth = WebGUI::SQL->read("select styleId,name from style where name<>'Reserved' order by name",$session{dbh});
$sth = WebGUI::SQL->read("select styleId,name from style where name<>'Reserved' order by name");
while (@data = $sth->array) {
$row[$i] = '<tr><td valign="top"><a href="'.$session{page}{url}.'?op=deleteStyle&sid='.$data[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?op=editStyle&sid='.$data[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?op=copyStyle&sid='.$data[0].'"><img src="'.$session{setting}{lib}.'/copy.gif" border=0></a></td>';
$row[$i] .= '<td valign="top">'.$data[1].'</td></tr>';
$row[$i] = '<tr><td valign="top" class="tableData"><a href="'.$session{page}{url}.'?op=deleteStyle&sid='.$data[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?op=editStyle&sid='.$data[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?op=copyStyle&sid='.$data[0].'"><img src="'.$session{setting}{lib}.'/copy.gif" border=0></a></td>';
$row[$i] .= '<td valign="top" class="tableData">'.$data[1].'</td></tr>';
$i++;
}
$sth->finish;

View file

@ -14,8 +14,8 @@ use Exporter;
use strict qw(vars subs);
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
our @ISA = qw(Exporter);
our @EXPORT = qw(&www_purgeTrash &www_purgeTrashConfirm);
@ -23,10 +23,10 @@ our @EXPORT = qw(&www_purgeTrash &www_purgeTrashConfirm);
#-------------------------------------------------------------------
sub _purgeWidgets {
my ($b, $widgetId, $widgetType, $func);
$b = WebGUI::SQL->read("select widgetId, widgetType from widget where pageId=$_[0]",$session{dbh});
$b = WebGUI::SQL->read("select widgetId, widgetType from widget where pageId=$_[0]");
while (($widgetId,$widgetType) = $b->array) {
$func = "WebGUI::Widget::".$widgetType."::purge";
&$func($widgetId,$session{dbh});
&$func($widgetId);
}
$b->finish;
}
@ -34,11 +34,11 @@ sub _purgeWidgets {
#-------------------------------------------------------------------
sub _recursePageTree {
my ($a, $pageId);
$a = WebGUI::SQL->read("select pageId from page where parentId=$_[0]",$session{dbh});
$a = WebGUI::SQL->read("select pageId from page where parentId=$_[0]");
while (($pageId) = $a->array) {
_recursePageTree($pageId);
_purgeWidgets($pageId);
WebGUI::SQL->write("delete from page where pageId=$pageId",$session{dbh});
WebGUI::SQL->write("delete from page where pageId=$pageId");
}
$a->finish;
}
@ -47,7 +47,8 @@ sub _recursePageTree {
sub www_purgeTrash {
my ($output);
if (WebGUI::Privilege::isInGroup(3)) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=46&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>'.WebGUI::International::get(42).'</h1>';
$output = helpLink(46);
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(162).'<p>';
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=purgeTrashConfirm">'.WebGUI::International::get(44).'</a>';
$output .= '&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.$session{page}{url}.'">'.WebGUI::International::get(45).'</a></div>';

View file

@ -14,40 +14,42 @@ use Digest::MD5 qw(md5_base64);
use Exporter;
use strict;
use Tie::CPHash;
use WebGUI::DateTime;
use WebGUI::Form;
use WebGUI::International;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
our @ISA = qw(Exporter);
our @EXPORT = qw(&www_becomeUser &www_addUser &www_addUserSave &www_deleteUser &www_deleteUserConfirm &www_editUser &www_editUserSave &www_listUsers);
our @EXPORT = qw(&www_editUserGroupSave &www_deleteGrouping &www_editGrouping &www_editGroupingSave &www_becomeUser &www_addUser &www_addUserSave &www_deleteUser &www_deleteUserConfirm &www_editUser &www_editUserSave &www_listUsers);
#-------------------------------------------------------------------
sub www_addUser {
my ($output, %hash, @array);
if (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=5&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(5);
$output .= '<h1>'.WebGUI::International::get(163).'</h1>';
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","addUserSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(50).'</td><td>'.WebGUI::Form::text("username",20,30).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(51).'</td><td>'.WebGUI::Form::password("identifier",20,30).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(50),WebGUI::Form::text("username",20,30));
$output .= tableFormRow(WebGUI::International::get(51),WebGUI::Form::password("identifier",20,30));
%hash = ('WebGUI'=>'WebGUI', 'LDAP'=>'LDAP');
$array[0] = $session{setting}{authMethod};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(164).'</td><td>'.WebGUI::Form::selectList("authMethod",\%hash, \@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(165).'</td><td>'.WebGUI::Form::text("ldapURL",20,2048,$session{setting}{ldapURL}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(166).'</td><td>'.WebGUI::Form::text("connectDN",20,255).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(56).'</td><td>'.WebGUI::Form::text("email",20,255).'</td></tr>';
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName",$session{dbh});
$output .= tableFormRow(WebGUI::International::get(164),WebGUI::Form::selectList("authMethod",\%hash, \@array));
$output .= tableFormRow(WebGUI::International::get(165),WebGUI::Form::text("ldapURL",20,2048,$session{setting}{ldapURL}));
$output .= tableFormRow(WebGUI::International::get(166),WebGUI::Form::text("connectDN",20,255));
$output .= tableFormRow(WebGUI::International::get(56),WebGUI::Form::text("email",20,255));
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName");
$array[0] = 2;
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(89).'</td><td>'.WebGUI::Form::selectList("groups",\%hash,\@array,5,1).'</td></tr>';
%hash = WebGUI::SQL->buildHash("select distinct(language) from international",$session{dbh});
$output .= tableFormRow(WebGUI::International::get(89),WebGUI::Form::selectList("groups",\%hash,\@array,5,1));
%hash = WebGUI::SQL->buildHash("select distinct(language) from international");
$array[0] = "English";
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(304).'</td><td>'.WebGUI::Form::selectList("language",\%hash,\@array).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(304),WebGUI::Form::selectList("language",\%hash,\@array));
$output .= formSave();
$output .= '</table>';
$output .= '</form> ';
} else {
@ -58,14 +60,15 @@ sub www_addUser {
#-------------------------------------------------------------------
sub www_addUserSave {
my ($output, @groups, $uid, $gid, $encryptedPassword);
my ($output, @groups, $uid, $gid, $encryptedPassword, $expireAfter);
if (WebGUI::Privilege::isInGroup(3)) {
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier});
$uid = getNextId("userId");
WebGUI::SQL->write("insert into users (userId,username,identifier,email,authMethod,ldapURL,connectDN,language) values ($uid, ".quote($session{form}{username}).", ".quote($encryptedPassword).", ".quote($session{form}{email}).", ".quote($session{form}{authMethod}).", ".quote($session{form}{ldapURL}).", ".quote($session{form}{connectDN}).", ".quote($session{form}{language}).")",$session{dbh});
WebGUI::SQL->write("insert into users (userId,username,identifier,email,authMethod,ldapURL,connectDN,language) values ($uid, ".quote($session{form}{username}).", ".quote($encryptedPassword).", ".quote($session{form}{email}).", ".quote($session{form}{authMethod}).", ".quote($session{form}{ldapURL}).", ".quote($session{form}{connectDN}).", ".quote($session{form}{language}).")");
@groups = $session{cgi}->param('groups');
foreach $gid (@groups) {
WebGUI::SQL->write("insert into groupings values ($gid, $uid)",$session{dbh});
($expireAfter) = WebGUI::SQL->quickArray("select expireAfter from groups where groupId=$gid");
WebGUI::SQL->write("insert into groupings values ($gid, $uid, ".(time()+$expireAfter).")");
}
$output = www_listUsers();
} else {
@ -78,7 +81,7 @@ sub www_addUserSave {
sub www_becomeUser {
my ($cookieInfo, $output, $password);
if (WebGUI::Privilege::isInGroup(3)) {
($password) = WebGUI::SQL->quickArray("select identifier from users where userId='$session{form}{uid}'",$session{dbh});
($password) = WebGUI::SQL->quickArray("select identifier from users where userId='$session{form}{uid}'");
WebGUI::Session::end($session{var}{sessionId});
$cookieInfo = $session{form}{uid}."|".crypt($password,"yJ");
WebGUI::Session::end($cookieInfo);
@ -91,13 +94,23 @@ sub www_becomeUser {
return $output;
}
#-------------------------------------------------------------------
sub www_deleteGrouping {
if (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("delete from groupings where groupId=$session{form}{gid} and userId=$session{form}{uid}");
return www_editUser();
} else {
return WebGUI::Privilege::adminOnly();
}
}
#-------------------------------------------------------------------
sub www_deleteUser {
my ($output);
if ($session{form}{uid} < 26) {
return WebGUI::Privilege::vitalComponent();
} elsif (WebGUI::Privilege::isInGroup(3)) {
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=7&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= helpLink(7);
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(167).'<p>';
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deleteUserConfirm&uid='.$session{form}{uid}.'">'.WebGUI::International::get(44).'</a>';
@ -113,70 +126,123 @@ sub www_deleteUserConfirm {
if ($session{form}{uid} < 26) {
return WebGUI::Privilege::vitalComponent();
} elsif (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("delete from users where userId=$session{form}{uid}",$session{dbh});
WebGUI::SQL->write("delete from groupings where userId=$session{form}{uid}",$session{dbh});
WebGUI::SQL->write("delete from users where userId=$session{form}{uid}");
WebGUI::SQL->write("delete from groupings where userId=$session{form}{uid}");
return www_listUsers();
} else {
return WebGUI::Privilege::adminOnly();
}
}
#-------------------------------------------------------------------
sub www_editGrouping {
my ($output, $username, $group, $expireDate);
if (WebGUI::Privilege::isInGroup(3)) {
$output .= '<h1>'.WebGUI::International::get(370).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editGroupingSave");
$output .= WebGUI::Form::hidden("uid",$session{form}{uid});
$output .= WebGUI::Form::hidden("gid",$session{form}{gid});
($username) = WebGUI::SQL->quickArray("select username from users where userId=$session{form}{uid}");
($group) = WebGUI::SQL->quickArray("select groupName from groups where groupId=$session{form}{gid}");
($expireDate) = WebGUI::SQL->quickArray("select expireDate from groupings where groupId=$session{form}{gid} and userId=$session{form}{uid}");
$output .= '<table>';
$output .= tableFormRow(WebGUI::International::get(50),$username);
$output .= tableFormRow(WebGUI::International::get(84),$group);
$output .= tableFormRow(WebGUI::International::get(369),WebGUI::Form::text("expireDate",20,30,epochToSet($expireDate),1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
return WebGUI::Privilege::adminOnly();
}
}
#-------------------------------------------------------------------
sub www_editGroupingSave {
if (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("update groupings set expireDate=".setToEpoch($session{form}{expireDate})." where groupId=$session{form}{gid} and userId=$session{form}{uid}");
return www_editUser();
} else {
return WebGUI::Privilege::adminOnly();
}
}
#-------------------------------------------------------------------
sub www_editUser {
my ($output, %user, %hash, @array, %gender);
my ($output, %user, %hash, @array, %gender, $sth);
tie %hash, 'Tie::CPHash';
if (WebGUI::Privilege::isInGroup(3)) {
%gender = ('male'=>WebGUI::International::get(339),'female'=>WebGUI::International::get(340));
%user = WebGUI::SQL->quickHash("select * from users where userId=$session{form}{uid}",$session{dbh});
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=5&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
%user = WebGUI::SQL->quickHash("select * from users where userId=$session{form}{uid}");
$output .= '<table><tr><td valign="top">';
$output .= helpLink(5);
$output .= '<h1>'.WebGUI::International::get(168).'</h1>';
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editUserSave");
$output .= WebGUI::Form::hidden("uid",$session{form}{uid});
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(50).'</td><td>'.WebGUI::Form::text("username",20,30,$user{username}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(51).'</td><td>'.WebGUI::Form::password("identifier",20,30,"password").'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(50),WebGUI::Form::text("username",20,30,$user{username}));
$output .= tableFormRow(WebGUI::International::get(51),WebGUI::Form::password("identifier",20,30,"password"));
%hash = ('WebGUI'=>'WebGUI', 'LDAP'=>'LDAP');
$array[0] = $user{authMethod};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(164).'</td><td>'.WebGUI::Form::selectList("authMethod",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(165).'</td><td>'.WebGUI::Form::text("ldapURL",20,2048,$user{ldapURL}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(166).'</td><td>'.WebGUI::Form::text("connectDN",20,255,$user{connectDN}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(56).'</td><td>'.WebGUI::Form::text("email",20,255,$user{email}).'</td></tr>';
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName",$session{dbh});
@array = WebGUI::SQL->buildArray("select groupId from groupings where userId=$session{form}{uid}",$session{dbh});
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(89).'</td><td>'.WebGUI::Form::selectList("groups",\%hash,\@array,5,1).'</td></tr>';
%hash = WebGUI::SQL->buildHash("select distinct(language) from international",$session{dbh});
$output .= tableFormRow(WebGUI::International::get(164),WebGUI::Form::selectList("authMethod",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(165),WebGUI::Form::text("ldapURL",20,2048,$user{ldapURL}));
$output .= tableFormRow(WebGUI::International::get(166),WebGUI::Form::text("connectDN",20,255,$user{connectDN}));
$output .= tableFormRow(WebGUI::International::get(56),WebGUI::Form::text("email",20,255,$user{email}));
%hash = WebGUI::SQL->buildHash("select distinct(language) from international");
@array = [];
$array[0] = $user{language};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(304).'</td><td>'.WebGUI::Form::selectList("language",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(314).'</td><td>'.WebGUI::Form::text("firstName",20,50,$user{firstName}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(315).'</td><td>'.WebGUI::Form::text("middleName",20,50,$user{middleName}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(316).'</td><td>'.WebGUI::Form::text("lastName",20,50,$user{lastName}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(317).'</td><td>'.WebGUI::Form::text("icq",20,30,$user{icq}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(318).'</td><td>'.WebGUI::Form::text("aim",20,30,$user{aim}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(319).'</td><td>'.WebGUI::Form::text("msnIM",20,30,$user{msnIM}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(320).'</td><td>'.WebGUI::Form::text("yahooIM",20,30,$user{yahooIM}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(321).'</td><td>'.WebGUI::Form::text("cellPhone",20,30,$user{cellPhone}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(322).'</td><td>'.WebGUI::Form::text("pager",20,30,$user{pager}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(323).'</td><td>'.WebGUI::Form::text("homeAddress",20,128,$user{homeAddress}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(324).'</td><td>'.WebGUI::Form::text("homeCity",20,30,$user{homeCity}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(325).'</td><td>'.WebGUI::Form::text("homeState",20,30,$user{homeState}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(326).'</td><td>'.WebGUI::Form::text("homeZip",20,15,$user{homeZip}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(327).'</td><td>'.WebGUI::Form::text("homeCountry",20,30,$user{homeCountry}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(328).'</td><td>'.WebGUI::Form::text("homePhone",20,30,$user{homePhone}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(329).'</td><td>'.WebGUI::Form::text("workAddress",20,128,$user{workAddress}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(330).'</td><td>'.WebGUI::Form::text("workCity",20,30,$user{workCity}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(331).'</td><td>'.WebGUI::Form::text("workState",20,30,$user{workState}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(332).'</td><td>'.WebGUI::Form::text("workZip",20,15,$user{workZip}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(333).'</td><td>'.WebGUI::Form::text("workCountry",20,30,$user{workCountry}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(334).'</td><td>'.WebGUI::Form::text("workPhone",20,30,$user{workPhone}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(304),WebGUI::Form::selectList("language",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(314),WebGUI::Form::text("firstName",20,50,$user{firstName}));
$output .= tableFormRow(WebGUI::International::get(315),WebGUI::Form::text("middleName",20,50,$user{middleName}));
$output .= tableFormRow(WebGUI::International::get(316),WebGUI::Form::text("lastName",20,50,$user{lastName}));
$output .= tableFormRow(WebGUI::International::get(317),WebGUI::Form::text("icq",20,30,$user{icq}));
$output .= tableFormRow(WebGUI::International::get(318),WebGUI::Form::text("aim",20,30,$user{aim}));
$output .= tableFormRow(WebGUI::International::get(319),WebGUI::Form::text("msnIM",20,30,$user{msnIM}));
$output .= tableFormRow(WebGUI::International::get(320),WebGUI::Form::text("yahooIM",20,30,$user{yahooIM}));
$output .= tableFormRow(WebGUI::International::get(321),WebGUI::Form::text("cellPhone",20,30,$user{cellPhone}));
$output .= tableFormRow(WebGUI::International::get(322),WebGUI::Form::text("pager",20,30,$user{pager}));
$output .= tableFormRow(WebGUI::International::get(323),WebGUI::Form::text("homeAddress",20,128,$user{homeAddress}));
$output .= tableFormRow(WebGUI::International::get(324),WebGUI::Form::text("homeCity",20,30,$user{homeCity}));
$output .= tableFormRow(WebGUI::International::get(325),WebGUI::Form::text("homeState",20,30,$user{homeState}));
$output .= tableFormRow(WebGUI::International::get(326),WebGUI::Form::text("homeZip",20,15,$user{homeZip}));
$output .= tableFormRow(WebGUI::International::get(327),WebGUI::Form::text("homeCountry",20,30,$user{homeCountry}));
$output .= tableFormRow(WebGUI::International::get(328),WebGUI::Form::text("homePhone",20,30,$user{homePhone}));
$output .= tableFormRow(WebGUI::International::get(329),WebGUI::Form::text("workAddress",20,128,$user{workAddress}));
$output .= tableFormRow(WebGUI::International::get(330),WebGUI::Form::text("workCity",20,30,$user{workCity}));
$output .= tableFormRow(WebGUI::International::get(331),WebGUI::Form::text("workState",20,30,$user{workState}));
$output .= tableFormRow(WebGUI::International::get(332),WebGUI::Form::text("workZip",20,15,$user{workZip}));
$output .= tableFormRow(WebGUI::International::get(333),WebGUI::Form::text("workCountry",20,30,$user{workCountry}));
$output .= tableFormRow(WebGUI::International::get(334),WebGUI::Form::text("workPhone",20,30,$user{workPhone}));
@array = ($user{gender});
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(335).'</td><td>'.WebGUI::Form::selectList("gender",\%gender,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(336).'</td><td>'.WebGUI::Form::text("birthdate",20,30,$user{birthdate}).'</td></tr>';
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(337).'</td><td>'.WebGUI::Form::text("homepage",20,2048,$user{homepage}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(335),WebGUI::Form::selectList("gender",\%gender,\@array));
$output .= tableFormRow(WebGUI::International::get(336),WebGUI::Form::text("birthdate",20,30,$user{birthdate}));
$output .= tableFormRow(WebGUI::International::get(337),WebGUI::Form::text("homepage",20,2048,$user{homepage}));
$output .= formSave();
$output .= '</table>';
$output .= '</form> ';
$output .= '</form>';
$output .= '</td><td>&nbsp;</td><td class="formDescription" valign="top">';
$output .= '<h1>'.WebGUI::International::get(372).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("op","editUserGroupSave");
$output .= WebGUI::Form::hidden("uid",$session{form}{uid});
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName");
@array = WebGUI::SQL->buildArray("select groupId from groupings where userId=$session{form}{uid}");
$output .= WebGUI::Form::selectList("groups",\%hash,\@array,5,1);
$output .= '<br>'.WebGUI::Form::submit(WebGUI::International::get(62));
$output .= '<p>'.WebGUI::International::get(373).'<p></form>';
$output .= '<table><tr><td class="tableHeader">'.WebGUI::International::get(89).'</td><td class="tableHeader">'.WebGUI::International::get(84).'</td><td class="tableHeader">'.WebGUI::International::get(369).'</td></tr>';
$sth = WebGUI::SQL->read("select groups.groupId,groups.groupName,groupings.expireDate from groupings,groups where groupings.groupId=groups.groupId and groupings.userId=$session{form}{uid} order by groups.groupName");
while (%hash = $sth->hash) {
$output .= '<tr><td><a href="'.$session{page}{url}.'?op=deleteGrouping&uid='.$session{form}{uid}.'&gid='.$hash{groupId}.'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.
'?op=editGrouping&uid='.$session{form}{uid}.'&gid='.$hash{groupId}.'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a></td>';
$output .= '<td class="tableData">'.$hash{groupName}.'</td>';
$output .= '<td class="tableData">'.epochToHuman($hash{expireDate},"%M/%D/%y").'</td></tr>';
}
$sth->finish;
$output .= '</table>';
$output .= '</td></tr></table>';
} else {
$output = WebGUI::Privilege::adminOnly();
}
@ -185,34 +251,45 @@ sub www_editUser {
#-------------------------------------------------------------------
sub www_editUserSave {
my (@groups, $error, $gid, $encryptedPassword, $passwordStatement);
my ($error, $encryptedPassword, $passwordStatement);
if (WebGUI::Privilege::isInGroup(3)) {
if ($session{form}{identifier} ne "password") {
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier});
$passwordStatement = ', identifier='.quote($encryptedPassword);
}
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier1});
WebGUI::SQL->write("update users set username=".quote($session{form}{username}).$passwordStatement.", authMethod=".quote($session{form}{authMethod}).", ldapURL=".quote($session{form}{ldapURL}).", connectDN=".quote($session{form}{connectDN}).", email=".quote($session{form}{email}).", language=".quote($session{form}{language}).", firstName=".quote($session{form}{firstName}).", middleName=".quote($session{form}{middleName}).", lastName=".quote($session{form}{lastName}).", icq=".quote($session{form}{icq}).", aim=".quote($session{form}{aim}).", msnIM=".quote($session{form}{msnIM}).", yahooIM=".quote($session{form}{yahooIM}).", homeAddress=".quote($session{form}{homeAddress}).", homeCity=".quote($session{form}{homeCity}).", homeState=".quote($session{form}{homeState}).", homeZip=".quote($session{form}{homeZip}).", homeCountry=".quote($session{form}{homeCountry}).", homePhone=".quote($session{form}{homePhone}).", workAddress=".quote($session{form}{workAddress}).", workCity=".quote($session{form}{workCity}).", workState=".quote($session{form}{workState}).", workZip=".quote($session{form}{workZip}).", workCountry=".quote($session{form}{workCountry}).", workPhone=".quote($session{form}{workPhone}).", cellPhone=".quote($session{form}{cellPhone}).", pager=".quote($session{form}{pager}).", gender=".quote($session{form}{gender}).", birthdate=".quote($session{form}{birthdate}).", homepage=".quote($session{form}{homepage})." where userId=".$session{form}{uid},$session{dbh});
WebGUI::SQL->write("delete from groupings where userId=$session{form}{uid}",$session{dbh});
@groups = $session{cgi}->param('groups');
foreach $gid (@groups) {
WebGUI::SQL->write("insert into groupings values ($gid, $session{form}{uid})",$session{dbh});
}
WebGUI::SQL->write("update users set username=".quote($session{form}{username}).$passwordStatement.", authMethod=".quote($session{form}{authMethod}).", ldapURL=".quote($session{form}{ldapURL}).", connectDN=".quote($session{form}{connectDN}).", email=".quote($session{form}{email}).", language=".quote($session{form}{language}).", firstName=".quote($session{form}{firstName}).", middleName=".quote($session{form}{middleName}).", lastName=".quote($session{form}{lastName}).", icq=".quote($session{form}{icq}).", aim=".quote($session{form}{aim}).", msnIM=".quote($session{form}{msnIM}).", yahooIM=".quote($session{form}{yahooIM}).", homeAddress=".quote($session{form}{homeAddress}).", homeCity=".quote($session{form}{homeCity}).", homeState=".quote($session{form}{homeState}).", homeZip=".quote($session{form}{homeZip}).", homeCountry=".quote($session{form}{homeCountry}).", homePhone=".quote($session{form}{homePhone}).", workAddress=".quote($session{form}{workAddress}).", workCity=".quote($session{form}{workCity}).", workState=".quote($session{form}{workState}).", workZip=".quote($session{form}{workZip}).", workCountry=".quote($session{form}{workCountry}).", workPhone=".quote($session{form}{workPhone}).", cellPhone=".quote($session{form}{cellPhone}).", pager=".quote($session{form}{pager}).", gender=".quote($session{form}{gender}).", birthdate=".quote($session{form}{birthdate}).", homepage=".quote($session{form}{homepage})." where userId=".$session{form}{uid});
return www_listUsers();
} else {
return WebGUI::Privilege::adminOnly();
}
}
#-------------------------------------------------------------------
sub www_editUserGroupSave {
my (@groups, $gid, $expireAfter);
if (WebGUI::Privilege::isInGroup(3)) {
WebGUI::SQL->write("delete from groupings where userId=$session{form}{uid}");
@groups = $session{cgi}->param('groups');
foreach $gid (@groups) {
($expireAfter) = WebGUI::SQL->quickArray("select expireAfter from groups where groupId=$gid");
WebGUI::SQL->write("insert into groupings values ($gid, $session{form}{uid}, ".(time()+$expireAfter).")");
}
return www_editUser();
} else {
return WebGUI::Privilege::adminOnly();
}
}
#-------------------------------------------------------------------
sub www_listUsers {
my ($output, $sth, @data, @row, $dataRows, $prevNextBar, $i, $search);
if (WebGUI::Privilege::isInGroup(3)) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=8&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output = helpLink(8);
$output .= '<h1>'.WebGUI::International::get(149).'</h1>';
$output .= '<table class="tableData" align="center" width="75%"><tr><td>';
$output .= '<a href="'.$session{page}{url}.'?op=addUser">'.WebGUI::International::get(169).'</a>';
$output .= '</td><form method="post" action="'.$session{page}{url}.'"><td align="right">';
$output .= '</td>'.formHeader().'<td align="right">';
$output .= WebGUI::Form::hidden("op","listUsers");
$output .= WebGUI::Form::text("keyword",20,50);
$output .= WebGUI::Form::submit(WebGUI::International::get(170));
@ -220,7 +297,7 @@ sub www_listUsers {
if ($session{form}{keyword} ne "") {
$search = " and (username like '%".$session{form}{keyword}."%' or email like '%".$session{form}{keyword}."%') ";
}
$sth = WebGUI::SQL->read("select userId,username,email from users where username<>'Reserved' $search order by username",$session{dbh});
$sth = WebGUI::SQL->read("select userId,username,email from users where username<>'Reserved' $search order by username");
while (@data = $sth->array) {
$row[$i] = '<tr class="tableData"><td>';
$row[$i] .= '<a href="'.$session{page}{url}.'?op=deleteUser&uid='.$data[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a>';

View file

@ -15,7 +15,6 @@ use Tie::CPHash;
use WebGUI::International;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Utility;
#-------------------------------------------------------------------
sub adminOnly {
@ -23,7 +22,7 @@ sub adminOnly {
$output = '<h1>'.WebGUI::International::get(35).'</h1>';
$output .= WebGUI::International::get(36);
$output .= '<ul>';
$sth = WebGUI::SQL->read("select users.username, users.email from users,groupings where users.userId=groupings.userId and groupings.groupId=3 order by users.username",$session{dbh});
$sth = WebGUI::SQL->read("select users.username, users.email from users,groupings where users.userId=groupings.userId and groupings.groupId=3 order by users.username");
while (@data = $sth->array) {
$output .= '<li>'.$data[0].' (<a href="mailto:'.$data[1].'">'.$data[1].'</a>)';
}
@ -54,7 +53,7 @@ sub canViewPage {
if ($_[0] eq "") {
%page = %{$session{page}};
} else {
%page = WebGUI::SQL->quickHash("select * from page where pageId=$_[0]",$session{dbh});
%page = WebGUI::SQL->quickHash("select * from page where pageId=$_[0]");
}
if ($page{worldView}) {
return 1;
@ -86,10 +85,13 @@ sub isInGroup {
if ($uid eq "") {
$uid = $session{user}{userId};
}
($result) = WebGUI::SQL->quickArray("select count(*) from groupings where groupId='$gid' and userId='$uid'",$session{dbh});
($result) = WebGUI::SQL->quickArray("select count(*) from groupings where groupId='$gid' and userId='$uid' and expireDate>".time());
if ($result < 1 && $gid == 1) { # registered users can
$result = isInGroup(2, $uid); # do anything visitors
} # can do
if ($result < 1 && $gid != 3) { # admins can
$result = isInGroup(3, $uid); # do anything any
} # user can do
return $result;
}

View file

@ -12,18 +12,18 @@ package WebGUI::SQL;
use CGI::Carp qw(fatalsToBrowser);
use DBI;
use Exporter;
use strict;
use Tie::IxHash;
use WebGUI::ErrorHandler;
use WebGUI::Session;
# Note: This class is really not necessary, I just decided to wrapper DBI in case
# I wanted to change to some other DB connector in the future. Also, it shorthands
# a few tasks. And to be honest, having it separated has come in handy a few times,
# like when I started coding for databases beyond MySQL.
our @ISA = qw(Exporter);
our @EXPORT = qw(&quote &getNextId);
#-------------------------------------------------------------------
sub array {
return $_[0]->{_sth}->fetchrow_array() or WebGUI::ErrorHandler::fatalError(DBI->errstr);
return $_[0]->{_sth}->fetchrow_array() or WebGUI::ErrorHandler::fatalError("Couldn't fetch array. ".$_[0]->{_sth}->errstr);
}
#-------------------------------------------------------------------
@ -60,9 +60,28 @@ sub finish {
return $_[0]->{_sth}->finish;
}
#-------------------------------------------------------------------
sub getNextId {
my ($id);
($id) = WebGUI::SQL->quickArray("select nextValue from incrementer where incrementerId='$_[0]'");
WebGUI::SQL->write("update incrementer set nextValue=nextValue+1 where incrementerId='$_[0]'");
return $id;
}
#-------------------------------------------------------------------
sub hash {
return $_[0]->{_sth}->fetchrow_hashref() or WebGUI::ErrorHandler::fatalError(DBI->errstr);
my ($hashRef);
$hashRef = $_[0]->{_sth}->fetchrow_hashref();
if (defined $hashRef) {
return %{$hashRef};
} else {
return ();
}
}
#-------------------------------------------------------------------
sub hashRef {
return $_[0]->{_sth}->fetchrow_hashref() or WebGUI::ErrorHandler::fatalError("Couldn't fetch hashref. ".$_[0]->{_sth}->errstr);
}
#-------------------------------------------------------------------
@ -70,7 +89,7 @@ sub new {
my ($class, $sql, $dbh, $sth);
$class = shift;
$sql = shift;
$dbh = shift;
$dbh = shift || $WebGUI::Session::session{dbh};
$sth = $dbh->prepare($sql) or WebGUI::ErrorHandler::fatalError("Couldn't prepare statement: ".$sql." : ". DBI->errstr);
$sth->execute or WebGUI::ErrorHandler::fatalError("Couldn't execute statement: ".$sql." : ". DBI->errstr);
bless ({_sth => $sth}, $class);
@ -89,13 +108,19 @@ sub quickArray {
sub quickHash {
my ($sth, $data);
$sth = WebGUI::SQL->new($_[1],$_[2]);
$data = $sth->hash;
$data = $sth->hashRef;
$sth->finish;
if (defined $data) {
return %{$data};
}
}
#-------------------------------------------------------------------
sub quote {
my $value = $_[0]; #had to add this here cuz Tie::CPHash variables cause problems otherwise.
return $WebGUI::Session::session{dbh}->quote($value);
}
#-------------------------------------------------------------------
sub read {
return WebGUI::SQL->new($_[1],$_[2],$_[3]);
@ -116,7 +141,9 @@ sub unconditionalRead {
#-------------------------------------------------------------------
sub write {
$_[2]->do($_[1]) or WebGUI::ErrorHandler::fatalError("Couldn't prepare statement: ".$_[1]." : ". DBI->errstr);
my ($dbh);
$dbh = $_[2] || $WebGUI::Session::session{dbh};
$dbh->do($_[1]) or WebGUI::ErrorHandler::fatalError("Couldn't prepare statement: ".$_[1]." : ". DBI->errstr);
}

58
lib/WebGUI/Shortcut.pm Normal file
View file

@ -0,0 +1,58 @@
package WebGUI::Shortcut;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001 Plain Black Software.
#-------------------------------------------------------------------
# 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 WebGUI::International;
use WebGUI::Session;
our @ISA = qw(Exporter);
our @EXPORT = qw(&formHeader &formSave &tableFormRow &helpLink);
# The subroutines found herein do nothing other than creating a
# short way of doing much longer repetitive tasks. They simply
# make the programmer's life easier through fewer keystrokes and
# less cluttered code.
#-------------------------------------------------------------------
sub formHeader {
my ($output);
$output = '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
return $output;
}
#-------------------------------------------------------------------
sub formSave {
my ($output);
$output = '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
return $output;
}
#-------------------------------------------------------------------
sub helpLink {
my ($output, $namespace);
$namespace = $_[1] || "WebGUI";
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid='.$_[0].'&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
return $output;
}
#-------------------------------------------------------------------
sub tableFormRow {
my ($output);
$output = '<tr><td class="formDescription" valign="top">'.$_[0].'</td><td>'.$_[1].'</td></tr>';
return $output;
}
1;

View file

@ -20,11 +20,14 @@ use WebGUI::SQL;
sub getStyle {
my ($header, $footer, @style, %style);
if ($session{form}{makePrintable}) {
$header = '<html><!-- WebGUI '.$session{wg}{version}.' --><title>'.$session{page}{title}.'</title><body>';
$footer = '</body></html>';
%style = WebGUI::SQL->quickHash("select header,footer,styleSheet from style where styleId=3");
$header = '<html><!-- WebGUI '.$session{wg}{version}.' -->'."\n";
$header .= '<head><title>'.$session{page}{title}.'</title>';
$header .= $style{styleSheet}.'</head>'.$style{header};
$footer = $style{footer}.'</html>';
} else {
tie %style, 'Tie::CPHash';
%style = WebGUI::SQL->quickHash("select header,footer,styleSheet from style where styleId=$session{page}{styleId}",$session{dbh});
%style = WebGUI::SQL->quickHash("select header,footer,styleSheet from style where styleId=$session{page}{styleId}");
$header = '<!-- WebGUI '.$WebGUI::VERSION.' -->
<html>
<head>
@ -37,9 +40,9 @@ sub getStyle {
$header .= '</head>'.$style{header};
$footer = $style{footer}.'
</html>';
$header = WebGUI::Macro::process($header);
$footer = WebGUI::Macro::process($footer);
}
$header = WebGUI::Macro::process($header);
$footer = WebGUI::Macro::process($footer);
return ($header, $footer);
}

View file

@ -27,9 +27,8 @@ sub loadTemplates {
opendir (DIR,$session{config}{webguiRoot}.$templateDir) or WebGUI::ErrorHandler::fatalError("Can't open template directory!");
@files = readdir(DIR);
foreach $file (@files) {
if ($file ne "." && $file ne ".." && $file =~ /\.pm/) {
$file =~ s/\.pm//;
$template[$i] = $file;
if ($file =~ /(.*?)\.pm$/) {
$template[$i] = $1;
$use = "require WebGUI::Template::".$template[$i];
eval($use);
if ($@) {

View file

@ -10,9 +10,7 @@ package WebGUI::Utility;
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
use CGI;
use Exporter;
use FileHandle;
use strict;
use Tie::IxHash;
use WebGUI::International;
@ -20,7 +18,7 @@ use WebGUI::Session;
use WebGUI::SQL;
our @ISA = qw(Exporter);
our @EXPORT = qw(&sortHashDescending &sortHash &paginate &appendToUrl &randint &getNextId &saveAttachment &round &urlize &quote);
our @EXPORT = qw(&sortHashDescending &sortHash &paginate &appendToUrl &randint &round &urlize);
#-------------------------------------------------------------------
sub appendToUrl {
@ -34,14 +32,6 @@ sub appendToUrl {
return $url;
}
#-------------------------------------------------------------------
sub getNextId {
my ($id);
($id) = WebGUI::SQL->quickArray("select nextValue from incrementer where incrementerId='$_[0]'",$session{dbh});
WebGUI::SQL->write("update incrementer set nextValue=nextValue+1 where incrementerId='$_[0]'",$session{dbh});
return $id;
}
#-------------------------------------------------------------------
sub paginate {
my ($pn, $i, $dataRows, $prevNextBar, $itemsPerPage, @row, $url);
@ -72,13 +62,6 @@ sub paginate {
return ($dataRows, $prevNextBar);
}
#-------------------------------------------------------------------
# This is here simply to make typing shorter, cuz I'm lazy.
sub quote {
my $value = $_[0]; #had to add this here cuz Tie::CPHash variables cause problems otherwise.
return $session{dbh}->quote($value);
}
#-------------------------------------------------------------------
sub randint {
my ($low, $high) = @_;
@ -93,40 +76,6 @@ sub round {
return sprintf("%.0f", $_[0]);
}
#-------------------------------------------------------------------
# eg: saveAttachment(formVarName,widgetId,optionallySubmissionId);
sub saveAttachment {
my ($file, $filename, $bytesread, $buffer, $urlizedFilename, $path);
$filename = $session{cgi}->upload($_[0]);
if (defined $filename) {
if ($filename =~ /([^\/\\]+)$/) {
$urlizedFilename = $1;
} else {
$urlizedFilename = $filename;
}
$urlizedFilename = urlize($urlizedFilename);
$path = $session{setting}{attachmentDirectoryLocal}."/".$_[1]."/";
mkdir ($path,0755);
if ($_[2] ne "") {
$path = $path.$_[2].'/';
mkdir ($path,0755);
}
$file = FileHandle->new(">".$path.$urlizedFilename);
if (defined $file) {
binmode $file;
while ($bytesread=read($filename,$buffer,1024)) {
print $file $buffer;
}
close($file);
} else {
return "";
}
return $urlizedFilename;
} else {
return "";
}
}
#-------------------------------------------------------------------
sub sortHash {
my (%hash, %reversedHash, %newHash, $key);

View file

@ -15,22 +15,22 @@ use DBI;
use Exporter;
use strict qw(subs vars);
use Tie::IxHash;
use WebGUI::Attachment;
use WebGUI::International;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Template;
use WebGUI::Utility;
our @ISA = qw(Exporter);
our @EXPORT = qw(&purgeWidget &www_jumpDown &www_jumpUp &update &www_moveUp &www_moveDown &www_delete &www_deleteConfirm &www_cut &create &www_paste);
our @EXPORT = qw(&getProperties &purgeWidget &www_jumpDown &www_jumpUp &update &www_moveUp &www_moveDown &www_delete &www_deleteConfirm &www_cut &create &www_paste);
#-------------------------------------------------------------------
sub _reorderWidgets {
my ($sth, $i, $wid);
$sth = WebGUI::SQL->read("select widgetId from widget where pageId=$_[0] order by position,sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select widgetId from widget where pageId=$_[0] order by position,sequenceNumber");
while (($wid) = $sth->array) {
$i++;
WebGUI::SQL->write("update widget set sequenceNumber='$i' where widgetId=$wid",$session{dbh});
WebGUI::SQL->write("update widget set sequenceNumber='$i' where widgetId=$wid");
}
$sth->finish;
}
@ -39,8 +39,8 @@ sub _reorderWidgets {
sub create {
my ($widgetId, $nextSeq);
$widgetId = getNextId("widgetId");
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from widget where pageId=$session{page}{pageId}",$session{dbh});
WebGUI::SQL->write("insert into widget values ($widgetId, $session{page}{pageId}, '$session{form}{widget}', '$nextSeq', ".quote($session{form}{title}).", '$session{form}{displayTitle}', ".quote($session{form}{description}).", '$session{form}{processMacros}', ".time().", '$session{user}{userId}', 0, 0, '$session{form}{position}')",$session{dbh});
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from widget where pageId=$_[0]");
WebGUI::SQL->write("insert into widget values ($widgetId, $_[0], '$_[1]', '$nextSeq', ".quote($_[2]).", '$_[3]', ".quote($_[4]).", '$_[5]', ".time().", '$session{user}{userId}', 0, 0, '$_[6]')");
return $widgetId;
}
@ -53,19 +53,29 @@ sub getPositions {
}
#-------------------------------------------------------------------
sub update {
WebGUI::SQL->write("update widget set title=".quote($session{form}{title}).", displayTitle='$session{form}{displayTitle}', description=".quote($session{form}{description}).", processMacros='$session{form}{processMacros}', lastEdited=".time().", editedBy='$session{user}{userId}', position='$session{form}{position}' where widgetId=$session{form}{wid}",$session{dbh});
sub getProperties {
my (%data);
tie %data, 'Tie::CPHash';
%data = WebGUI::SQL->quickHash("select * from widget,$_[0] where widget.widgetId=$_[1] and widget.widgetId=$_[0].widgetId");
return %data;
}
#-------------------------------------------------------------------
sub purgeWidget {
WebGUI::SQL->write("delete from widget where widgetId=$_[0]",$_[1]);
WebGUI::SQL->write("delete from $_[2] where widgetId=$_[0]",$_[1]);
WebGUI::SQL->write("delete from widget where widgetId=$_[0]",$_[1]);
WebGUI::Attachment::purgeWidget($_[0]);
}
#-------------------------------------------------------------------
sub update {
WebGUI::SQL->write("update widget set title=".quote($session{form}{title}).", displayTitle='$session{form}{displayTitle}', description=".quote($session{form}{description}).", processMacros='$session{form}{processMacros}', lastEdited=".time().", editedBy='$session{user}{userId}', position='$session{form}{position}' where widgetId=$session{form}{wid}");
}
#-------------------------------------------------------------------
sub www_cut {
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update widget set pageId=2 where widgetId=".$session{form}{wid},$session{dbh});
WebGUI::SQL->write("update widget set pageId=2 where widgetId=".$session{form}{wid});
_reorderWidgets($session{page}{pageId});
return "";
} else {
@ -96,7 +106,7 @@ sub www_delete {
#-------------------------------------------------------------------
sub www_deleteConfirm {
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update widget set pageId=3 where widgetId=".$session{form}{wid},$session{dbh});
WebGUI::SQL->write("update widget set pageId=3 where widgetId=".$session{form}{wid});
_reorderWidgets($session{page}{pageId});
return "";
} else {
@ -108,7 +118,7 @@ sub www_deleteConfirm {
sub www_jumpDown {
my (@data, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update widget set sequenceNumber=9999 where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update widget set sequenceNumber=9999 where widgetId=$session{form}{wid}");
_reorderWidgets($session{page}{pageId});
return "";
} else {
@ -120,7 +130,7 @@ sub www_jumpDown {
sub www_jumpUp {
my (@data, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update widget set sequenceNumber=0 where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update widget set sequenceNumber=0 where widgetId=$session{form}{wid}");
_reorderWidgets($session{page}{pageId});
return "";
} else {
@ -131,11 +141,11 @@ sub www_jumpUp {
sub www_moveDown {
my (@data, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from widget where widgetId=$session{form}{wid}",$session{dbh});
@data = WebGUI::SQL->quickArray("select widgetId from widget where pageId=$session{page}{pageId} and sequenceNumber=$thisSeq+1",$session{dbh});
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from widget where widgetId=$session{form}{wid}");
@data = WebGUI::SQL->quickArray("select widgetId from widget where pageId=$session{page}{pageId} and sequenceNumber=$thisSeq+1");
if ($data[0] ne "") {
WebGUI::SQL->write("update widget set sequenceNumber=sequenceNumber+1 where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update widget set sequenceNumber=sequenceNumber-1 where widgetId=$data[0]",$session{dbh});
WebGUI::SQL->write("update widget set sequenceNumber=sequenceNumber+1 where widgetId=$session{form}{wid}");
WebGUI::SQL->write("update widget set sequenceNumber=sequenceNumber-1 where widgetId=$data[0]");
_reorderWidgets($session{page}{pageId});
}
return "";
@ -148,11 +158,11 @@ sub www_moveDown {
sub www_moveUp {
my (@data, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from widget where widgetId=$session{form}{wid}",$session{dbh});
@data = WebGUI::SQL->quickArray("select widgetId from widget where pageId=$session{page}{pageId} and sequenceNumber=$thisSeq-1",$session{dbh});
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from widget where widgetId=$session{form}{wid}");
@data = WebGUI::SQL->quickArray("select widgetId from widget where pageId=$session{page}{pageId} and sequenceNumber=$thisSeq-1");
if ($data[0] ne "") {
WebGUI::SQL->write("update widget set sequenceNumber=sequenceNumber-1 where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update widget set sequenceNumber=sequenceNumber+1 where widgetId=$data[0]",$session{dbh});
WebGUI::SQL->write("update widget set sequenceNumber=sequenceNumber-1 where widgetId=$session{form}{wid}");
WebGUI::SQL->write("update widget set sequenceNumber=sequenceNumber+1 where widgetId=$data[0]");
_reorderWidgets($session{page}{pageId});
}
return "";
@ -165,8 +175,8 @@ sub www_moveUp {
sub www_paste {
my ($output, $nextSeq);
if (WebGUI::Privilege::canEditPage()) {
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from widget where pageId=$session{page}{pageId}",$session{dbh});
WebGUI::SQL->write("update widget set pageId=$session{page}{pageId}, sequenceNumber='$nextSeq' where widgetId=$session{form}{wid}",$session{dbh});
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from widget where pageId=$session{page}{pageId}");
WebGUI::SQL->write("update widget set pageId=$session{page}{pageId}, sequenceNumber='$nextSeq' where widgetId=$session{form}{wid}");
_reorderWidgets($session{page}{pageId});
return "";
} else {

View file

@ -14,24 +14,36 @@ our $namespace = "Article";
use strict;
use Tie::CPHash;
use WebGUI::Attachment;
use WebGUI::DateTime;
use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
use WebGUI::Widget;
#-------------------------------------------------------------------
sub duplicate {
my (%data, $newWidgetId, $pageId);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{position});
WebGUI::Attachment::copy($data{image},$_[0],$newWidgetId);
WebGUI::Attachment::copy($data{attachment},$_[0],$newWidgetId);
WebGUI::SQL->write("insert into Article values ($newWidgetId, $data{startDate}, $data{endDate}, ".quote($data{body}).", ".quote($data{image}).", ".quote($data{linkTitle}).", ".quote($data{linkURL}).", ".quote($data{attachment}).", '$data{convertCarriageReturns}')");
}
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from Article where widgetId=$_[0]",$_[1]);
purgeWidget($_[0],$_[1]);
purgeWidget($_[0],$_[1],$namespace);
}
#-------------------------------------------------------------------
sub widgetName {
return WebGUI::International::get(172);
return WebGUI::International::get(1,$namespace);
}
#-------------------------------------------------------------------
@ -39,26 +51,26 @@ sub www_add {
my ($output, %hash);
tie %hash, "Tie::IxHash";
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(173).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(2,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,'Article').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1,1).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,'Article'));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,1));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1,1));
%hash = WebGUI::Widget::getPositions();
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</td><td>'.WebGUI::Form::text("startDate",20,30,epochToSet(time()),1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(177).'</td><td>'.WebGUI::Form::text("endDate",20,30,'01/01/2037',1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(178).'</td><td>'.WebGUI::Form::textArea("body",'',50,10,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(179).'</td><td>'.WebGUI::Form::file("image").'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(180).'</td><td>'.WebGUI::Form::text("linkTitle",20,128).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(181).'</td><td>'.WebGUI::Form::text("linkURL",20,2048).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(182).'</td><td>'.WebGUI::Form::file("attachment").'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(183).'</td><td>'.WebGUI::Form::checkbox("convertCarriageReturns",1).' <span style="font-size: 8pt;">'.WebGUI::International::get(184).'</span></td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::text("startDate",20,30,epochToSet(time()),1));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("endDate",20,30,'01/01/2037',1));
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::textArea("body",'',50,10,1));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::file("image"));
$output .= tableFormRow(WebGUI::International::get(7,$namespace),WebGUI::Form::text("linkTitle",20,128));
$output .= tableFormRow(WebGUI::International::get(8,$namespace),WebGUI::Form::text("linkURL",20,2048));
$output .= tableFormRow(WebGUI::International::get(9,$namespace),WebGUI::Form::file("attachment"));
$output .= tableFormRow(WebGUI::International::get(10,$namespace),WebGUI::Form::checkbox("convertCarriageReturns",1).' <span style="font-size: 8pt;">'.WebGUI::International::get(11,$namespace).'</span>');
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -71,20 +83,30 @@ sub www_add {
sub www_addSave {
my ($widgetId, $image, $attachment);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create();
$image = saveAttachment("image",$widgetId);
$attachment = saveAttachment("attachment",$widgetId);
WebGUI::SQL->write("insert into Article values ($widgetId, '".setToEpoch($session{form}{startDate})."', '".setToEpoch($session{form}{endDate})."', ".quote($session{form}{body}).", ".quote($image).", ".quote($session{form}{linkTitle}).", ".quote($session{form}{linkURL}).", ".quote($attachment).", '$session{form}{convertCarriageReturns}')",$session{dbh});
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{position});
$image = WebGUI::Attachment::save("image",$widgetId);
$attachment = WebGUI::Attachment::save("attachment",$widgetId);
WebGUI::SQL->write("insert into Article values ($widgetId, '".setToEpoch($session{form}{startDate})."', '".setToEpoch($session{form}{endDate})."', ".quote($session{form}{body}).", ".quote($image).", ".quote($session{form}{linkTitle}).", ".quote($session{form}{linkURL}).", ".quote($attachment).", '$session{form}{convertCarriageReturns}')");
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
duplicate($session{form}{wid});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_deleteAttachment {
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update Article set attachment='' where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update Article set attachment='' where widgetId=$session{form}{wid}");
return www_edit();
} else {
return WebGUI::Privilege::insufficient();
@ -94,7 +116,7 @@ sub www_deleteAttachment {
#-------------------------------------------------------------------
sub www_deleteImage {
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update Article set image='' where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update Article set image='' where widgetId=$session{form}{wid}");
return www_edit();
} else {
return WebGUI::Privilege::insufficient();
@ -103,40 +125,40 @@ sub www_deleteImage {
#-------------------------------------------------------------------
sub www_edit {
my ($output, %article, %hash, @array);
my ($output, %data, %hash, @array);
tie %hash, 'Tie::IxHash';
tie %article, 'Tie::CPHash';
tie %data, 'Tie::CPHash';
if (WebGUI::Privilege::canEditPage()) {
%article = WebGUI::SQL->quickHash("select * from widget,Article where widget.widgetId=Article.widgetId and widget.widgetId=$session{form}{wid}",$session{dbh});
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=23"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(185).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%data = getProperties($namespace,$session{form}{wid});
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(12,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$article{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$article{displayTitle}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros","1",$article{processMacros}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$data{title}));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros","1",$data{processMacros}));
%hash = WebGUI::Widget::getPositions();
$array[0] = $article{position};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</td><td>'.WebGUI::Form::text("startDate",20,30,epochToSet($article{startDate}),1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(177).'</td><td>'.WebGUI::Form::text("endDate",20,30,epochToSet($article{endDate}),1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(178).'</td><td>'.WebGUI::Form::textArea("body",$article{body},50,10,1).'</td></tr>';
if ($article{image} ne "") {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(179).'</td><td><a href="'.$session{page}{url}.'?func=deleteImage&wid='.$session{form}{wid}.'">'.WebGUI::International::get(186).'</a></td></tr>';
$array[0] = $data{position};
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::text("startDate",20,30,epochToSet($data{startDate}),1));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("endDate",20,30,epochToSet($data{endDate}),1));
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::textArea("body",$data{body},50,10,1));
if ($data{image} ne "") {
$output .= tableFormRow(WebGUI::International::get(6,$namespace),'<a href="'.$session{page}{url}.'?func=deleteImage&wid='.$session{form}{wid}.'">'.WebGUI::International::get(13,$namespace).'</a>');
} else {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(179).'</td><td>'.WebGUI::Form::file("image").'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::file("image"));
}
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(180).'</td><td>'.WebGUI::Form::text("linkTitle",20,128,$article{linkTitle}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(181).'</td><td>'.WebGUI::Form::text("linkURL",20,2048,$article{linkURL}).'</td></tr>';
if ($article{attachment} ne "") {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(182).'</td><td><a href="'.$session{page}{url}.'?func=deleteAttachment&wid='.$session{form}{wid}.'">'.WebGUI::International::get(186).'</a></td></tr>';
$output .= tableFormRow(WebGUI::International::get(7,$namespace),WebGUI::Form::text("linkTitle",20,128,$data{linkTitle}));
$output .= tableFormRow(WebGUI::International::get(8,$namespace),WebGUI::Form::text("linkURL",20,2048,$data{linkURL}));
if ($data{attachment} ne "") {
$output .= tableFormRow(WebGUI::International::get(9,$namespace),'<a href="'.$session{page}{url}.'?func=deleteAttachment&wid='.$session{form}{wid}.'">'.WebGUI::International::get(13,$namespace).'</a>');
} else {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(182).'</td><td>'.WebGUI::Form::file("attachment").'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(9,$namespace),WebGUI::Form::file("attachment"));
}
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(183).'</td><td>'.WebGUI::Form::checkbox("convertCarriageReturns",1,$article{convertCarriageReturns}).' <span style="font-size: 8pt;">'.WebGUI::International::get(184).'</span></td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(10,$namespace),WebGUI::Form::checkbox("convertCarriageReturns",1,$data{convertCarriageReturns}).' <span style="font-size: 8pt;">'.WebGUI::International::get(11,$namespace).'</span>');
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -149,15 +171,15 @@ sub www_editSave {
my ($image, $attachment);
if (WebGUI::Privilege::canEditPage()) {
update();
$image = saveAttachment("image",$session{form}{wid});
$image = WebGUI::Attachment::save("image",$session{form}{wid});
if ($image ne "") {
$image = ', image='.quote($image);
}
$attachment = saveAttachment("attachment",$session{form}{wid});
$attachment = WebGUI::Attachment::save("attachment",$session{form}{wid});
if ($attachment ne "") {
$attachment = ', attachment='.quote($attachment);
}
WebGUI::SQL->write("update Article set startDate='".setToEpoch($session{form}{startDate})."', endDate='".setToEpoch($session{form}{endDate})."', convertCarriageReturns='$session{form}{convertCarriageReturns}', body=".quote($session{form}{body}).", linkTitle=".quote($session{form}{linkTitle}).", linkURL=".quote($session{form}{linkURL}).$attachment.$image." where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update Article set startDate='".setToEpoch($session{form}{startDate})."', endDate='".setToEpoch($session{form}{endDate})."', convertCarriageReturns='$session{form}{convertCarriageReturns}', body=".quote($session{form}{body}).", linkTitle=".quote($session{form}{linkTitle}).", linkURL=".quote($session{form}{linkURL}).$attachment.$image." where widgetId=$session{form}{wid}");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -166,16 +188,15 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_view {
my (%data, @test, $output, $widgetId);
my (%data, @test, $output);
tie %data, 'Tie::CPHash';
$widgetId = shift;
%data = WebGUI::SQL->quickHash("select * from widget,Article where widget.widgetId='$widgetId' and widget.WidgetId=Article.widgetId and Article.startDate<".time()." and Article.endDate>".time()."",$session{dbh});
if (defined %data) {
%data = getProperties($namespace,$_[0]);
if ($data{startDate}<time() && $data{endDate}>time()) {
if ($data{displayTitle} == 1) {
$output = "<h1>".$data{title}."</h1>";
}
if ($data{image} ne "") {
$output .= '<img src="'.$session{setting}{attachmentDirectoryWeb}.'/'.$widgetId.'/'.$data{image}.'" border="0" align="right">';
$output .= '<img src="'.$session{setting}{attachmentDirectoryWeb}.'/'.$_[0].'/'.$data{image}.'" border="0" align="right">';
}
if ($data{convertCarriageReturns}) {
$data{body} =~ s/\n/\<br\>/g;
@ -185,7 +206,7 @@ sub www_view {
$output .= '<p><a href="'.$data{linkURL}.'">'.$data{linkTitle}.'</a>';
}
if ($data{attachment} ne "") {
$output .= '<p><a href="'.$session{setting}{attachmentDirectoryWeb}.'/'.$widgetId.'/'.$data{attachment}.'"><img src="'.$session{setting}{lib}.'/attachment.gif" border=0 alt="Download Attachment"></a>';
$output .= '<p><a href="'.$session{setting}{attachmentDirectoryWeb}.'/'.$_[0].'/'.$data{attachment}.'"><img src="'.$session{setting}{lib}.'/attachment.gif" border=0 alt="'.WebGUI::International::get(14,$namespace).'"></a>';
}
}
if ($data{processMacros} == 1) {

View file

@ -19,20 +19,39 @@ use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
use WebGUI::Widget;
#-------------------------------------------------------------------
sub duplicate {
my ($sth, %data, $newWidgetId, $pageId, @row, $newEventId, $previousRecurringEventId);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{position});
WebGUI::SQL->write("insert into EventsCalendar values ($newWidgetId)");
$sth = WebGUI::SQL->read("select * from EventsCalendar_event order by recurringEventId");
while (@row = $sth->array) {
$newEventId = getNextId("eventId");
if ($row[6] > 0 && $row[6] != $previousRecurringEventId) {
$row[6] = getNextId("recurringEventId");
$previousRecurringEventId = $row[6];
}
WebGUI::SQL->write("insert into EventsCalendar_event values ($newEventId, $newWidgetId, ".quote($row[2]).", ".quote($row[3]).", '".$row[4]."', '".$row[5]."', $row[6])");
}
$sth->finish;
}
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from EventsCalendar where widgetId=$_[0]",$_[1]);
WebGUI::SQL->write("delete from EventsCalendar_event where widgetId=$_[0]",$_[1]);
purgeWidget($_[0],$_[1]);
purgeWidget($_[0],$_[1],$namespace);
}
#-------------------------------------------------------------------
sub widgetName {
return WebGUI::International::get(187);
return WebGUI::International::get(2,$namespace);
}
#-------------------------------------------------------------------
@ -40,20 +59,20 @@ sub www_add {
my ($output, %hash);
tie %hash, "Tie::IxHash";
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(188).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(3,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,'Events Calendar').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,'Events Calendar'));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,1));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1));
%hash = WebGUI::Widget::getPositions();
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'',50,5,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::checkbox("proceed",1,1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'',50,5,1));
$output .= tableFormRow(WebGUI::International::get(1,$namespace),WebGUI::Form::checkbox("proceed",1,1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -66,8 +85,8 @@ sub www_add {
sub www_addSave {
my ($widgetId);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create();
WebGUI::SQL->write("insert into FAQ values ($widgetId)",$session{dbh});
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{position});
WebGUI::SQL->write("insert into EventsCalendar values ($widgetId)");
if ($session{form}{proceed} == 1) {
$session{form}{wid} = $widgetId;
return www_addEvent();
@ -83,23 +102,23 @@ sub www_addSave {
sub www_addEvent {
my ($output, $today, %recursEvery);
tie %recursEvery, 'Tie::IxHash';
%recursEvery = ('never'=>WebGUI::International::get(189),
'day'=>WebGUI::International::get(190),
'week'=>WebGUI::International::get(191)
%recursEvery = ('never'=>WebGUI::International::get(4,$namespace),
'day'=>WebGUI::International::get(5,$namespace),
'week'=>WebGUI::International::get(6,$namespace)
);
if (WebGUI::Privilege::canEditPage()) {
($today) = epochToSet(time());
$output = '<h1>'.WebGUI::International::get(192).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = '<h1>'.WebGUI::International::get(7,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","addEventSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("name",20,128).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'',50,10,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</td><td>'.WebGUI::Form::text("startDate",20,30,$today,1,'onBlur="this.form.endDate.value=this.form.startDate.value;this.form.until.value=this.form.startDate.value;"').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(177).'</td><td>'.WebGUI::Form::text("endDate",20,30,$today,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(193).'</td><td>'.WebGUI::Form::selectList("recursEvery",\%recursEvery).' '.WebGUI::International::get(194).' '.WebGUI::Form::text("until",20,30,$today,1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("name",20,128));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'',50,10,1));
$output .= tableFormRow(WebGUI::International::get(176),WebGUI::Form::text("startDate",20,30,$today,1,'onBlur="this.form.endDate.value=this.form.startDate.value;this.form.until.value=this.form.startDate.value;"'));
$output .= tableFormRow(WebGUI::International::get(177),WebGUI::Form::text("endDate",20,30,$today,1));
$output .= tableFormRow(WebGUI::International::get(8,$namespace),WebGUI::Form::selectList("recursEvery",\%recursEvery).' '.WebGUI::International::get(9,$namespace).' '.WebGUI::Form::text("until",20,30,$today,1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -137,7 +156,7 @@ sub www_addEventSave {
}
$i = 0;
while ($eventId[$i] > 0) {
WebGUI::SQL->write("insert into EventsCalendar_event values ($eventId[$i], $session{form}{wid}, ".quote($session{form}{name}).", ".quote($session{form}{description}).", '".$startDate[$i]."', '".$endDate[$i]."', $recurringEventId)",$session{dbh});
WebGUI::SQL->write("insert into EventsCalendar_event values ($eventId[$i], $session{form}{wid}, ".quote($session{form}{name}).", ".quote($session{form}{description}).", '".$startDate[$i]."', '".$endDate[$i]."', $recurringEventId)");
$i++;
}
return www_edit();
@ -146,14 +165,24 @@ sub www_addEventSave {
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
duplicate($session{form}{wid});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_deleteEvent {
my ($output);
if (WebGUI::Privilege::canEditPage()) {
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(195);
$output .= WebGUI::International::get(10,$namespace);
if ($session{form}{rid} > 0) {
$output .= ' '.WebGUI::International::get(196);
$output .= ' '.WebGUI::International::get(11,$namespace);
}
$output .= '?<p><div align="center"><a href="'.$session{page}{url}.'?func=deleteEventConfirm&wid='.$session{form}{wid}.'&eid='.$session{form}{eid}.'&rid='.$session{form}{rid}.'">'.WebGUI::International::get(44).'</a> &nbsp; <a href="'.$session{page}{url}.'?func=edit&wid='.$session{form}{wid}.'">'.WebGUI::International::get(45).'</a></div>';
return $output;
@ -167,9 +196,9 @@ sub www_deleteEventConfirm {
my ($output);
if (WebGUI::Privilege::canEditPage()) {
if ($session{form}{rid} > 0) {
WebGUI::SQL->write("delete from EventsCalendar_event where recurringEventId=$session{form}{rid}",$session{dbh});
WebGUI::SQL->write("delete from EventsCalendar_event where recurringEventId=$session{form}{rid}");
} else {
WebGUI::SQL->write("delete from EventsCalendar_event where eventId=$session{form}{eid}",$session{dbh});
WebGUI::SQL->write("delete from EventsCalendar_event where eventId=$session{form}{eid}");
}
return www_edit();
} else {
@ -183,27 +212,27 @@ sub www_edit {
tie %hash, 'Tie::IxHash';
tie %data, 'Tie::CPHash';
if (WebGUI::Privilege::canEditPage()) {
%data = WebGUI::SQL->quickHash("select * from widget where widget.widgetId=$session{form}{wid}",$session{dbh});
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(197).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%data = getProperties($namespace,$session{form}{wid});;
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(12,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$data{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1,$data{processMacros}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$data{description},50,5,1).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$data{title}));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1,$data{processMacros}));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$data{description},50,5,1));
%hash = WebGUI::Widget::getPositions();
$array[0] = $data{position};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash,\@array).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash,\@array));
$output .= formSave();
$output .= '</table></form>';
$output .= '<p><a href="'.$session{page}{url}.'?func=addEvent&wid='.$session{form}{wid}.'">Add New Event</a><p>';
$output .= '<table border=1 cellpadding=3 cellspacing=0>';
$sth = WebGUI::SQL->read("select eventId, name, recurringEventId from EventsCalendar_event where widgetId='$session{form}{wid}' order by startDate",$session{dbh});
$sth = WebGUI::SQL->read("select eventId, name, recurringEventId from EventsCalendar_event where widgetId='$session{form}{wid}' order by startDate");
while (@event = $sth->array) {
$output .= '<tr><td><a href="'.$session{page}{url}.'?func=editEvent&wid='.$session{form}{wid}.'&eid='.$event[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?func=deleteEvent&wid='.$session{form}{wid}.'&eid='.$event[0].'&rid='.$event[2].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a></td><td>'.$event[1].'</td></tr>';
$output .= '<tr><td><a href="'.$session{page}{url}.'?func=editEvent&wid='.$session{form}{wid}.'&eid='.$event[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?func=deleteEvent&wid='.$session{form}{wid}.'&eid='.$event[0].'&rid='.$event[2].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a></td><td>'.$event[1].'</td></td>';
}
$sth->finish;
$output .= '</table>';
@ -228,19 +257,18 @@ sub www_editEvent {
my ($output, %event);
tie %event, 'Tie::CPHash';
if (WebGUI::Privilege::canEditPage()) {
%event = WebGUI::SQL->quickHash("select * from EventsCalendar_event where eventId='$session{form}{eid}'",$session{dbh});
$output = '<h1>'.WebGUI::International::get(198).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%event = WebGUI::SQL->quickHash("select * from EventsCalendar_event where eventId='$session{form}{eid}'");
$output = '<h1>'.WebGUI::International::get(13,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("eid",$session{form}{eid});
$output .= WebGUI::Form::hidden("func","editEventSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("name",20,128,$event{name}).'</td></tr>'
;
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$event{description},50,10,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</td><td>'.WebGUI::Form::text("startDate",20,30,epochToSet($event{startDate}),1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(177).'</td><td>'.WebGUI::Form::text("endDate",20,30,epochToSet($event{endDate}),1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("name",20,128,$event{name}));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$event{description},50,10,1));
$output .= tableFormRow(WebGUI::International::get(176),WebGUI::Form::text("startDate",20,30,epochToSet($event{startDate}),1));
$output .= tableFormRow(WebGUI::International::get(177),WebGUI::Form::text("endDate",20,30,epochToSet($event{endDate}),1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -253,7 +281,7 @@ sub www_editEvent {
sub www_editEventSave {
my ($eventId);
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update EventsCalendar_event set name=".quote($session{form}{name}).", description=".quote($session{form}{description}).", startDate='".setToEpoch($session{form}{startDate})."', endDate='".setToEpoch($session{form}{endDate})."' where eventId=$session{form}{eid}",$session{dbh});
WebGUI::SQL->write("update EventsCalendar_event set name=".quote($session{form}{name}).", description=".quote($session{form}{description}).", startDate='".setToEpoch($session{form}{startDate})."', endDate='".setToEpoch($session{form}{endDate})."' where eventId=$session{form}{eid}");
return www_edit();
} else {
return WebGUI::Privilege::insufficient();
@ -262,10 +290,9 @@ sub www_editEventSave {
#-------------------------------------------------------------------
sub www_view {
my (%data, @event, $output, $widgetId, $sth, $flag, @previous);
my (%data, @event, $output, $sth, $flag, @previous);
tie %data, 'Tie::CPHash';
$widgetId = shift;
%data = WebGUI::SQL->quickHash("select * from widget where widget.widgetId='$widgetId'",$session{dbh});
%data = getProperties($namespace,$_[0]);
if (defined %data) {
if ($data{displayTitle}) {
$output = "<h1>".$data{title}."</h1>";
@ -273,7 +300,7 @@ sub www_view {
if ($data{description} ne "") {
$output .= $data{description}.'<p>';
}
$sth = WebGUI::SQL->read("select name, description, startDate, endDate from EventsCalendar_event where widgetId='$widgetId' and endDate>".(time()-86400)." order by startDate,endDate",$session{dbh});
$sth = WebGUI::SQL->read("select name, description, startDate, endDate from EventsCalendar_event where widgetId='$_[0]' and endDate>".(time()-86400)." order by startDate,endDate");
while (@event = $sth->array) {
unless ($event[2] == $previous[0] && $event[3] == $previous[1]) {
$output .= "<b>".epochToHuman($event[2],"%c")." ".epochToHuman($event[2],"%D");
@ -309,7 +336,5 @@ sub www_view {
}
1;

View file

@ -17,19 +17,28 @@ use Tie::CPHash;
use WebGUI::International;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
use WebGUI::Widget;
#-------------------------------------------------------------------
sub duplicate {
my (%data, $newWidgetId, $pageId);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{position});
WebGUI::SQL->write("insert into ExtraColumn values ($newWidgetId, '$data{spacer}', '$data{width}', ".quote($data{class}).")");
}
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from ExtraColumn where widgetId=$_[0]",$_[1]);
purgeWidget($_[0],$_[1]);
purgeWidget($_[0],$_[1],$namespace);
}
#-------------------------------------------------------------------
sub widgetName {
return WebGUI::International::get(199);
return WebGUI::International::get(1,$namespace);
}
#-------------------------------------------------------------------
@ -37,19 +46,19 @@ sub www_add {
my ($output, %hash);
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(200).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(2,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= WebGUI::Form::hidden("title","column");
$output .= '<table>';
%hash = WebGUI::Widget::getPositions();
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(201).'</td><td>'.WebGUI::Form::text("spacer",20,3,10).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(202).'</td><td>'.WebGUI::Form::text("width",20,3,200).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(203).'</td><td>'.WebGUI::Form::text("class",20,50,"content").'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::text("spacer",20,3,10));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("width",20,3,200));
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::text("class",20,50,"content"));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -62,35 +71,45 @@ sub www_add {
sub www_addSave {
my ($widgetId, $displayTitle, $image, $attachment);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create();
WebGUI::SQL->write("insert into ExtraColumn values ($widgetId, '$session{form}{spacer}', '$session{form}{width}', ".quote($session{form}{class}).")",$session{dbh});
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{position});
WebGUI::SQL->write("insert into ExtraColumn values ($widgetId, '$session{form}{spacer}', '$session{form}{width}', ".quote($session{form}{class}).")");
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
duplicate($session{form}{wid});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_edit {
my ($output, %data, %hash, @array);
tie %hash, 'Tie::IxHash';
tie %data, 'Tie::CPHash';
if (WebGUI::Privilege::canEditPage()) {
%data = WebGUI::SQL->quickHash("select * from widget,ExtraColumn where widget.widgetId=$session{form}{wid} and widget.widgetId=ExtraColumn.widgetId",$session{dbh});
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(204).'</h1>';
$output .= '<form method="post" action="'.$session{page}{url}.'">';
%data = getProperties($namespace,$session{form}{wid});
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(6,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= WebGUI::Form::hidden("title","column");
$output .= '<table>';
%hash = WebGUI::Widget::getPositions();
$array[0] = $data{position};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(201).'</td><td>'.WebGUI::Form::text("spacer",20,3,$data{spacer}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(202).'</td><td>'.WebGUI::Form::text("width",20,3,$data{width}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(203).'</td><td>'.WebGUI::Form::text("class",20,50,$data{class}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::text("spacer",20,3,$data{spacer}));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("width",20,3,$data{width}));
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::text("class",20,50,$data{class}));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -102,7 +121,7 @@ sub www_edit {
sub www_editSave {
my ($widgetId, $displayTitle);
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update ExtraColumn set spacer='$session{form}{spacer}', width='$session{form}{width}', class=".quote($session{form}{class})." where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update ExtraColumn set spacer='$session{form}{spacer}', width='$session{form}{width}', class=".quote($session{form}{class})." where widgetId=$session{form}{wid}");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -111,10 +130,9 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_view {
my (%data, @test, $output, $widgetId);
my (%data, @test, $output);
tie %data, 'Tie::CPHash';
$widgetId = shift;
%data = WebGUI::SQL->quickHash("select * from ExtraColumn where widgetId='$widgetId'",$session{dbh});
%data = getProperties($namespace,$_[0]);
if (defined %data) {
$output = '</td><td width="'.$data{spacer}.'"></td><td width="'.$data{width}.'" class="'.$data{class}.'" valign="top">';
}

View file

@ -18,31 +18,46 @@ use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
use WebGUI::Widget;
#-------------------------------------------------------------------
sub _reorderQuestions {
my ($sth, $i, $qid);
$sth = WebGUI::SQL->read("select questionId from FAQ_question where widgetId=$_[0] order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select questionId from FAQ_question where widgetId=$_[0] order by sequenceNumber");
while (($qid) = $sth->array) {
WebGUI::SQL->write("update FAQ_question set sequenceNumber='$i' where questionId=$qid",$session{dbh});
WebGUI::SQL->write("update FAQ_question set sequenceNumber='$i' where questionId=$qid");
$i++;
}
$sth->finish;
}
#-------------------------------------------------------------------
sub duplicate {
my ($sth, %data, $newWidgetId, $pageId, @row, $newQuestionId);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{position});
WebGUI::SQL->write("insert into FAQ values ($newWidgetId)");
$sth = WebGUI::SQL->read("select * from FAQ_question");
while (@row = $sth->array) {
$newQuestionId = getNextId("questionId");
WebGUI::SQL->write("insert into FAQ_question values ($newWidgetId, $newQuestionId, ".quote($row[2]).", ".quote($row[3]).", '$row[4]')");
}
$sth->finish;
}
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from FAQ where widgetId=$_[0]",$_[1]);
WebGUI::SQL->write("delete from FAQ_question where widgetId=$_[0]",$_[1]);
purgeWidget($_[0],$_[1]);
purgeWidget($_[0],$_[1],$namespace);
}
#-------------------------------------------------------------------
sub widgetName {
return WebGUI::International::get(205);
return WebGUI::International::get(2,$namespace);
}
#-------------------------------------------------------------------
@ -50,20 +65,20 @@ sub www_add {
my ($output, %hash);
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(206).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(3,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,'F.A.Q.').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,'F.A.Q.'));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,1));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1));
%hash = WebGUI::Widget::getPositions();
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'','','',1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::checkbox("proceed",1,1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'','','',1));
$output .= tableFormRow(WebGUI::International::get(1,$namespace),WebGUI::Form::checkbox("proceed",1,1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -76,8 +91,8 @@ sub www_add {
sub www_addSave {
my ($widgetId);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create();
WebGUI::SQL->write("insert into FAQ values ($widgetId)",$session{dbh});
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{position});
WebGUI::SQL->write("insert into FAQ values ($widgetId)");
if ($session{form}{proceed} == 1) {
$session{form}{wid} = $widgetId;
return www_addQuestion();
@ -93,14 +108,14 @@ sub www_addSave {
sub www_addQuestion {
my ($output);
if (WebGUI::Privilege::canEditPage()) {
$output = '<h1>'.WebGUI::International::get(207).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = '<h1>'.WebGUI::International::get(4,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","addQuestionSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(208).'</td><td>'.WebGUI::Form::textArea("question",'',50,3).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(209).'</td><td>'.WebGUI::Form::textArea("answer",'',50,10,1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::textArea("question",'',50,3));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::textArea("answer",'',50,10,1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -113,21 +128,31 @@ sub www_addQuestion {
sub www_addQuestionSave {
my ($questionId, $nextSeq);
if (WebGUI::Privilege::canEditPage()) {
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from FAQ_question where widgetId=$session{form}{wid}",$session{dbh});
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from FAQ_question where widgetId=$session{form}{wid}");
$questionId = getNextId("questionId");
WebGUI::SQL->write("insert into FAQ_question values ($session{form}{wid}, $questionId, ".quote($session{form}{question}).", ".quote($session{form}{answer}).", '$nextSeq')",$session{dbh});
WebGUI::SQL->write("insert into FAQ_question values ($session{form}{wid}, $questionId, ".quote($session{form}{question}).", ".quote($session{form}{answer}).", '$nextSeq')");
return www_edit();
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
duplicate($session{form}{wid});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_deleteQuestion {
my ($output);
if (WebGUI::Privilege::canEditPage()) {
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(210).'<p>';
$output .= WebGUI::International::get(7,$namespace).'<p>';
$output .= '<div align="center"><a href="'.$session{page}{url}.'?func=deleteQuestionConfirm&wid='.$session{form}{wid}.'&qid='.$session{form}{qid}.'">'.WebGUI::International::get(44).'</a>';
$output .= ' &nbsp; <a href="'.$session{page}{url}.'?func=edit&wid='.$session{form}{wid}.'">'.WebGUI::International::get(45).'</a></div>';
return $output;
@ -140,7 +165,7 @@ sub www_deleteQuestion {
sub www_deleteQuestionConfirm {
my ($output);
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("delete from FAQ_question where questionId=$session{form}{qid}",$session{dbh});
WebGUI::SQL->write("delete from FAQ_question where questionId=$session{form}{qid}");
_reorderQuestions($session{form}{wid});
return www_edit();
} else {
@ -154,27 +179,27 @@ sub www_edit {
tie %data, 'Tie::CPHash';
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
%data = WebGUI::SQL->quickHash("select * from widget where widget.widgetId=$session{form}{wid}",$session{dbh});
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output = '<h1>'.WebGUI::International::get(211).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%data = getProperties($namespace,$session{form}{wid});
$output = helpLink(1,$namespace);
$output = '<h1>'.WebGUI::International::get(8,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$data{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros","1",$data{processMacros}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$data{title}));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros","1",$data{processMacros}));
%hash = WebGUI::Widget::getPositions();
$array[0] = $data{position};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$data{description},'','',1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$data{description},'','',1));
$output .= formSave();
$output .= '</table></form>';
$output .= '<p><a href="'.$session{page}{url}.'?func=addQuestion&wid='.$session{form}{wid}.'">'.WebGUI::International::get(212).'</a><p>';
$output .= '<p><a href="'.$session{page}{url}.'?func=addQuestion&wid='.$session{form}{wid}.'">'.WebGUI::International::get(9,$namespace).'</a><p>';
$output .= '<table border=1 cellpadding=3 cellspacing=0>';
$sth = WebGUI::SQL->read("select questionId,question from FAQ_question where widgetId='$session{form}{wid}' order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select questionId,question from FAQ_question where widgetId='$session{form}{wid}' order by sequenceNumber");
while (@question = $sth->array) {
$output .= '<tr><td><a href="'.$session{page}{url}.'?func=editQuestion&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?func=deleteQuestion&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveQuestionUp&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/upArrow.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveQuestionDown&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/downArrow.gif" border=0></a></td><td>'.$question[1].'</td></tr>';
$output .= '<tr><td><a href="'.$session{page}{url}.'?func=editQuestion&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?func=deleteQuestion&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveQuestionUp&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/upArrow.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveQuestionDown&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/downArrow.gif" border=0></a></td><td>'.$question[1].'</td><tr>';
}
$sth->finish;
$output .= '</table>';
@ -199,16 +224,16 @@ sub www_editQuestion {
my ($output, %question);
tie %question, 'Tie::CPHash';
if (WebGUI::Privilege::canEditPage()) {
%question = WebGUI::SQL->quickHash("select * from FAQ_question where questionId='$session{form}{qid}'",$session{dbh});
$output = '<h1>'.WebGUI::International::get(213).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%question = WebGUI::SQL->quickHash("select * from FAQ_question where questionId='$session{form}{qid}'");
$output = '<h1>'.WebGUI::International::get(10,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("qid",$session{form}{qid});
$output .= WebGUI::Form::hidden("func","editQuestionSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(208).'</td><td>'.WebGUI::Form::textArea("question",$question{question},50,3).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(209).'</td><td>'.WebGUI::Form::textArea("answer",$question{answer},50,10,1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::textArea("question",$question{question},50,3));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::textArea("answer",$question{answer},50,10,1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -220,7 +245,7 @@ sub www_editQuestion {
#-------------------------------------------------------------------
sub www_editQuestionSave {
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update FAQ_question set question=".quote($session{form}{question}).", answer=".quote($session{form}{answer})." where questionId=$session{form}{qid}",$session{dbh});
WebGUI::SQL->write("update FAQ_question set question=".quote($session{form}{question}).", answer=".quote($session{form}{answer})." where questionId=$session{form}{qid}");
return www_edit();
} else {
return WebGUI::Privilege::insufficient();
@ -231,11 +256,11 @@ sub www_editQuestionSave {
sub www_moveQuestionDown {
my (@data, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from FAQ_question where questionId=$session{form}{qid}",$session{dbh});
@data = WebGUI::SQL->quickArray("select questionId from FAQ_question where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq+1 group by widgetId",$session{dbh});
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from FAQ_question where questionId=$session{form}{qid}");
@data = WebGUI::SQL->quickArray("select questionId from FAQ_question where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq+1 group by widgetId");
if ($data[0] ne "") {
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber+1 where questionId=$session{form}{qid}",$session{dbh});
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber-1 where questionId=$data[0]",$session{dbh});
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber+1 where questionId=$session{form}{qid}");
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber-1 where questionId=$data[0]");
}
return www_edit();
} else {
@ -247,11 +272,11 @@ sub www_moveQuestionDown {
sub www_moveQuestionUp {
my (@data, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from FAQ_question where questionId=$session{form}{qid}",$session{dbh});
@data = WebGUI::SQL->quickArray("select questionId from FAQ_question where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq-1 group by widgetId",$session{dbh});
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from FAQ_question where questionId=$session{form}{qid}");
@data = WebGUI::SQL->quickArray("select questionId from FAQ_question where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq-1 group by widgetId");
if ($data[0] ne "") {
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber-1 where questionId=$session{form}{qid}",$session{dbh});
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber+1 where questionId=$data[0]",$session{dbh});
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber-1 where questionId=$session{form}{qid}");
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber+1 where questionId=$data[0]");
}
return www_edit();
} else {
@ -261,10 +286,9 @@ sub www_moveQuestionUp {
#-------------------------------------------------------------------
sub www_view {
my (%data, @question, $output, $widgetId, $sth, $qNa);
my (%data, @question, $output, $sth, $qNa);
tie %data, 'Tie::CPHash';
$widgetId = shift;
%data = WebGUI::SQL->quickHash("select * from widget where widget.widgetId='$widgetId'",$session{dbh});
%data = getProperties($namespace,$_[0]);
if (defined %data) {
if ($data{displayTitle} == 1) {
$output = "<h1>".$data{title}."</h1>";
@ -273,7 +297,7 @@ sub www_view {
$output .= $data{description};
}
$output .= '<ul>';
$sth = WebGUI::SQL->read("select questionId,question,answer from FAQ_question where widgetId='$widgetId' order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select questionId,question,answer from FAQ_question where widgetId='$_[0]' order by sequenceNumber");
while (@question = $sth->array) {
$output .= '<li><a href="#'.$question[0].'">'.$question[1].'</a>';
$qNa .= '<a name="'.$question[0].'"><span class="faqQuestion">'.$question[1].'</span></a><br>'.$question[2].'<p>';

View file

@ -14,23 +14,34 @@ our $namespace = "Item";
use strict;
use Tie::CPHash;
use WebGUI::Attachment;
use WebGUI::Form;
use WebGUI::International;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
use WebGUI::Widget;
#-------------------------------------------------------------------
sub duplicate {
my (%data, $newWidgetId, $pageId);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{position});
WebGUI::Attachment::copy($data{attachment},$_[0],$newWidgetId);
WebGUI::SQL->write("insert into Item values ($newWidgetId, ".quote($data{description}).", ".quote($data{linkURL}).", ".quote($data{attachment}).")");
}
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from Item where widgetId=$_[0]",$_[1]);
purgeWidget($_[0],$_[1]);
purgeWidget($_[0],$_[1],$namespace);
}
#-------------------------------------------------------------------
sub widgetName {
return "Item";
return WebGUI::International::get(4,$namespace);
}
#-------------------------------------------------------------------
@ -38,20 +49,20 @@ sub www_add {
my ($output, %hash);
tie %hash,'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>Add '.widgetName().'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output .= WebGUI::Form::hidden("widget","Item");
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(4,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,widgetName()).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1,1).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,30,widgetName()));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1,1));
%hash = WebGUI::Widget::getPositions();
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::text("linkURL",20,2048).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(2,$namespace).'</td><td>'.WebGUI::Form::file("attachment").'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",''));
$output .= tableFormRow(WebGUI::International::get(1,$namespace),WebGUI::Form::text("linkURL",20,2048));
$output .= tableFormRow(WebGUI::International::get(2,$namespace),WebGUI::Form::file("attachment"));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -64,19 +75,29 @@ sub www_add {
sub www_addSave {
my ($widgetId, $attachment);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create();
$attachment = saveAttachment("attachment",$widgetId);
WebGUI::SQL->write("insert into Item values ($widgetId, ".quote($session{form}{description}).", ".quote($session{form}{linkURL}).", ".quote($attachment).")",$session{dbh});
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{position});
$attachment = WebGUI::Attachment::save("attachment",$widgetId);
WebGUI::SQL->write("insert into Item values ($widgetId, ".quote($session{form}{description}).", ".quote($session{form}{linkURL}).", ".quote($attachment).")");
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
duplicate($session{form}{wid});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_deleteAttachment {
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update Item set attachment='' where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update Item set attachment='' where widgetId=$session{form}{wid}");
return www_edit();
} else {
return WebGUI::Privilege::insufficient();
@ -89,25 +110,26 @@ sub www_edit {
tie %data, 'Tie::CPHash';
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
%data = WebGUI::SQL->quickHash("select * from widget,Item where widget.widgetId=Item.widgetId and widget.widgetId=$session{form}{wid}",$session{dbh});
$output .= '<h1>Edit '.widgetName().'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%data = getProperties($namespace,$session{form}{wid});
$output .= helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(4,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,$data{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros","1",$data{processMacros}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,30,$data{title}));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros","1",$data{processMacros}));
%hash = WebGUI::Widget::getPositions();
$array[0] = $data{position};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$data{description}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::text("linkURL",20,2048,$data{linkURL}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$data{description}));
$output .= tableFormRow(WebGUI::International::get(1,$namespace),WebGUI::Form::text("linkURL",20,2048,$data{linkURL}));
if ($data{attachment} ne "") {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(2,$namespace).'</td><td><a href="'.$session{page}{url}.'?func=deleteAttachment&wid='.$session{form}{wid}.'">'.WebGUI::International::get(3,$namespace).'</a></td></tr>';
$output .= tableFormRow(WebGUI::International::get(2,$namespace),'<a href="'.$session{page}{url}.'?func=deleteAttachment&wid='.$session{form}{wid}.'">'.WebGUI::International::get(3,$namespace).'</a>');
} else {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(2,$namespace).'</td><td>'.WebGUI::Form::file("attachment").'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(2,$namespace),WebGUI::Form::file("attachment"));
}
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -120,11 +142,11 @@ sub www_editSave {
my ($attachment);
if (WebGUI::Privilege::canEditPage()) {
update();
$attachment = saveAttachment("attachment",$session{form}{wid});
$attachment = WebGUI::Attachment::save("attachment",$session{form}{wid});
if ($attachment ne "") {
$attachment = ', attachment='.quote($attachment);
}
WebGUI::SQL->write("update Item set description=".quote($session{form}{description}).", linkURL=".quote($session{form}{linkURL}).$attachment." where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update Item set description=".quote($session{form}{description}).", linkURL=".quote($session{form}{linkURL}).$attachment." where widgetId=$session{form}{wid}");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -133,10 +155,9 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_view {
my (%data, @test, $output, $widgetId);
my (%data, @test, $output);
tie %data, 'Tie::CPHash';
$widgetId = shift;
%data = WebGUI::SQL->quickHash("select * from widget,Item where widget.widgetId='$widgetId' and widget.WidgetId=Item.widgetId",$session{dbh});
%data = getProperties($namespace,$_[0]);
if (defined %data) {
if ($data{linkURL} ne "") {
$output .= '<a href="'.$data{linkURL}.'"><span class="itemTitle">'.$data{title}.'</span></a>';
@ -144,7 +165,7 @@ sub www_view {
$output .= '<span class="itemTitle">'.$data{title}.'</span>';
}
if ($data{attachment} ne "") {
$output .= ' - <a href="'.$session{setting}{attachmentDirectoryWeb}.'/'.$widgetId.'/'.$data{attachment}.'"><img src="'.$session{setting}{lib}.'/smallAttachment.gif" border=0 alt="Download Attachment"></a>';
$output .= ' - <a href="'.$session{setting}{attachmentDirectoryWeb}.'/'.$_[0].'/'.$data{attachment}.'"><img src="'.$session{setting}{lib}.'/smallAttachment.gif" border=0 alt="'.WebGUI::International::get(5,$namespace).'"></a>';
}
if ($data{description} ne "") {
$output .= ' - '.$data{description};

View file

@ -18,31 +18,46 @@ use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
use WebGUI::Widget;
#-------------------------------------------------------------------
sub _reorderLinks {
my ($sth, $i, $lid);
$sth = WebGUI::SQL->read("select linkId from LinkList_link where widgetId=$_[0] order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select linkId from LinkList_link where widgetId=$_[0] order by sequenceNumber");
while (($lid) = $sth->array) {
WebGUI::SQL->write("update LinkList_link set sequenceNumber='$i' where linkId=$lid",$session{dbh});
WebGUI::SQL->write("update LinkList_link set sequenceNumber='$i' where linkId=$lid");
$i++;
}
$sth->finish;
}
#-------------------------------------------------------------------
sub duplicate {
my ($sth, %data, $newWidgetId, $pageId, @row, $newLinkId);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{position});
WebGUI::SQL->write("insert into LinkList values ($newWidgetId, '$data{indent}', '$data{lineSpacing}', ".quote($data{bullet}).")");
$sth = WebGUI::SQL->read("select * from LinkList_link");
while (@row = $sth->array) {
$newLinkId = getNextId("linkId");
WebGUI::SQL->write("insert into LinkList_link values ($newWidgetId, $newLinkId, ".quote($row[2]).", ".quote($row[3]).", ".quote($row[4]).", '$row[5]', '$row[6]')");
}
$sth->finish;
}
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from LinkList where widgetId=$_[0]",$_[1]);
WebGUI::SQL->write("delete from LinkList_link where widgetId=$_[0]",$_[1]);
purgeWidget($_[0],$_[1]);
purgeWidget($_[0],$_[1],$namespace);
}
#-------------------------------------------------------------------
sub widgetName {
return WebGUI::International::get(214);
return WebGUI::International::get(6,$namespace);
}
#-------------------------------------------------------------------
@ -50,23 +65,23 @@ sub www_add {
my ($output, %hash);
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(219).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(11,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,'Link List').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,'Link List'));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,1));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1));
%hash = WebGUI::Widget::getPositions();
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'',50,5,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::text("indent",20,2,0).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(2,$namespace).'</td><td>'.WebGUI::Form::text("lineSpacing",20,1,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(4,$namespace).'</td><td>'.WebGUI::Form::text("bullet",20,255,'&middot;').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(5,$namespace).'</td><td>'.WebGUI::Form::checkbox("proceed",1,1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'',50,5,1));
$output .= tableFormRow(WebGUI::International::get(1,$namespace),WebGUI::Form::text("indent",20,2,0));
$output .= tableFormRow(WebGUI::International::get(2,$namespace),WebGUI::Form::text("lineSpacing",20,1,1));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("bullet",20,255,'&middot;'));
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::checkbox("proceed",1,1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -79,8 +94,8 @@ sub www_add {
sub www_addSave {
my ($widgetId);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create();
WebGUI::SQL->write("insert into LinkList values ($widgetId, '$session{form}{indent}', '$session{form}{lineSpacing}', ".quote($session{form}{bullet}).")",$session{dbh});
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{position});
WebGUI::SQL->write("insert into LinkList values ($widgetId, '$session{form}{indent}', '$session{form}{lineSpacing}', ".quote($session{form}{bullet}).")");
if ($session{form}{proceed} == 1) {
$session{form}{wid} = $widgetId;
return www_addLink();
@ -96,16 +111,16 @@ sub www_addSave {
sub www_addLink {
my ($output);
if (WebGUI::Privilege::canEditPage()) {
$output = '<h1>'.WebGUI::International::get(215).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = '<h1>'.WebGUI::International::get(7,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","addLinkSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("name",20,128).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(216).'</td><td>'.WebGUI::Form::text("url",20,1024).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(3,$namespace).'</td><td>'.WebGUI::Form::checkbox("newWindow",1,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'',50,10).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("name",20,128));
$output .= tableFormRow(WebGUI::International::get(8,$namespace),WebGUI::Form::text("url",20,1024));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::checkbox("newWindow",1,1));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'',50,10));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -118,21 +133,31 @@ sub www_addLink {
sub www_addLinkSave {
my ($linkId, $nextSeq);
if (WebGUI::Privilege::canEditPage()) {
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from LinkList_link where widgetId=$session{form}{wid}",$session{dbh});
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from LinkList_link where widgetId=$session{form}{wid}");
$linkId = getNextId("linkId");
WebGUI::SQL->write("insert into LinkList_link values ($session{form}{wid}, $linkId, ".quote($session{form}{name}).", ".quote($session{form}{url}).", ".quote($session{form}{description}).", '$nextSeq', '$session{form}{newWindow}')",$session{dbh});
WebGUI::SQL->write("insert into LinkList_link values ($session{form}{wid}, $linkId, ".quote($session{form}{name}).", ".quote($session{form}{url}).", ".quote($session{form}{description}).", '$nextSeq', '$session{form}{newWindow}')");
return www_edit();
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
duplicate($session{form}{wid});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_deleteLink {
my ($output);
if (WebGUI::Privilege::canEditPage()) {
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(217).'<p>';
$output .= WebGUI::International::get(9,$namespace).'<p>';
$output .= '<div align="center"><a href="'.$session{page}{url}.'?func=deleteLinkConfirm&wid='.$session{form}{wid}.'&lid='.$session{form}{lid}.'">'.WebGUI::International::get(44).'</a>';
$output .= ' &nbsp; <a href="'.$session{page}{url}.'?func=edit&wid='.$session{form}{wid}.'">'.WebGUI::International::get(45).'</a></div>';
return $output;
@ -145,7 +170,7 @@ sub www_deleteLink {
sub www_deleteLinkConfirm {
my ($output);
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("delete from LinkList_link where linkId=$session{form}{lid}",$session{dbh});
WebGUI::SQL->write("delete from LinkList_link where linkId=$session{form}{lid}");
_reorderLinks($session{form}{wid});
return www_edit();
} else {
@ -159,28 +184,28 @@ sub www_edit {
tie %data, 'Tie::CPHash';
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
%data = WebGUI::SQL->quickHash("select * from widget,LinkList where widget.widgetId=$session{form}{wid} and widget.widgetId=LinkList.widgetId",$session{dbh});
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(218).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%data = getProperties($namespace,$session{form}{wid});
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(10,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$data{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1,$data{processMacros}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$data{title}));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1,$data{processMacros}));
%hash = WebGUI::Widget::getPositions();
$array[0] = $data{position};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$data{description},50,5,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::text("indent",20,2,$data{indent}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(2,$namespace).'</td><td>'.WebGUI::Form::text("lineSpacing",20,1,$data{lineSpacing}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(4,$namespace).'</td><td>'.WebGUI::Form::text("bullet",20,255,$data{bullet}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$data{description},50,5,1));
$output .= tableFormRow(WebGUI::International::get(1,$namespace),WebGUI::Form::text("indent",20,2,$data{indent}));
$output .= tableFormRow(WebGUI::International::get(2,$namespace),WebGUI::Form::text("lineSpacing",20,1,$data{lineSpacing}));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("bullet",20,255,$data{bullet}));
$output .= formSave();
$output .= '</table></form>';
$output .= '<p><a href="'.$session{page}{url}.'?func=addLink&wid='.$session{form}{wid}.'">'.WebGUI::International::get(221).'</a><p>';
$output .= '<p><a href="'.$session{page}{url}.'?func=addLink&wid='.$session{form}{wid}.'">'.WebGUI::International::get(13,$namespace).'</a><p>';
$output .= '<table border=1 cellpadding=3 cellspacing=0>';
$sth = WebGUI::SQL->read("select linkId, name from LinkList_link where widgetId='$session{form}{wid}' order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select linkId, name from LinkList_link where widgetId='$session{form}{wid}' order by sequenceNumber");
while (@link = $sth->array) {
$output .= '<tr><td><a href="'.$session{page}{url}.'?func=editLink&wid='.$session{form}{wid}.'&lid='.$link[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?func=deleteLink&wid='.$session{form}{wid}.'&lid='.$link[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveLinkUp&wid='.$session{form}{wid}.'&lid='.$link[0].'"><img src="'.$session{setting}{lib}.'/upArrow.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveLinkDown&wid='.$session{form}{wid}.'&lid='.$link[0].'"><img src="'.$session{setting}{lib}.'/downArrow.gif" border=0></a></td><td>'.$link[1].'</td></tr>';
}
@ -196,7 +221,7 @@ sub www_edit {
sub www_editSave {
if (WebGUI::Privilege::canEditPage()) {
update();
WebGUI::SQL->write("update LinkList set indent='$session{form}{indent}', lineSpacing='$session{form}{lineSpacing}', bullet=".quote($session{form}{bullet})." where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update LinkList set indent='$session{form}{indent}', lineSpacing='$session{form}{lineSpacing}', bullet=".quote($session{form}{bullet})." where widgetId=$session{form}{wid}");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -208,18 +233,18 @@ sub www_editLink {
my ($output, %link);
tie %link, 'Tie::CPHash';
if (WebGUI::Privilege::canEditPage()) {
%link = WebGUI::SQL->quickHash("select * from LinkList_link where linkId='$session{form}{lid}'",$session{dbh});
$output = '<h1>'.WebGUI::International::get(220).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%link = WebGUI::SQL->quickHash("select * from LinkList_link where linkId='$session{form}{lid}'");
$output = '<h1>'.WebGUI::International::get(12,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("lid",$session{form}{lid});
$output .= WebGUI::Form::hidden("func","editLinkSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("name",20,128,$link{name}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(216).'</td><td>'.WebGUI::Form::text("url",20,2048,$link{url}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(3,$namespace).'</td><td>'.WebGUI::Form::checkbox("newWindow",1,$link{newWindow}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$link{description},50,10).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("name",20,128,$link{name}));
$output .= tableFormRow(WebGUI::International::get(8,$namespace),WebGUI::Form::text("url",20,2048,$link{url}));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::checkbox("newWindow",1,$link{newWindow}));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$link{description},50,10));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -231,7 +256,7 @@ sub www_editLink {
#-------------------------------------------------------------------
sub www_editLinkSave {
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("update LinkList_link set name=".quote($session{form}{name}).", url=".quote($session{form}{url}).", description=".quote($session{form}{description}).", newWindow='$session{form}{newWindow}' where linkId=$session{form}{lid}",$session{dbh});
WebGUI::SQL->write("update LinkList_link set name=".quote($session{form}{name}).", url=".quote($session{form}{url}).", description=".quote($session{form}{description}).", newWindow='$session{form}{newWindow}' where linkId=$session{form}{lid}");
return www_edit();
} else {
return WebGUI::Privilege::insufficient();
@ -242,11 +267,11 @@ sub www_editLinkSave {
sub www_moveLinkDown {
my (@data, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from LinkList_link where linkId=$session{form}{lid}",$session{dbh});
@data = WebGUI::SQL->quickArray("select linkId from LinkList_link where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq+1 group by widgetId",$session{dbh});
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from LinkList_link where linkId=$session{form}{lid}");
@data = WebGUI::SQL->quickArray("select linkId from LinkList_link where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq+1 group by widgetId");
if ($data[0] ne "") {
WebGUI::SQL->write("update LinkList_link set sequenceNumber=sequenceNumber+1 where linkId=$session{form}{lid}",$session{dbh});
WebGUI::SQL->write("update LinkList_link set sequenceNumber=sequenceNumber-1 where linkId=$data[0]",$session{dbh});
WebGUI::SQL->write("update LinkList_link set sequenceNumber=sequenceNumber+1 where linkId=$session{form}{lid}");
WebGUI::SQL->write("update LinkList_link set sequenceNumber=sequenceNumber-1 where linkId=$data[0]");
}
return www_edit();
} else {
@ -258,11 +283,11 @@ sub www_moveLinkDown {
sub www_moveLinkUp {
my (@data, $thisSeq);
if (WebGUI::Privilege::canEditPage()) {
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from LinkList_link where linkId=$session{form}{lid}",$session{dbh});
@data = WebGUI::SQL->quickArray("select linkId from LinkList_link where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq-1 group by widgetId",$session{dbh});
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from LinkList_link where linkId=$session{form}{lid}");
@data = WebGUI::SQL->quickArray("select linkId from LinkList_link where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq-1 group by widgetId");
if ($data[0] ne "") {
WebGUI::SQL->write("update LinkList_link set sequenceNumber=sequenceNumber-1 where linkId=$session{form}{lid}",$session{dbh});
WebGUI::SQL->write("update LinkList_link set sequenceNumber=sequenceNumber+1 where linkId=$data[0]",$session{dbh});
WebGUI::SQL->write("update LinkList_link set sequenceNumber=sequenceNumber-1 where linkId=$session{form}{lid}");
WebGUI::SQL->write("update LinkList_link set sequenceNumber=sequenceNumber+1 where linkId=$data[0]");
}
return www_edit();
} else {
@ -272,10 +297,9 @@ sub www_moveLinkUp {
#-------------------------------------------------------------------
sub www_view {
my (%data, $i, $indent, $lineSpacing, @link, $output, $widgetId, $sth);
my (%data, $i, $indent, $lineSpacing, @link, $output, $sth);
tie %data, 'Tie::CPHash';
$widgetId = shift;
%data = WebGUI::SQL->quickHash("select * from widget,LinkList where widget.widgetId='$widgetId' and widget.widgetId=LinkList.widgetId",$session{dbh});
%data = getProperties($namespace,$_[0]);
if (defined %data) {
if ($data{displayTitle}) {
$output = "<h1>".$data{title}."</h1>";
@ -289,7 +313,7 @@ sub www_view {
for ($i=0;$i<$data{lineSpacing};$i++) {
$lineSpacing .= "<br>";
}
$sth = WebGUI::SQL->read("select name, url, description, newWindow from LinkList_link where widgetId='$widgetId' order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select name, url, description, newWindow from LinkList_link where widgetId='$_[0]' order by sequenceNumber");
while (@link = $sth->array) {
$output .= $indent.$data{bullet}.'<a href="'.$link[1].'"';
if ($link[3]) {

View file

@ -20,28 +20,31 @@ use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
use WebGUI::Widget;
#-------------------------------------------------------------------
sub _getBoardProperties {
my (%board);
tie %board, 'Tie::CPHash';
%board = WebGUI::SQL->quickHash("select * from widget, MessageBoard where widget.widgetId=MessageBoard.widgetId and widget.widgetId=$_[0]",$session{dbh});
return %board;
sub duplicate {
my (%data, $newWidgetId, $pageId);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{position});
WebGUI::SQL->write("insert into MessageBoard values ($newWidgetId, $data{groupToPost}, '$data{messagesPerPage}', '$data{editTimeout}')");
WebGUI::Discussion::duplicate($_[0],$newWidgetId);
}
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from discussion where widgetId=$_[0]",$_[1]);
WebGUI::SQL->write("delete from MessageBoard where widgetId=$_[0]",$_[1]);
purgeWidget($_[0],$_[1]);
purgeWidget($_[0],$_[1],$namespace);
WebGUI::Discussion::purgeWidget($_[0],$_[1]);
}
#-------------------------------------------------------------------
sub widgetName {
return WebGUI::International::get(223);
return WebGUI::International::get(2,$namespace);
}
#-------------------------------------------------------------------
@ -49,24 +52,24 @@ sub www_add {
my ($output, %hash, @array);
tie %hash, "Tie::IxHash";
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(222).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(1,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,'Message Board').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,'Message Board'));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,1));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1));
%hash = WebGUI::Widget::getPositions();
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'',50,5,1).'</td></tr>';
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName",$session{dbh});
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'',50,5,1));
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName");
$array[0] = 2;
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(224).'</td><td>'.WebGUI::Form::selectList("groupToPost",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(225).'</td><td>'.WebGUI::Form::text("messagesPerPage",20,2,30).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(226).'</td><td>'.WebGUI::Form::text("editTimeout",20,3,1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::selectList("groupToPost",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("messagesPerPage",20,2,30));
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::text("editTimeout",20,3,1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -79,40 +82,50 @@ sub www_add {
sub www_addSave {
my ($widgetId);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create();
WebGUI::SQL->write("insert into MessageBoard values ($widgetId, $session{form}{groupToPost}, '$session{form}{messagesPerPage}', '$session{form}{editTimeout}')",$session{dbh});
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{position});
WebGUI::SQL->write("insert into MessageBoard values ($widgetId, $session{form}{groupToPost}, '$session{form}{messagesPerPage}', '$session{form}{editTimeout}')");
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
duplicate($session{form}{wid});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_edit {
my ($output, %board, %hash, @array);
tie %hash, "Tie::IxHash";
if (WebGUI::Privilege::canEditPage()) {
tie %board, 'Tie::CPHash';
%board = _getBoardProperties($session{form}{wid});
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(227).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%board = getProperties($namespace,$session{form}{wid});
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(6,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$board{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$board{displayTitle}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros","1",$board{processMacros}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$board{title}));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle","1",$board{displayTitle}));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros","1",$board{processMacros}));
%hash = WebGUI::Widget::getPositions();
$array[0] = $board{position};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$board{description},50,5,1).'</td></tr>';
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName",$session{dbh});
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$board{description},50,5,1));
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName");
$array[0] = $board{groupToPost};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(224).'</td><td>'.WebGUI::Form::selectList("groupToPost",\%hash,\@array,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(225).'</td><td>'.WebGUI::Form::text("messagesPerPage",20,2,$board{messagesPerPage}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(226).'</td><td>'.WebGUI::Form::text("editTimeout",20,2,$board{editTimeout}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::selectList("groupToPost",\%hash,\@array,1));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("messagesPerPage",20,2,$board{messagesPerPage}));
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::text("editTimeout",20,2,$board{editTimeout}));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -125,7 +138,7 @@ sub www_edit {
sub www_editSave {
if (WebGUI::Privilege::canEditPage()) {
update();
WebGUI::SQL->write("update MessageBoard set groupToPost=$session{form}{groupToPost}, messagesPerPage=$session{form}{messagesPerPage}, editTimeout=$session{form}{editTimeout} where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update MessageBoard set groupToPost=$session{form}{groupToPost}, messagesPerPage=$session{form}{messagesPerPage}, editTimeout=$session{form}{editTimeout} where widgetId=$session{form}{wid}");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -136,7 +149,7 @@ sub www_editSave {
sub www_editMessage {
my (%board);
tie %board, 'Tie::CPHash';
%board = _getBoardProperties($session{form}{wid});
%board = getProperties($namespace,$session{form}{wid});
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
return WebGUI::Discussion::editMessage();
} else {
@ -148,7 +161,7 @@ sub www_editMessage {
sub www_editMessageSave {
my (%board);
tie %board, 'Tie::CPHash';
%board = _getBoardProperties($session{form}{wid});
%board = getProperties($namespace,$session{form}{wid});
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
WebGUI::Discussion::editMessageSave();
return www_showMessage();
@ -161,7 +174,7 @@ sub www_editMessageSave {
sub www_postNewMessage {
my (%board);
tie %board, 'Tie::CPHash';
%board = _getBoardProperties($session{form}{wid});
%board = getProperties($namespace,$session{form}{wid});
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
return WebGUI::Discussion::postNewMessage();
} else {
@ -173,7 +186,7 @@ sub www_postNewMessage {
sub www_postNewMessageSave {
my (%board);
tie %board, 'Tie::CPHash';
%board = _getBoardProperties($session{form}{wid});
%board = getProperties($namespace,$session{form}{wid});
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
return WebGUI::Discussion::postNewMessageSave();
} else {
@ -185,7 +198,7 @@ sub www_postNewMessageSave {
sub www_postReply {
my (%board);
tie %board, 'Tie::CPHash';
%board = _getBoardProperties($session{form}{wid});
%board = getProperties($namespace,$session{form}{wid});
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
return WebGUI::Discussion::postReply();
} else {
@ -197,7 +210,7 @@ sub www_postReply {
sub www_postReplySave {
my (%board);
tie %board, 'Tie::CPHash';
%board = _getBoardProperties($session{form}{wid});
%board = getProperties($namespace,$session{form}{wid});
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
WebGUI::Discussion::postReplySave();
return www_showMessage();
@ -212,37 +225,37 @@ sub www_showMessage {
tie %message, 'Tie::CPHash';
tie %board, 'Tie::CPHash';
%message = WebGUI::Discussion::getMessage($session{form}{mid});
%board = _getBoardProperties($session{form}{wid});
%board = getProperties($namespace,$session{form}{wid});
$html .= '<h1>'.$message{subject}.'</h1>';
$html .= '<table width="100%" cellpadding=3 cellspacing=1 border=0><tr><td class="tableHeader">';
$html .= '<b>'.WebGUI::International::get(238).'</b> <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$message{userId}.'">'.$message{username}.'</a><br>';
$html .= "<b>".WebGUI::International::get(239)."</b> ".epochToHuman($message{dateOfPost},"%w, %c %D, %y at %H:%n%p")."<br>";
$html .= "<b>".WebGUI::International::get(240)."</b> ".$message{widgetId}."-".$message{rid}."-".$message{pid}."-".$message{messageId}."<br>";
$html .= '<b>'.WebGUI::International::get(7,$namespace).'</b> <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$message{userId}.'">'.$message{username}.'</a><br>';
$html .= "<b>".WebGUI::International::get(8,$namespace)."</b> ".epochToHuman($message{dateOfPost},"%w, %c %D, %y at %H:%n%p")."<br>";
$html .= "<b>".WebGUI::International::get(9,$namespace)."</b> ".$message{widgetId}."-".$message{rid}."-".$message{pid}."-".$message{messageId}."<br>";
$html .= '</td>';
$html .= '<td rowspan=2 valign="top" class="tableMenu" nowrap>';
$html .= '<a href="'.$session{page}{url}.'?func=postReply&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(236).'</a><br>';
$html .= '<a href="'.$session{page}{url}.'?func=postReply&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(13,$namespace).'</a><br>';
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} && $message{'userId'} eq $session{user}{userId}) {
$html .= '<a href="'.$session{page}{url}.'?func=editMessage&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(235).'</a><br>';
$html .= '<a href="'.$session{page}{url}.'?func=editMessage&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(12,$namespace).'</a><br>';
}
$html .= '<a href="'.$session{page}{url}.'">'.WebGUI::International::get(242).'</a><br>';
@data = WebGUI::SQL->quickArray("select max(messageId) from discussion where widgetId=$message{widgetId} and pid=0 and messageId<$message{rid}",$session{dbh});
$html .= '<a href="'.$session{page}{url}.'">'.WebGUI::International::get(11,$namespace).'</a><br>';
@data = WebGUI::SQL->quickArray("select max(messageId) from discussion where widgetId=$message{widgetId} and pid=0 and messageId<$message{rid}");
if ($data[0] ne "") {
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">&laquo; '.WebGUI::International::get(241).'</a><br>';
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">&laquo; '.WebGUI::International::get(10,$namespace).'</a><br>';
# } else {
# $html .= '&laquo; '.WebGUI::International::get(241).'</a><br>';
# $html .= '&laquo; '.WebGUI::International::get(10,$namespace).'</a><br>';
}
@data = WebGUI::SQL->quickArray("select min(messageId) from discussion where widgetId=$message{widgetId} and pid=0 and messageId>$message{rid}",$session{dbh});
@data = WebGUI::SQL->quickArray("select min(messageId) from discussion where widgetId=$message{widgetId} and pid=0 and messageId>$message{rid}");
if ($data[0] ne "") {
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(243).' &raquo;</a><br>';
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(14,$namespace).' &raquo;</a><br>';
# } else {
# $html .= WebGUI::International::get(243).' &raquo;<br>';
# $html .= WebGUI::International::get(14,$namespace).' &raquo;<br>';
}
$html .= '</tr><tr><td class="tableData">';
$html .= $message{message};
$html .= '</td></tr></table>';
$html .= '<table border=0 cellpadding=2 cellspacing=1 width="100%">';
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).'</td><td class="tableHeader">'.WebGUI::International::get(244).'</td><td class="tableHeader">'.WebGUI::International::get(245).'</td></tr>';
@data = WebGUI::SQL->quickArray("select messageId,subject,username,dateOfPost,userId from discussion where messageId=$message{rid}",$session{dbh});
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).'</td><td class="tableHeader">'.WebGUI::International::get(15,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(16,$namespace).'</td></tr>';
@data = WebGUI::SQL->quickArray("select messageId,subject,username,dateOfPost,userId from discussion where messageId=$message{rid}");
$html .= '<tr';
if ($session{form}{mid} eq $message{rid}) {
$html .= ' class="highlight"';
@ -257,7 +270,7 @@ sub www_showMessage {
sub www_view {
my ($sth, @data, $html, %board, $itemsPerPage, $i, $pn, $lastId, @last, $replies);
tie %board, 'Tie::CPHash';
%board = _getBoardProperties($_[0]);
%board = getProperties($namespace,$_[0]);
$itemsPerPage = $board{messagesPerPage};
if ($session{form}{pn} < 1) {
$pn = 0;
@ -273,15 +286,15 @@ sub www_view {
if ($board{processMacros}) {
$html = WebGUI::Macro::process($html);
}
$html .= '<table width="100%" cellpadding=3 cellspacing=0 border=0><tr><td align="right" valign="bottom" class="tableMenu"><a href="'.$session{page}{url}.'?func=postNewMessage&wid='.$_[0].'">'.WebGUI::International::get(246).'</a></td></tr></table>';
$html .= '<table width="100%" cellpadding=3 cellspacing=0 border=0><tr><td align="right" valign="bottom" class="tableMenu"><a href="'.$session{page}{url}.'?func=postNewMessage&wid='.$_[0].'">'.WebGUI::International::get(17,$namespace).'</a></td></tr></table>';
$html .= '<table border=0 cellpadding=2 cellspacing=1 width="100%">';
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).'</td><td class="tableHeader">'.WebGUI::International::get(244).'</td><td class="tableHeader">'.WebGUI::International::get(247).'</td><td class="tableHeader">'.WebGUI::International::get(248).'</td><td class="tableHeader">'.WebGUI::International::get(249).'</td></tr>';
#$sth = WebGUI::SQL->read("select messageId,subject,count(*)-1,username,dateOfPost,max(dateOfPost),max(messageId) from discussion where widgetId=$_[0] group by rid order by messageId desc", $session{dbh});
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost,userId from discussion where widgetId=$_[0] and pid=0 order by messageId desc", $session{dbh});
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).'</td><td class="tableHeader">'.WebGUI::International::get(15,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(18,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(19,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(20,$namespace).'</td></tr>';
#$sth = WebGUI::SQL->read("select messageId,subject,count(*)-1,username,dateOfPost,max(dateOfPost),max(messageId) from discussion where widgetId=$_[0] group by rid order by messageId desc");
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost,userId from discussion where widgetId=$_[0] and pid=0 order by messageId desc");
while (@data = $sth->array) {
if ($i >= ($itemsPerPage*$pn) && $i < ($itemsPerPage*($pn+1))) {
@last = WebGUI::SQL->quickArray("select messageId,dateOfPost,username,subject,userId from discussion where widgetId=$_[0] and rid=$data[0] order by dateOfPost desc",$session{dbh});
($replies) = WebGUI::SQL->quickArray("select count(*)-1 from discussion where rid=$data[0]",$session{dbh});
@last = WebGUI::SQL->quickArray("select messageId,dateOfPost,username,subject,userId from discussion where widgetId=$_[0] and rid=$data[0] order by dateOfPost desc");
($replies) = WebGUI::SQL->quickArray("select count(*)-1 from discussion where rid=$data[0]");
$html .= '<tr><td class="tableData"><a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$_[0].'">'.substr($data[1],0,30).'</a></td><td class="tableData"><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$data[4].'">'.$data[2].'</a></td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").'</td><td class="tableData">'.$replies.'</td><td class="tableData"><span style="font-size: 8pt;"><a href="'.$session{page}{url}.'?func=showMessage&mid='.$last[0].'&wid='.$_[0].'">'.substr($last[3],0,30).'</a> @ '.epochToHuman($last[1],"%M/%D %H:%n%p").' by <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$last[4].'">'.$last[2].'</a></span></td></tr>';
}
$i++;

View file

@ -17,25 +17,19 @@ use Tie::CPHash;
use WebGUI::International;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
use WebGUI::Widget;
#-------------------------------------------------------------------
sub _viewPoll {
my (%poll, $i, $output, $widgetId);
my (%poll, $i, $output);
tie %poll, 'Tie::CPHash';
$widgetId = shift;
%poll = WebGUI::SQL->quickHash("select * from widget,Poll where widget.widgetId=Poll.widgetId and widget.widgetId='$widgetId'",$session{dbh});
%poll = getProperties($namespace,$_[0]);
if (defined %poll) {
if ($poll{displayTitle} == 1) {
$output = "<h1>".$poll{title}."</h1>";
}
if ($poll{description} ne "") {
$output .= $poll{description}.'<p>';
}
$output .= '<form method="post" action="'.$session{page}{url}.'">';
$output .= WebGUI::Form::hidden('wid',$widgetId);
$output = formHeader();
$output .= WebGUI::Form::hidden('wid',$_[0]);
$output .= WebGUI::Form::hidden('func','vote');
$output .= '<span class="pollQuestion">'.$poll{question}.'</span><br>';
for ($i=1; $i<=20; $i++) {
@ -43,8 +37,7 @@ sub _viewPoll {
$output .= WebGUI::Form::radio("answer",'a'.$i).' <span class="pollAnswer">'.$poll{'a'.$i}.'</span><br>';
}
}
$output .= '<br>'.WebGUI::Form::submit('Vote!');
$output .= '<br>'.WebGUI::Form::submit(WebGUI::International::get(11,$namespace));
$output .= '</form>';
}
return $output;
@ -52,26 +45,19 @@ sub _viewPoll {
#-------------------------------------------------------------------
sub _viewResults {
my (%poll, @data, $i, $output, $widgetId, $totalResponses);
my (%poll, @data, $i, $output, $totalResponses);
tie %poll, 'Tie::CPHash';
$widgetId = shift;
%poll = WebGUI::SQL->quickHash("select * from widget,Poll where widget.widgetId=Poll.widgetId and widget.widgetId='$widgetId'",$session{dbh});
%poll = getProperties($namespace,$_[0]);
if (defined %poll) {
if ($poll{displayTitle} == 1) {
$output = "<h1>".$poll{title}."</h1>";
}
if ($poll{description} ne "") {
$output .= $poll{description}.'<p>';
}
$output .= '<span class="pollQuestion">'.$poll{question}.'</span>';
($totalResponses) = WebGUI::SQL->quickArray("select count(*) from Poll_answer where widgetId=$widgetId",$session{dbh});
$output = '<span class="pollQuestion">'.$poll{question}.'</span>';
($totalResponses) = WebGUI::SQL->quickArray("select count(*) from Poll_answer where widgetId=$_[0]");
if ($totalResponses < 1) {
$totalResponses = 1;
}
for ($i=1; $i<=20; $i++) {
if ($poll{'a'.$i} =~ /\w/) {
$output .= '<span class="pollAnswer"><hr size=1>'.$poll{'a'.$i}.'<br></span>';
@data = WebGUI::SQL->quickArray("select count(*), answer from Poll_answer where answer='a$i' and widgetId=$widgetId group by answer",$session{dbh});
@data = WebGUI::SQL->quickArray("select count(*), answer from Poll_answer where answer='a$i' and widgetId=$_[0] group by answer");
$output .= '<table cellpadding=0 cellspacing=0 border=0><tr><td width="'.round($poll{graphWidth}*$data[0]/$totalResponses).'" class="pollColor"><img src="'.$session{setting}{lib}.'/spacer.gif" height="1" width="1"></td><td class="pollAnswer">&nbsp;&nbsp;'.round(100*$data[0]/$totalResponses).'%</td></tr></table>';
}
}
@ -80,16 +66,30 @@ sub _viewResults {
return $output;
}
#-------------------------------------------------------------------
sub duplicate {
my ($sth, %data, $newWidgetId, $pageId, @row);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{position});
WebGUI::SQL->write("insert into Poll values ($newWidgetId, '$data{active}', '$data{graphWidth}', '$data{voteGroup}', ".quote($data{question}).", ".quote($data{a1}).", ".quote($data{a2}).", ".quote($data{a3}).", ".quote($data{a4}).", ".quote($data{a5}).", ".quote($data{a6}).", ".quote($data{a7}).", ".quote($data{a8}).", ".quote($data{a9}).", ".quote($data{a10}).", ".quote($data{a11}).", ".quote($data{a12}).", ".quote($data{a13}).", ".quote($data{a14}).", ".quote($data{a15}).", ".quote($data{a16}).", ".quote($data{a17}).", ".quote($data{a18}).", ".quote($data{a19}).", ".quote($data{a20}).")");
$sth = WebGUI::SQL->read("select * from Poll_answer");
while (@row = $sth->array) {
WebGUI::SQL->write("insert into Poll_answer values ($newWidgetId, '$row[1]', $row[2], '$row[3]')");
}
$sth->finish;
}
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from Poll_answer where widgetId=$_[0]",$_[1]);
WebGUI::SQL->write("delete from Poll where widgetId=$_[0]",$_[1]);
purgeWidget($_[0],$_[1]);
purgeWidget($_[0],$_[1],$namespace);
}
#-------------------------------------------------------------------
sub widgetName {
return WebGUI::International::get(250);
return WebGUI::International::get(1,$namespace);
}
#-------------------------------------------------------------------
@ -97,26 +97,26 @@ sub www_add {
my ($output, %hash, @array);
tie %hash, "Tie::IxHash";
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(251).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(2,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,'Poll').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,'Poll'));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1));
%hash = WebGUI::Widget::getPositions();
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'',50,5,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(252).'</td><td>'.WebGUI::Form::checkbox("active",1,1).'</td></tr>';
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName",$session{dbh});
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'',50,5,1));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::checkbox("active",1,1));
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName");
$array[0] = 1;
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(253).'</td><td>'.WebGUI::Form::selectList("voteGroup",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(254).'</td><td>'.WebGUI::Form::text("graphWidth",20,3,150).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(255).'</td><td>'.WebGUI::Form::text("question",50,255).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(256).'<span><br>'.WebGUI::International::get(257).'</span></td><td>'.WebGUI::Form::textArea("answers",'',50,8,0,'on').'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::selectList("voteGroup",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::text("graphWidth",20,3,150));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::text("question",50,255));
$output .= tableFormRow(WebGUI::International::get(7,$namespace).'<span><br>'.WebGUI::International::get(8,$namespace).'</span>',WebGUI::Form::textArea("answers",'',50,8,0,'on'));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -129,43 +129,54 @@ sub www_add {
sub www_addSave {
my ($widgetId, @answer);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create();
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{position});
@answer = split("\n",$session{form}{answers});
WebGUI::SQL->write("insert into Poll values ($widgetId, '$session{form}{active}', '$session{form}{graphWidth}', '$session{form}{voteGroup}', ".quote($session{form}{question}).", ".quote($answer[0]).", ".quote($answer[1]).", ".quote($answer[2]).", ".quote($answer[3]).", ".quote($answer[4]).", ".quote($answer[5]).", ".quote($answer[6]).", ".quote($answer[7]).", ".quote($answer[8]).", ".quote($answer[9]).", ".quote($answer[10]).", ".quote($answer[11]).", ".quote($answer[12]).", ".quote($answer[13]).", ".quote($answer[14]).", ".quote($answer[15]).", ".quote($answer[16]).", ".quote($answer[17]).", ".quote($answer[18]).", ".quote($answer[19]).")",$session{dbh});
WebGUI::SQL->write("insert into Poll values ($widgetId, '$session{form}{active}', '$session{form}{graphWidth}', '$session{form}{voteGroup}', ".quote($session{form}{question}).", ".quote($answer[0]).", ".quote($answer[1]).", ".quote($answer[2]).", ".quote($answer[3]).", ".quote($answer[4]).", ".quote($answer[5]).", ".quote($answer[6]).", ".quote($answer[7]).", ".quote($answer[8]).", ".quote($answer[9]).", ".quote($answer[10]).", ".quote($answer[11]).", ".quote($answer[12]).", ".quote($answer[13]).", ".quote($answer[14]).", ".quote($answer[15]).", ".quote($answer[16]).", ".quote($answer[17]).", ".quote($answer[18]).", ".quote($answer[19]).")");
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
duplicate($session{form}{wid});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_edit {
my ($output, %data, %hash, @array);
tie %hash, "Tie::IxHash";
tie %data, 'Tie::CPHash';
if (WebGUI::Privilege::canEditPage()) {
%data = WebGUI::SQL->quickHash("select * from widget,Poll where widget.widgetId=Poll.widgetId and widget.widgetId=$session{form}{wid}",$session{dbh});
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(258).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%data = getProperties($namespace,$session{form}{wid});
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(9,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$data{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1,$data{processMacros}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$data{title}));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1,$data{processMacros}));
%hash = WebGUI::Widget::getPositions();
$array[0] = $data{position};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$data{description},50,5,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(252).'</td><td>'.WebGUI::Form::checkbox("active",1,$data{active}).'</td></tr>';
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName",$session{dbh});
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$data{description},50,5,1));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::checkbox("active",1,$data{active}));
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName");
$array[0] = $data{voteGroup};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(253).'</td><td>'.WebGUI::Form::selectList("voteGroup",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(254).'</td><td>'.WebGUI::Form::text("graphWidth",20,3,$data{graphWidth}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(255).'</td><td>'.WebGUI::Form::text("question",50,255,$data{question}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(256).'<span><br>'.WebGUI::International::get(257).'</span></td><td>'.WebGUI::Form::textArea("answers",$data{a1}."\n".$data{a2}."\n".$data{a3}."\n".$data{a4}."\n".$data{a5}."\n".$data{a6}."\n".$data{a7}."\n".$data{a8}."\n".$data{a9}."\n".$data{a10}."\n".$data{a11}."\n".$data{a12}."\n".$data{a13}."\n".$data{a14}."\n".$data{a15}."\n".$data{a16}."\n".$data{a17}."\n".$data{a18}."\n".$data{a19}."\n".$data{a20}."\n",50,8,0,'on').'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).' &nbsp;&nbsp;&nbsp; <a href="'.$session{page}{url}.'?func=resetVotes&wid='.$session{form}{wid}.'">'.WebGUI::International::get(305).'</a></td></tr>';
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::selectList("voteGroup",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::text("graphWidth",20,3,$data{graphWidth}));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::text("question",50,255,$data{question}));
$output .= tableFormRow(WebGUI::International::get(7,$namespace).'<span><br>'.WebGUI::International::get(8,$namespace).'</span>',WebGUI::Form::textArea("answers",$data{a1}."\n".$data{a2}."\n".$data{a3}."\n".$data{a4}."\n".$data{a5}."\n".$data{a6}."\n".$data{a7}."\n".$data{a8}."\n".$data{a9}."\n".$data{a10}."\n".$data{a11}."\n".$data{a12}."\n".$data{a13}."\n".$data{a14}."\n".$data{a15}."\n".$data{a16}."\n".$data{a17}."\n".$data{a18}."\n".$data{a19}."\n".$data{a20}."\n",50,8,0,'on'));
$output .= formSave();
$output .= tableFormRow("",'<a href="'.$session{page}{url}.'?func=resetVotes&wid='.$session{form}{wid}.'">'.WebGUI::International::get(10,$namespace).'</a>');
$output .= '</table></form>';
return $output;
} else {
@ -179,7 +190,7 @@ sub www_editSave {
if (WebGUI::Privilege::canEditPage()) {
update();
@answer = split("\n",$session{form}{answers});
WebGUI::SQL->write("update Poll set active='$session{form}{active}', voteGroup='$session{form}{voteGroup}', graphWidth=$session{form}{graphWidth}, question=".quote($session{form}{question}).", a1=".quote($answer[0]).", a2=".quote($answer[1]).", a3=".quote($answer[2]).", a4=".quote($answer[3]).", a5=".quote($answer[4]).", a6=".quote($answer[5]).", a7=".quote($answer[6]).", a8=".quote($answer[7]).", a9=".quote($answer[8]).", a10=".quote($answer[9]).", a11=".quote($answer[10]).", a12=".quote($answer[11]).", a13=".quote($answer[12]).", a14=".quote($answer[13]).", a15=".quote($answer[14]).", a16=".quote($answer[15]).", a17=".quote($answer[16]).", a18=".quote($answer[17]).", a19=".quote($answer[18]).", a20=".quote($answer[19])." where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update Poll set active='$session{form}{active}', voteGroup='$session{form}{voteGroup}', graphWidth=$session{form}{graphWidth}, question=".quote($session{form}{question}).", a1=".quote($answer[0]).", a2=".quote($answer[1]).", a3=".quote($answer[2]).", a4=".quote($answer[3]).", a5=".quote($answer[4]).", a6=".quote($answer[5]).", a7=".quote($answer[6]).", a8=".quote($answer[7]).", a9=".quote($answer[8]).", a10=".quote($answer[9]).", a11=".quote($answer[10]).", a12=".quote($answer[11]).", a13=".quote($answer[12]).", a14=".quote($answer[13]).", a15=".quote($answer[14]).", a16=".quote($answer[15]).", a17=".quote($answer[16]).", a18=".quote($answer[17]).", a19=".quote($answer[18]).", a20=".quote($answer[19])." where widgetId=$session{form}{wid}");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -189,7 +200,7 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_resetVotes {
if (WebGUI::Privilege::canEditPage()) {
WebGUI::SQL->write("delete from Poll_answer where widgetId='$session{form}{wid}'",$session{dbh});
WebGUI::SQL->write("delete from Poll_answer where widgetId='$session{form}{wid}'");
}
return "";
}
@ -198,18 +209,24 @@ sub www_resetVotes {
sub www_view {
my ($hasVoted, %data, $output);
tie %data, 'Tie::CPHash';
%data = WebGUI::SQL->quickHash("select * from widget,Poll where widget.widgetId=Poll.widgetId and widget.widgetId='$_[0]'",$session{dbh});
%data = getProperties($namespace,$_[0]);
if ($data{displayTitle} == 1) {
$output = "<h1>".$data{title}."</h1>";
}
if ($data{description} ne "") {
$output .= $data{description}.'<p>';
}
if ($data{active} eq "0") {
$output = _viewResults($_[0]);
$output .= _viewResults($_[0]);
} elsif (WebGUI::Privilege::isInGroup($data{voteGroup},$session{user}{userId})) {
($hasVoted) = WebGUI::SQL->quickArray("select count(*) from Poll_answer where widgetId=$_[0] and ((userId=$session{user}{userId} and userId<>1) or (userId=1 and ipAddress='$session{env}{REMOTE_ADDR}'))",$session{dbh});
($hasVoted) = WebGUI::SQL->quickArray("select count(*) from Poll_answer where widgetId=$_[0] and ((userId=$session{user}{userId} and userId<>1) or (userId=1 and ipAddress='$session{env}{REMOTE_ADDR}'))");
if ($hasVoted) {
$output = _viewResults($_[0]);
$output .= _viewResults($_[0]);
} else {
$output = _viewPoll($_[0]);
$output .= _viewPoll($_[0]);
}
} else {
$output = _viewResults($_[0]);
$output .= _viewResults($_[0]);
}
return $output;
}
@ -217,16 +234,14 @@ sub www_view {
#-------------------------------------------------------------------
sub www_vote {
my ($voteGroup);
($voteGroup) = WebGUI::SQL->quickArray("select voteGroup from Poll where widgetId='$session{form}{wid}'",$session{dbh});
($voteGroup) = WebGUI::SQL->quickArray("select voteGroup from Poll where widgetId='$session{form}{wid}'");
if (WebGUI::Privilege::isInGroup($voteGroup,$session{user}{userId})) {
WebGUI::SQL->write("insert into Poll_answer values ($session{form}{wid}, '$session{form}{answer}', $session{user}{userId}, '$session{env}{REMOTE_ADDR}')",$session{dbh});
WebGUI::SQL->write("insert into Poll_answer values ($session{form}{wid}, '$session{form}{answer}', $session{user}{userId}, '$session{env}{REMOTE_ADDR}')");
}
return "";
}
1;

View file

@ -18,19 +18,29 @@ use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
use WebGUI::Widget;
#-------------------------------------------------------------------
sub duplicate {
my (%data, $newWidgetId, $pageId);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{position});
WebGUI::SQL->write("insert into SQLReport values($newWidgetId, ".quote($data{template}).", ".quote($data{dbQuery}).", ".quote($data{DSN}).", ".quote($data{username}).", ".quote($data{identifier}).", '$data{convertCarriageReturns}')");
}
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from SQLReport where widgetId=$_[0]",$_[1]);
purgeWidget($_[0],$_[1]);
purgeWidget($_[0],$_[1],$namespace);
}
#-------------------------------------------------------------------
sub widgetName {
return WebGUI::International::get(259);
return WebGUI::International::get(1,$namespace);
}
#-------------------------------------------------------------------
@ -38,25 +48,25 @@ sub www_add {
my ($output, %hash);
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(260).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(2,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,'SQL Report').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1,1).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,'SQL Report'));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,1));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1,1));
%hash = WebGUI::Widget::getPositions();
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'','','',1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(261).'</td><td>'.WebGUI::Form::textArea("template",'','','',1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(262).'</td><td>'.WebGUI::Form::textArea("dbQuery",'').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(263).'</td><td>'.WebGUI::Form::text("DSN",20,255,$session{config}{dsn}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(264).'</td><td>'.WebGUI::Form::text("username",20,255,$session{config}{dbuser}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(265).'</td><td>'.WebGUI::Form::password("identifier",20,255).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(183).'</td><td>'.WebGUI::Form::checkbox("convertCarriageReturns",1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'','','',1));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::textArea("template",'','','',1));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::textArea("dbQuery",''));
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::text("DSN",20,255,$session{config}{dsn}));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::text("username",20,255,$session{config}{dbuser}));
$output .= tableFormRow(WebGUI::International::get(7,$namespace),WebGUI::Form::password("identifier",20,255));
$output .= tableFormRow(WebGUI::International::get(183),WebGUI::Form::checkbox("convertCarriageReturns",1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -69,41 +79,51 @@ sub www_add {
sub www_addSave {
my ($widgetId);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create();
WebGUI::SQL->write("insert into SQLReport values($widgetId, ".quote($session{form}{template}).", ".quote($session{form}{dbQuery}).", ".quote($session{form}{DSN}).", ".quote($session{form}{username}).", ".quote($session{form}{identifier}).", '$session{form}{convertCarriageReturns}')",$session{dbh});
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{position});
WebGUI::SQL->write("insert into SQLReport values($widgetId, ".quote($session{form}{template}).", ".quote($session{form}{dbQuery}).", ".quote($session{form}{DSN}).", ".quote($session{form}{username}).", ".quote($session{form}{identifier}).", '$session{form}{convertCarriageReturns}')");
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
duplicate($session{form}{wid});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_edit {
my ($output, %data, %hash, @array);
tie %data, 'Tie::CPHash';
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
%data = WebGUI::SQL->quickHash("select * from widget,SQLReport where widget.widgetId=$session{form}{wid} and widget.widgetId=SQLReport.widgetId",$session{dbh});
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(266).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%data = getProperties($namespace,$session{form}{wid});
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(8,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$data{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros","1",$data{processMacros}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$data{title}));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros","1",$data{processMacros}));
%hash = WebGUI::Widget::getPositions();
$array[0] = $data{position};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$data{description},50,10,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(261).'</td><td>'.WebGUI::Form::textArea("template",$data{template},50,10,1).'</td></tr>';
$output .= '<tr><td class="formDescription">Query</td><td>'.WebGUI::Form::textArea("dbQuery",$data{dbQuery},50,10,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(262).'</td><td>'.WebGUI::Form::text("DSN",20,255,$data{DSN}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(263).'</td><td>'.WebGUI::Form::text("username",20,255,$data{username}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(264).'</td><td>'.WebGUI::Form::password("identifier",20,255,$data{identifier}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(183).'</td><td>'.WebGUI::Form::checkbox("convertCarriageReturns",1,$data{convertCarriageReturns}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$data{description},50,10,1));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::textArea("template",$data{template},50,10,1));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::textArea("dbQuery",$data{dbQuery},50,10,1));
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::text("DSN",20,255,$data{DSN}));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::text("username",20,255,$data{username}));
$output .= tableFormRow(WebGUI::International::get(7,$namespace),WebGUI::Form::password("identifier",20,255,$data{identifier}));
$output .= tableFormRow(WebGUI::International::get(183),WebGUI::Form::checkbox("convertCarriageReturns",1,$data{convertCarriageReturns}));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -116,7 +136,7 @@ sub www_editSave {
my ($widgetId, $displayTitle, $image, $attachment);
if (WebGUI::Privilege::canEditPage()) {
update();
WebGUI::SQL->write("update SQLReport set template=".quote($session{form}{template}).", dbQuery=".quote($session{form}{dbQuery}).", convertCarriageReturns='$session{form}{convertCarriageReturns}', DSN=".quote($session{form}{DSN}).", username=".quote($session{form}{username}).", identifier=".quote($session{form}{identifier})." where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update SQLReport set template=".quote($session{form}{template}).", dbQuery=".quote($session{form}{dbQuery}).", convertCarriageReturns='$session{form}{convertCarriageReturns}', DSN=".quote($session{form}{DSN}).", username=".quote($session{form}{username}).", identifier=".quote($session{form}{identifier})." where widgetId=$session{form}{wid}");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -125,10 +145,9 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_view {
my ($ouch, %data, $output, $widgetId, $sth, $dbh, @result, @template, $temp);
my ($ouch, %data, $output, $sth, $dbh, @result, @template, $temp);
tie %data, 'Tie::CPHash';
$widgetId = shift;
%data = WebGUI::SQL->quickHash("select * from widget,SQLReport where widget.widgetId=$widgetId and widget.widgetId=SQLReport.widgetId",$session{dbh});
%data = getProperties($namespace,$_[0]);
if (defined %data) {
if ($data{displayTitle} == 1) {
$output = "<h1>".$data{title}."</h1>";
@ -141,15 +160,15 @@ sub www_view {
if ($data{DSN} =~ /\DBI\:\w+\:\w+/) {
$dbh = DBI->connect($data{DSN},$data{username},$data{identifier});
} else {
$output .= WebGUI::International::get(267).'<p>';
WebGUI::ErrorHandler::warn("SQLReport [$widgetId] The DSN specified is of an improper format.");
$output .= WebGUI::International::get(9,$namespace).'<p>';
WebGUI::ErrorHandler::warn("SQLReport [$_[0]] The DSN specified is of an improper format.");
}
if (defined $dbh) {
if ($data{dbQuery} =~ /select/i) {
$sth = WebGUI::SQL->unconditionalRead($data{dbQuery},$dbh);
} else {
$output .= WebGUI::International::get(268).'<p>';
WebGUI::ErrorHandler::warn("SQLReport [$widgetId] The SQL query is improperly formatted.");
$output .= WebGUI::International::get(10,$namespace).'<p>';
WebGUI::ErrorHandler::warn("SQLReport [$_[0]] The SQL query is improperly formatted.");
}
if ($sth->rows > 0) {
while (@result = $sth->array) {
@ -162,13 +181,13 @@ sub www_view {
}
$sth->finish;
} else {
$output .= WebGUI::International::get(269).'<p>';
WebGUI::ErrorHandler::warn("SQLReport [$widgetId] There was a problem with the query.");
$output .= WebGUI::International::get(11,$namespace).'<p>';
WebGUI::ErrorHandler::warn("SQLReport [$_[0]] There was a problem with the query.");
}
$dbh->disconnect();
} else {
$output .= WebGUI::International::get(270).'<p>';
WebGUI::ErrorHandler::warn("SQLReport [$widgetId] Could not connect to remote database.");
$output .= WebGUI::International::get(12,$namespace).'<p>';
WebGUI::ErrorHandler::warn("SQLReport [$_[0]] Could not connect to remote database.");
}
$output .= $template[2];
}

View file

@ -18,8 +18,8 @@ use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
use WebGUI::Widget;
#-------------------------------------------------------------------
@ -37,7 +37,7 @@ sub _traversePageTree {
$lineSpacing .= "<br>";
}
if ($_[1] < $toLevel) {
$sth = WebGUI::SQL->read("select urlizedTitle, title, pageId from page where parentId='$_[0]' order by sequenceNumber",$session{dbh});
$sth = WebGUI::SQL->read("select urlizedTitle, title, pageId from page where parentId='$_[0]' order by sequenceNumber");
while (@data = $sth->array) {
if (WebGUI::Privilege::canViewPage($data[2])) {
$output .= $depth.$_[4].' <a href="'.$session{env}{SCRIPT_NAME}.'/'.$data[0].'">'.$data[1].'</a>';
@ -50,10 +50,19 @@ sub _traversePageTree {
return $output;
}
#-------------------------------------------------------------------
sub duplicate {
my (%data, $newWidgetId, $pageId);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{position});
WebGUI::SQL->write("insert into SiteMap values ($newWidgetId, '$data{startAtThisLevel}', '$data{depth}', '$data{indent}', ".quote($data{bullet}).", '$data{lineSpacing}')");
}
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from SiteMap where widgetId=$_[0]",$_[1]);
purgeWidget($_[0],$_[1]);
purgeWidget($_[0],$_[1],$namespace);
}
#-------------------------------------------------------------------
@ -66,24 +75,24 @@ sub www_add {
my ($output, %hash);
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(1,$namespace).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,'Site Map').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,'Site Map'));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,1));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1));
%hash = WebGUI::Widget::getPositions();
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'',50,5,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(3,$namespace).'</td><td>'.WebGUI::Form::checkbox("startAtThisLevel",1,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(4,$namespace).'</td><td>'.WebGUI::Form::text("depth",20,2,0).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(6,$namespace).'</td><td>'.WebGUI::Form::text("indent",20,2,5).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(7,$namespace).'</td><td>'.WebGUI::Form::text("bullet",20,30,'&middot;').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(8,$namespace).'</td><td>'.WebGUI::Form::text("bullet",20,1,1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'',50,5,1));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::checkbox("startAtThisLevel",1,1));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("depth",20,2,0));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::text("indent",20,2,5));
$output .= tableFormRow(WebGUI::International::get(7,$namespace),WebGUI::Form::text("bullet",20,30,'&middot;'));
$output .= tableFormRow(WebGUI::International::get(8,$namespace),WebGUI::Form::text("bullet",20,1,1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -96,40 +105,50 @@ sub www_add {
sub www_addSave {
my ($widgetId, $displayTitle, $image, $attachment);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create();
WebGUI::SQL->write("insert into SiteMap values ($widgetId, '$session{form}{startAtThisLevel}', '$session{form}{depth}', '$session{form}{indent}', ".quote($session{form}{bullet}).", '$session{form}{lineSpacing}')",$session{dbh});
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{position});
WebGUI::SQL->write("insert into SiteMap values ($widgetId, '$session{form}{startAtThisLevel}', '$session{form}{depth}', '$session{form}{indent}', ".quote($session{form}{bullet}).", '$session{form}{lineSpacing}')");
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
duplicate($session{form}{wid});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_edit {
my ($output, %data, %hash, @array);
tie %data, 'Tie::CPHash';
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
%data = WebGUI::SQL->quickHash("select * from widget,SiteMap where widget.widgetId=SiteMap.widgetId and widget.widgetId=$session{form}{wid}",$session{dbh});
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
%data = getProperties($namespace,$session{form}{wid});
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(5,$namespace).'</h1>';
$output .= '<form method="post" action="'.$session{page}{url}.'">';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$data{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1,$data{processMacros}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$data{title}));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1,$data{processMacros}));
%hash = WebGUI::Widget::getPositions();
$array[0] = $data{position};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$data{description},50,5,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(3,$namespace).'</td><td>'.WebGUI::Form::checkbox("startAtThisLevel",1,$data{startAtThisLevel}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(4,$namespace).'</td><td>'.WebGUI::Form::text("depth",20,2,$data{depth}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(6,$namespace).'</td><td>'.WebGUI::Form::text("indent",20,2,$data{indent}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(7,$namespace).'</td><td>'.WebGUI::Form::text("bullet",20,30,$data{bullet}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(8,$namespace).'</td><td>'.WebGUI::Form::text("lineSpacing",20,1,$data{lineSpacing}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$data{description},50,5,1));
$output .= tableFormRow(WebGUI::International::get(3,$namespace),WebGUI::Form::checkbox("startAtThisLevel",1,$data{startAtThisLevel}));
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("depth",20,2,$data{depth}));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::text("indent",20,2,$data{indent}));
$output .= tableFormRow(WebGUI::International::get(7,$namespace),WebGUI::Form::text("bullet",20,30,$data{bullet}));
$output .= tableFormRow(WebGUI::International::get(8,$namespace),WebGUI::Form::text("lineSpacing",20,1,$data{lineSpacing}));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -141,7 +160,7 @@ sub www_edit {
sub www_editSave {
if (WebGUI::Privilege::canEditPage()) {
update();
WebGUI::SQL->write("update SiteMap set startAtThisLevel='$session{form}{startAtThisLevel}', depth='$session{form}{depth}', indent='$session{form}{indent}', bullet=".quote($session{form}{bullet}).", lineSpacing='$session{form}{lineSpacing}' where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update SiteMap set startAtThisLevel='$session{form}{startAtThisLevel}', depth='$session{form}{depth}', indent='$session{form}{indent}', bullet=".quote($session{form}{bullet}).", lineSpacing='$session{form}{lineSpacing}' where widgetId=$session{form}{wid}");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -152,7 +171,7 @@ sub www_editSave {
sub www_view {
my (%data, $output, $parent);
tie %data, 'Tie::CPHash';
%data = WebGUI::SQL->quickHash("select * from widget,SiteMap where widget.widgetId=SiteMap.widgetId and widget.widgetId='$_[0]'",$session{dbh});
%data = getProperties($namespace,$_[0]);
if (defined %data) {
if ($data{displayTitle} eq 1) {
$output = '<h1>'.$data{title}.'</h1>';

View file

@ -19,19 +19,28 @@ use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
use WebGUI::Widget;
#-------------------------------------------------------------------
sub duplicate {
my (%data, $newWidgetId, $pageId);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{position});
WebGUI::SQL->write("insert into SyndicatedContent values ($newWidgetId, ".quote($data{rssUrl}).", ".quote($data{content}).", ".quote($data{lastFetched}).")");
}
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from SyndicatedContent where widgetId=$_[0]",$_[1]);
purgeWidget($_[0],$_[1]);
purgeWidget($_[0],$_[1],$namespace);
}
#-------------------------------------------------------------------
sub widgetName {
return WebGUI::International::get(271);
return WebGUI::International::get(2,$namespace);
}
#-------------------------------------------------------------------
@ -39,20 +48,20 @@ sub www_add {
my ($output, %hash);
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(272).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(3,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,'Syndicated Content').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,'Syndicated Content'));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1));
%hash = WebGUI::Widget::getPositions();
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'','','',1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(273).'</td><td>'.WebGUI::Form::text("rssUrl",20,2048).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'','','',1));
$output .= tableFormRow(WebGUI::International::get(1,$namespace),WebGUI::Form::text("rssUrl",20,2048));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -65,39 +74,49 @@ sub www_add {
sub www_addSave {
my ($widgetId);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create();
WebGUI::SQL->write("insert into SyndicatedContent values ($widgetId, ".quote($session{form}{rssUrl}).", 'Not yet fetched.', '".time()."')",$session{dbh});
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{position});
WebGUI::SQL->write("insert into SyndicatedContent values ($widgetId, ".quote($session{form}{rssUrl}).", 'Not yet fetched.', '".time()."')");
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
duplicate($session{form}{wid});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_edit {
my ($output, %data, %hash, @array);
tie %data, 'Tie::CPHash';
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
%data = WebGUI::SQL->quickHash("select * from widget,SyndicatedContent where widget.widgetId=$session{form}{wid}",$session{dbh});
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(274).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%data = getProperties($namespace,$session{form}{wid});
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(4,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$data{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros","1",$data{processMacros}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$data{title}));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros","1",$data{processMacros}));
%hash = WebGUI::Widget::getPositions();
$array[0] = $data{position};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$data{description},50,10,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(273).'</td><td>'.WebGUI::Form::text("rssUrl",20,2048,$data{rssUrl}).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$data{description},50,10,1));
$output .= tableFormRow(WebGUI::International::get(1,$namespace),WebGUI::Form::text("rssUrl",20,2048,$data{rssUrl}));
$output .= formSave();
$output .= '<tr><td><br></td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(275).'</td><td>'.WebGUI::DateTime::epochToHuman($data{lastFetched},"%m/%d/%y %h:%n%p").'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(276).'</td><td>'.$data{content}.'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::DateTime::epochToHuman($data{lastFetched},"%m/%d/%y %h:%n%p"));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),$data{content});
$output .= '</table></form>';
return $output;
} else {
@ -109,7 +128,7 @@ sub www_edit {
sub www_editSave {
if (WebGUI::Privilege::canEditPage()) {
update();
WebGUI::SQL->write("update SyndicatedContent set rssUrl=".quote($session{form}{rssUrl})." where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update SyndicatedContent set rssUrl=".quote($session{form}{rssUrl})." where widgetId=$session{form}{wid}");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -118,10 +137,9 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_view {
my (%data, $output, $widgetId);
my (%data, $output);
tie %data, 'Tie::CPHash';
$widgetId = shift;
%data = WebGUI::SQL->quickHash("select * from widget,SyndicatedContent where widget.widgetId=SyndicatedContent.widgetId and widget.widgetId=$widgetId",$session{dbh});
%data = getProperties($namespace,$_[0]);
if (defined %data) {
if ($data{displayTitle} == 1) {
$output = "<h1>".$data{title}."</h1>";

View file

@ -14,6 +14,7 @@ our $namespace = "UserSubmission";
use strict;
use Tie::CPHash;
use WebGUI::Attachment;
use WebGUI::DateTime;
use WebGUI::International;
use WebGUI::Macro;
@ -21,20 +22,36 @@ use WebGUI::MessageLog;
use WebGUI::Operation;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::Shortcut;
use WebGUI::SQL;
use WebGUI::Utility;
use WebGUI::Widget;
#-------------------------------------------------------------------
sub duplicate {
my ($sth, %data, $newWidgetId, @row, $newSubmissionId, $pageId);
tie %data, 'Tie::CPHash';
%data = getProperties($namespace,$_[0]);
$pageId = $_[1] || $data{pageId};
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{position});
WebGUI::SQL->write("insert into UserSubmission values ($newWidgetId, $data{groupToContribute}, '$data{submissionsPerPage}', '$data{defaultStatus}', $data{groupToApprove})");
$sth = WebGUI::SQL->read("select * from UserSubmission_submission");
while (@row = $sth->array) {
$newSubmissionId = getNextId("submissionId");
WebGUI::SQL->write("insert into UserSubmission_submission values ($newWidgetId, $newSubmissionId, ".quote($row[2]).", $row[3], ".quote($row[4]).", '$row[5]', ".quote($row[6]).", ".quote($row[7]).", ".quote($row[8]).", '$row[9]', '$row[10]')");
}
$sth->finish;
}
#-------------------------------------------------------------------
sub purge {
WebGUI::SQL->write("delete from UserSubmission_submission where widgetId=$_[0]",$_[1]);
WebGUI::SQL->write("delete from UserSubmission where widgetId=$_[0]",$_[1]);
purgeWidget($_[0],$_[1]);
purgeWidget($_[0],$_[1],$namespace);
}
#-------------------------------------------------------------------
sub widgetName {
return WebGUI::International::get(277);
return WebGUI::International::get(29,$namespace);
}
#-------------------------------------------------------------------
@ -42,27 +59,27 @@ sub www_add {
my ($output, %hash, @array);
tie %hash, "Tie::IxHash";
if (WebGUI::Privilege::canEditPage()) {
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(278).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(30,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("widget",$namespace);
$output .= WebGUI::Form::hidden("func","addSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,'User Submission System').'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,'User Submission System'));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle",1,1));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros",1));
%hash = WebGUI::Widget::getPositions();
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'',50,5,1).'</td></tr>';
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName",$session{dbh});
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'',50,5,1));
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName");
$array[0] = 4;
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::selectList("groupToApprove",\%hash,\@array).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(1,$namespace),WebGUI::Form::selectList("groupToApprove",\%hash,\@array));
$array[0] = 2;
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(2,$namespace).'</td><td>'.WebGUI::Form::selectList("groupToContribute",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(280).'</td><td>'.WebGUI::Form::text("submissionsPerPage",20,2,50).'</td></tr>';
%hash = ("Approved"=>WebGUI::International::get(281),"Denied"=>WebGUI::International::get(282),"Pending"=>WebGUI::International::get(283));
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(284).'</td><td>'.WebGUI::Form::selectList("defaultStatus",\%hash,'',1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(2,$namespace),WebGUI::Form::selectList("groupToContribute",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::text("submissionsPerPage",20,2,50));
%hash = ("Approved"=>WebGUI::International::get(7,$namespace),"Denied"=>WebGUI::International::get(8,$namespace),"Pending"=>WebGUI::International::get(9,$namespace));
$output .= tableFormRow(WebGUI::International::get(10,$namespace),WebGUI::Form::selectList("defaultStatus",\%hash,'',1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -75,8 +92,8 @@ sub www_add {
sub www_addSave {
my ($widgetId);
if (WebGUI::Privilege::canEditPage()) {
$widgetId = create();
WebGUI::SQL->write("insert into UserSubmission values ($widgetId, $session{form}{groupToContribute}, '$session{form}{submissionsPerPage}', '$session{form}{defaultStatus}', $session{form}{groupToApprove})",$session{dbh});
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{position});
WebGUI::SQL->write("insert into UserSubmission values ($widgetId, $session{form}{groupToContribute}, '$session{form}{submissionsPerPage}', '$session{form}{defaultStatus}', $session{form}{groupToApprove})");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -86,23 +103,23 @@ sub www_addSave {
#-------------------------------------------------------------------
sub www_addSubmission {
my ($output, $groupToContribute, @submission, $sth);
($groupToContribute) = WebGUI::SQL->quickArray("select groupToContribute from UserSubmission where widgetId=$session{form}{wid}",$session{dbh});
($groupToContribute) = WebGUI::SQL->quickArray("select groupToContribute from UserSubmission where widgetId=$session{form}{wid}");
if (WebGUI::Privilege::isInGroup($groupToContribute,$session{user}{userId})) {
$output = '<h1>'.WebGUI::International::get(285).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
$output = '<h1>'.WebGUI::International::get(11,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","addSubmissionSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(178).'</td><td>'.WebGUI::Form::textArea("content",'',50,10,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(179).'</td><td>'.WebGUI::Form::file("image").'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(182).'</td><td>'.WebGUI::Form::file("attachment").'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(183).'</td><td>'.WebGUI::Form::checkbox("convertCarriageReturns",1,1).' <span style="font-size: 8pt;">'.WebGUI::International::get(286).'</span></td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128));
$output .= tableFormRow(WebGUI::International::get(178),WebGUI::Form::textArea("content",'',50,10,1));
$output .= tableFormRow(WebGUI::International::get(179),WebGUI::Form::file("image"));
$output .= tableFormRow(WebGUI::International::get(182),WebGUI::Form::file("attachment"));
$output .= tableFormRow(WebGUI::International::get(183),WebGUI::Form::checkbox("convertCarriageReturns",1,1).' <span style="font-size: 8pt;">'.WebGUI::International::get(12,$namespace).'</span>');
$output .= formSave();
$output .= '</table></form>';
$output .= '<table width="100%" cellspacing=1 cellpadding=2 border=0>';
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(289).'</td><td class="tableHeader">'.WebGUI::International::get(99).'</td><td class="tableHeader">'.WebGUI::International::get(287).'</td><td class="tableHeader">'.WebGUI::International::get(288).'</td></tr>';
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,status from UserSubmission_submission where widgetId='$session{form}{wid}' and userId=$session{user}{userId} order by dateSubmitted desc",$session{dbh});
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(15,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(99).'</td><td class="tableHeader">'.WebGUI::International::get(13,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(14,$namespace).'</td></tr>';
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,status from UserSubmission_submission where widgetId='$session{form}{wid}' and userId=$session{user}{userId} order by dateSubmitted desc");
while (@submission = $sth->array) {
$output .= '<tr><td class="tableData"><a href="'.$session{page}{url}.'?func=editSubmission&wid='.$session{form}{wid}.'&sid='.$submission[1].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?wid='.$session{form}{wid}.'&sid='.$submission[1].'&func=deleteSubmission"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a></td><td class="tableData"><a href="'.$session{page}{url}.'?wid='.$session{form}{wid}.'&func=viewSubmission&sid='.$submission[1].'">'.$submission[0].'</a></td><td class="tableData">'.epochToHuman($submission[2],"%M/%D/%y").'</td><td class="tableData">'.$submission[3].'</td></tr>';
}
@ -117,17 +134,17 @@ sub www_addSubmission {
#-------------------------------------------------------------------
sub www_addSubmissionSave {
my ($title, $submissionId, $image, $attachment, %userSubmission);
%userSubmission = WebGUI::SQL->quickHash("select * from UserSubmission where widgetId=$session{form}{wid}",$session{dbh});
%userSubmission = getProperties($namespace,$session{form}{wid});
if (WebGUI::Privilege::isInGroup($userSubmission{groupToContribute},$session{user}{userId})) {
$submissionId = getNextId("submissionId");
$image = saveAttachment("image",$session{form}{wid},$submissionId);
$attachment = saveAttachment("attachment",$session{form}{wid},$submissionId);
$image = WebGUI::Attachment::save("image",$session{form}{wid},$submissionId);
$attachment = WebGUI::Attachment::save("attachment",$session{form}{wid},$submissionId);
if ($session{form}{title} ne "") {
$title = $session{form}{title};
} else {
$title = WebGUI::International::get(290);
$title = WebGUI::International::get(16,$namespace);
}
WebGUI::SQL->write("insert into UserSubmission_submission values ($session{form}{wid}, $submissionId, ".quote($title).", ".time().", ".quote($session{user}{username}).", '$session{user}{userId}', ".quote($session{form}{content}).", ".quote($image).", ".quote($attachment).", '$userSubmission{defaultStatus}', '$session{form}{convertCarriageReturns}')",$session{dbh});
WebGUI::SQL->write("insert into UserSubmission_submission values ($session{form}{wid}, $submissionId, ".quote($title).", ".time().", ".quote($session{user}{username}).", '$session{user}{userId}', ".quote($session{form}{content}).", ".quote($image).", ".quote($attachment).", '$userSubmission{defaultStatus}', '$session{form}{convertCarriageReturns}')");
if ($userSubmission{defaultStatus} ne "Approved") {
WebGUI::MessageLog::addEntry('',$userSubmission{groupToApprove},$session{page}{url}.'?func=viewSubmission&wid='.$session{form}{wid}.'&sid='.$submissionId,3,$namespace);
}
@ -141,9 +158,9 @@ sub www_addSubmissionSave {
sub www_approveSubmission {
my (%userSubmission, %submission);
if (WebGUI::Privilege::isInGroup(4,$session{user}{userId}) || WebGUI::Privilege::isInGroup(3,$session{user}{userId})) {
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
%userSubmission = WebGUI::SQL->quickHash("select * from UserSubmission where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update UserSubmission_submission set status='Approved' where submissionId=$session{form}{sid}",$session{dbh});
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId=$session{form}{sid}");
%userSubmission = getProperties($namespace,$session{form}{wid});;
WebGUI::SQL->write("update UserSubmission_submission set status='Approved' where submissionId=$session{form}{sid}");
WebGUI::MessageLog::addEntry($submission{userId},'',$session{page}{url}.'?func=viewSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid},4,$namespace);
WebGUI::MessageLog::completeEntry($session{form}{mlog});
return WebGUI::Operation::www_viewMessageLog();
@ -152,12 +169,22 @@ sub www_approveSubmission {
}
}
#-------------------------------------------------------------------
sub www_copy {
if (WebGUI::Privilege::canEditPage()) {
duplicate($session{form}{wid});
return "";
} else {
return WebGUI::Privilege::insufficient();
}
}
#-------------------------------------------------------------------
sub www_deleteAttachment {
my ($owner);
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}");
if ($owner == $session{user}{userId}) {
WebGUI::SQL->write("update UserSubmission_submission set attachment='' where submissionId=$session{form}{sid}",$session{dbh});
WebGUI::SQL->write("update UserSubmission_submission set attachment='' where submissionId=$session{form}{sid}");
return www_editSubmission();
} else {
return WebGUI::Privilege::insufficient();
@ -167,9 +194,9 @@ sub www_deleteAttachment {
#-------------------------------------------------------------------
sub www_deleteImage {
my ($owner);
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}");
if ($owner == $session{user}{userId}) {
WebGUI::SQL->write("update UserSubmission_submission set image='' where submissionId=$session{form}{sid}",$session{dbh});
WebGUI::SQL->write("update UserSubmission_submission set image='' where submissionId=$session{form}{sid}");
return www_editSubmission();
} else {
return WebGUI::Privilege::insufficient();
@ -179,10 +206,10 @@ sub www_deleteImage {
#-------------------------------------------------------------------
sub www_deleteSubmission {
my ($output, $owner);
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}");
if ($owner == $session{user}{userId}) {
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
$output .= WebGUI::International::get(291).'<p>';
$output .= WebGUI::International::get(17,$namespace).'<p>';
$output .= '<div align="center"><a href="'.$session{page}{url}.'?func=deleteSubmissionConfirm&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(44).'</a>';
$output .= ' &nbsp; <a href="'.$session{page}{url}.'">'.WebGUI::International::get(45).'</a></div>';
return $output;
@ -194,9 +221,9 @@ sub www_deleteSubmission {
#-------------------------------------------------------------------
sub www_deleteSubmissionConfirm {
my ($output, $owner);
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}");
if ($owner == $session{user}{userId}) {
WebGUI::SQL->write("delete from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
WebGUI::SQL->write("delete from UserSubmission_submission where submissionId=$session{form}{sid}");
return www_addSubmission();
} else {
return WebGUI::Privilege::insufficient();
@ -207,10 +234,9 @@ sub www_deleteSubmissionConfirm {
sub www_denySubmission {
my (%submission, %userSubmission);
if (WebGUI::Privilege::isInGroup(4,$session{user}{userId}) || WebGUI::Privilege::isInGroup(3,$session{user}{userId})) {
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
%userSubmission = WebGUI::SQL->quickHash("select * from UserSubmission where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update UserSubmission_submission set status='Denied' where submissionId=$session{form}{sid}",$session{dbh}
);
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId=$session{form}{sid}");
%userSubmission = getProperties($namespace,$session{form}{wid});
WebGUI::SQL->write("update UserSubmission_submission set status='Denied' where submissionId=$session{form}{sid}");
WebGUI::MessageLog::addEntry($submission{userId},'',$session{page}{url}.'?func=viewSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid},5,$namespace);
WebGUI::MessageLog::completeEntry($session{form}{mlog});
return WebGUI::Operation::www_viewMessageLog();
@ -225,30 +251,30 @@ sub www_edit {
tie %data, 'Tie::CPHash';
tie %hash, 'Tie::IxHash';
if (WebGUI::Privilege::canEditPage()) {
%data = WebGUI::SQL->quickHash("select * from widget,UserSubmission where widget.widgetId=$session{form}{wid} and widget.widgetId=UserSubmission.widgetId",$session{dbh});
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
$output .= '<h1>'.WebGUI::International::get(292).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%data = getProperties($namespace,$session{form}{wid});
$output = helpLink(1,$namespace);
$output .= '<h1>'.WebGUI::International::get(18,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("func","editSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$data{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros","1",$data{processMacros}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$data{title}));
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}));
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros","1",$data{processMacros}));
%hash = WebGUI::Widget::getPositions();
$array[0] = $data{position};
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(363).'</td><td>'.WebGUI::Form::selectList("position",\%hash,\@array).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$data{description}).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("position",\%hash,\@array));
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$data{description}));
$array[0] = $data{groupToApprove};
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName",$session{dbh});
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::selectList("groupToApprove",\%hash,\@array,1).'</td></tr>';
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName");
$output .= tableFormRow(WebGUI::International::get(1,$namespace),WebGUI::Form::selectList("groupToApprove",\%hash,\@array,1));
$array[0] = $data{groupToContribute};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(2,$namespace).'</td><td>'.WebGUI::Form::selectList("groupToContribute",\%hash,\@array,1).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(280).'</td><td>'.WebGUI::Form::text("submissionsPerPage",20,2,$data{submissionsPerPage}).'</td></tr>';
%hash = ("Approved"=>WebGUI::International::get(281),"Denied"=>WebGUI::International::get(282),"Pending"=>WebGUI::International::get(283));
$output .= tableFormRow(WebGUI::International::get(2,$namespace),WebGUI::Form::selectList("groupToContribute",\%hash,\@array,1));
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::text("submissionsPerPage",20,2,$data{submissionsPerPage}));
%hash = ("Approved"=>WebGUI::International::get(7,$namespace),"Denied"=>WebGUI::International::get(8,$namespace),"Pending"=>WebGUI::International::get(9,$namespace));
$array[0] = $data{defaultStatus};
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(284).'</td><td>'.WebGUI::Form::selectList("defaultStatus",\%hash,\@array,1).'</td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(10,$namespace),WebGUI::Form::selectList("defaultStatus",\%hash,\@array,1));
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -260,7 +286,7 @@ sub www_edit {
sub www_editSave {
if (WebGUI::Privilege::canEditPage()) {
update();
WebGUI::SQL->write("update UserSubmission set groupToContribute=$session{form}{groupToContribute}, groupToApprove=$session{form}{groupToApprove}, submissionsPerPage=$session{form}{submissionsPerPage}, defaultStatus='$session{form}{defaultStatus}' where widgetId=$session{form}{wid}",$session{dbh});
WebGUI::SQL->write("update UserSubmission set groupToContribute=$session{form}{groupToContribute}, groupToApprove=$session{form}{groupToApprove}, submissionsPerPage=$session{form}{submissionsPerPage}, defaultStatus='$session{form}{defaultStatus}' where widgetId=$session{form}{wid}");
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -271,29 +297,29 @@ sub www_editSave {
sub www_editSubmission {
my ($output, %submission, $owner);
tie %submission, 'Tie::CPHash';
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}");
if ($owner == $session{user}{userId}) {
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId='$session{form}{sid}'",$session{dbh});
$output = '<h1>'.WebGUI::International::get(293).'</h1>';
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId='$session{form}{sid}'");
$output = '<h1>'.WebGUI::International::get(19,$namespace).'</h1>';
$output .= formHeader();
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
$output .= WebGUI::Form::hidden("sid",$session{form}{sid});
$output .= WebGUI::Form::hidden("func","editSubmissionSave");
$output .= '<table>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,128,$submission{title}).'</td></tr>';
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(178).'</td><td>'.WebGUI::Form::textArea("content",$submission{content},50,10).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$submission{title}));
$output .= tableFormRow(WebGUI::International::get(178),WebGUI::Form::textArea("content",$submission{content},50,10));
if ($submission{image} ne "") {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(179).'</td><td><a href="'.$session{page}{url}.'?func=deleteImage&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(186).'</a></td></tr>';
$output .= tableFormRow(WebGUI::International::get(179),'<a href="'.$session{page}{url}.'?func=deleteImage&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(186).'</a>');
} else {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(179).'</td><td>'.WebGUI::Form::file("image").'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(179),WebGUI::Form::file("image"));
}
if ($submission{attachment} ne "") {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(182).'</td><td><a href="'.$session{page}{url}.'?func=deleteAttachment&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(186).'</a></td></tr>';
$output .= tableFormRow(WebGUI::International::get(182),'<a href="'.$session{page}{url}.'?func=deleteAttachment&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(186).'</a>');
} else {
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(182).'</td><td>'.WebGUI::Form::file("attachment").'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(182),WebGUI::Form::file("attachment"));
}
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(183).'</td><td>'.WebGUI::Form::checkbox("convertCarriageReturns",1,$submission{convertCarriageReturns}).' <span style="font-size: 8pt;">(uncheck if you\'re writing an HTML submission)</span></td></tr>';
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
$output .= tableFormRow(WebGUI::International::get(183),WebGUI::Form::checkbox("convertCarriageReturns",1,$submission{convertCarriageReturns}).' <span style="font-size: 8pt;">(uncheck if you\'re writing an HTML submission)</span>');
$output .= formSave();
$output .= '</table></form>';
return $output;
} else {
@ -305,23 +331,23 @@ sub www_editSubmission {
#-------------------------------------------------------------------
sub www_editSubmissionSave {
my ($owner,%userSubmission,$image,$attachment,$title);
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}");
if ($owner == $session{user}{userId}) {
%userSubmission = WebGUI::SQL->quickHash("select * from UserSubmission where widgetId=$session{form}{wid}",$session{dbh});
$image = saveAttachment("image",$session{form}{wid},$session{form}{sid});
%userSubmission = getProperties($namespace,$session{form}{wid});
$image = WebGUI::Attachment::save("image",$session{form}{wid},$session{form}{sid});
if ($image ne "") {
$image = 'image='.quote($image).', ';
}
$attachment = saveAttachment("attachment",$session{form}{wid},$session{form}{sid});
$attachment = WebGUI::Attachment::save("attachment",$session{form}{wid},$session{form}{sid});
if ($attachment ne "") {
$attachment = 'attachment='.quote($attachment).', ';
}
if ($session{form}{title} ne "") {
$title = $session{form}{title};
} else {
$title = WebGUI::International::get(290);
$title = WebGUI::International::get(16,$namespace);
}
WebGUI::SQL->write("update UserSubmission_submission set dateSubmitted=".time().", convertCarriageReturns='$session{form}{convertCarriageReturns}', title=".quote($title).", content=".quote($session{form}{content}).", ".$image.$attachment." status='$userSubmission{defaultStatus}' where submissionId=$session{form}{sid}",$session{dbh});
WebGUI::SQL->write("update UserSubmission_submission set dateSubmitted=".time().", convertCarriageReturns='$session{form}{convertCarriageReturns}', title=".quote($title).", content=".quote($session{form}{content}).", ".$image.$attachment." status='$userSubmission{defaultStatus}' where submissionId=$session{form}{sid}");
if ($userSubmission{defaultStatus} ne "Approved") {
WebGUI::MessageLog::addEntry('',$userSubmission{groupToApprove},$session{page}{url}.'?func=viewSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid},3,$namespace);
}
@ -333,10 +359,9 @@ sub www_editSubmissionSave {
#-------------------------------------------------------------------
sub www_view {
my (%data, @submission, $output, $widgetId, $sth, @row, $i, $dataRows, $prevNextBar);
my (%data, @submission, $output, $sth, @row, $i, $dataRows, $prevNextBar);
tie %data, 'Tie::CPHash';
$widgetId = shift;
%data = WebGUI::SQL->quickHash("select * from widget,UserSubmission where widget.widgetId=$widgetId and widget.widgetId=UserSubmission.widgetId",$session{dbh});
%data = getProperties($namespace,$_[0]);
if (%data) {
if ($data{displayTitle} == 1) {
$output = "<h1>".$data{title}."</h1>";
@ -347,16 +372,16 @@ sub www_view {
if ($data{processMacros}) {
$output = WebGUI::Macro::process($output);
}
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,username,userId from UserSubmission_submission where widgetId='$widgetId' and status='Approved' order by dateSubmitted desc",$session{dbh});
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,username,userId from UserSubmission_submission where widgetId='$_[0]' and status='Approved' order by dateSubmitted desc");
while (@submission = $sth->array) {
$row[$i] = '<tr><td class="tableData"><a href="'.$session{page}{url}.'?wid='.$widgetId.'&func=viewSubmission&sid='.$submission[1].'">'.$submission[0].'</a></td><td class="tableData">'.epochToHuman($submission[2],"%M/%D/%y").'</td><td class="tableData"><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$submission[4].'">'.$submission[3].'</a></td></tr>';
$row[$i] = '<tr><td class="tableData"><a href="'.$session{page}{url}.'?wid='.$_[0].'&func=viewSubmission&sid='.$submission[1].'">'.$submission[0].'</a></td><td class="tableData">'.epochToHuman($submission[2],"%M/%D/%y").'</td><td class="tableData"><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$submission[4].'">'.$submission[3].'</a></td></tr>';
$i++;
}
$sth->finish;
$output .= '<table width="100%" cellpadding=3 cellspacing=0 border=0><tr><td align="right" class="tableMenu"><a href="'.$session{page}{url}.'?func=addSubmission&wid='.$widgetId.'">'.WebGUI::International::get(294).'</a></td></tr></table>';
$output .= '<table width="100%" cellpadding=3 cellspacing=0 border=0><tr><td align="right" class="tableMenu"><a href="'.$session{page}{url}.'?func=addSubmission&wid='.$_[0].'">'.WebGUI::International::get(20,$namespace).'</a></td></tr></table>';
($dataRows, $prevNextBar) = paginate($data{submissionsPerPage},$session{page}{url},\@row);
$output .= '<table width="100%" cellspacing=1 cellpadding=2 border=0>';
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(99).'</td><td class="tableHeader">'.WebGUI::International::get(287).'</td><td class="tableHeader">'.WebGUI::International::get(296).'</td></tr>';
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(99).'</td><td class="tableHeader">'.WebGUI::International::get(13,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(21,$namespace).'</td></tr>';
$output .= $dataRows;
$output .= '</table>';
$output .= $prevNextBar;
@ -368,24 +393,24 @@ sub www_view {
sub www_viewSubmission {
my ($output, %submission);
tie %submission, 'Tie::CPHash';
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId=$session{form}{sid}");
$output = "<h1>".$submission{title}."</h1>";
$output .= '<table width="100%" cellpadding=2 cellspacing=1 border=0>';
$output .= '<tr><td class="tableHeader">';
#---header
$output .= '<b>'.WebGUI::International::get(297).'</b> <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$submission{userId}.'">'.$submission{username}.'</a><br>';
$output .= '<b>'.WebGUI::International::get(298).'</b> '.epochToHuman($submission{dateSubmitted},"%w, %c %D, %y at %H:%n%p");
$output .= '<b>'.WebGUI::International::get(22,$namespace).'</b> <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$submission{userId}.'">'.$submission{username}.'</a><br>';
$output .= '<b>'.WebGUI::International::get(23,$namespace).'</b> '.epochToHuman($submission{dateSubmitted},"%w, %c %D, %y at %H:%n%p");
$output .= '</td><td rowspan="2" class="tableMenu" nowrap valign="top">';
#---menu
$output .= '<a href="'.$session{page}{url}.'">'.WebGUI::International::get(303).'</a><br>';
$output .= '<a href="'.$session{page}{url}.'">'.WebGUI::International::get(28,$namespace).'</a><br>';
if ($submission{userId} == $session{user}{userId}) {
$output .= '<a href="'.$session{page}{url}.'?func=deleteSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(186).'</a><br>';
$output .= '<a href="'.$session{page}{url}.'?func=editSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(302).'</a><br>';
$output .= '<a href="'.$session{page}{url}.'?func=editSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(27,$namespace).'</a><br>';
}
if ($submission{status} eq "Pending" && (WebGUI::Privilege::isInGroup(3,$session{user}{userId}) || WebGUI::Privilege::isInGroup(4,$session{user}{userId}))) {
$output .= '<a href="'.$session{page}{url}.'?func=approveSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'&mlog='.$session{form}{mlog}.'">'.WebGUI::International::get(299).'</a><br>';
$output .= '<a href="'.$session{page}{url}.'?op=viewMessageLog">'.WebGUI::International::get(300).'</a><br>';
$output .= '<a href="'.$session{page}{url}.'?func=denySubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'&mlog='.$session{form}{mlog}.'">'.WebGUI::International::get(301).'</a><br>';
$output .= '<a href="'.$session{page}{url}.'?func=approveSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'&mlog='.$session{form}{mlog}.'">'.WebGUI::International::get(24,$namespace).'</a><br>';
$output .= '<a href="'.$session{page}{url}.'?op=viewMessageLog">'.WebGUI::International::get(25,$namespace).'</a><br>';
$output .= '<a href="'.$session{page}{url}.'?func=denySubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'&mlog='.$session{form}{mlog}.'">'.WebGUI::International::get(26,$namespace).'</a><br>';
}
$output .= '</td</tr><tr><td class="tableData">';
#---content

Binary file not shown.

Before

Width:  |  Height:  |  Size: 966 B

After

Width:  |  Height:  |  Size: 969 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

After

Width:  |  Height:  |  Size: 934 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 904 B

After

Width:  |  Height:  |  Size: 907 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

After

Width:  |  Height:  |  Size: 873 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 869 B

After

Width:  |  Height:  |  Size: 872 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 913 B

After

Width:  |  Height:  |  Size: 916 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 934 B

After

Width:  |  Height:  |  Size: 925 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 868 B

After

Width:  |  Height:  |  Size: 870 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 868 B

After

Width:  |  Height:  |  Size: 872 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

After

Width:  |  Height:  |  Size: 870 B

Before After
Before After

BIN
www/extras/page.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

BIN
www/extras/pageDown.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

BIN
www/extras/pageUp.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 912 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

After

Width:  |  Height:  |  Size: 867 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Some files were not shown because too many files have changed in this diff Show more