WebGUI 2.1.0 release
This commit is contained in:
parent
08a5f757da
commit
1cf655659f
66 changed files with 3136 additions and 1001 deletions
395
docs/create.sql
395
docs/create.sql
File diff suppressed because one or more lines are too long
|
|
@ -195,6 +195,7 @@ CREATE TABLE event (
|
|||
description text,
|
||||
startDate int(11) default NULL,
|
||||
endDate int(11) default NULL,
|
||||
recurringEventId int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (eventId)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
|
|
@ -370,6 +371,7 @@ INSERT INTO incrementer VALUES ('eventId',1);
|
|||
INSERT INTO incrementer VALUES ('linkId',1);
|
||||
INSERT INTO incrementer VALUES ('questionId',1);
|
||||
INSERT INTO incrementer VALUES ('submissionId',1);
|
||||
INSERT INTO incrementer VALUES ('recurringEventId',1);
|
||||
|
||||
#
|
||||
# Table structure for table 'link'
|
||||
|
|
@ -518,7 +520,7 @@ INSERT INTO settings VALUES ('maxAttachmentSize','300');
|
|||
INSERT INTO settings VALUES ('lib','/extras');
|
||||
INSERT INTO settings VALUES ('sessionTimeout','28000');
|
||||
INSERT INTO settings VALUES ('attachmentDirectoryLocal','/data/WebGUI/uploads');
|
||||
INSERT INTO settings VALUES ('smtpServer','smtp.mycompany.com');
|
||||
INSERT INTO settings VALUES ('smtpServer','localhost');
|
||||
INSERT INTO settings VALUES ('companyEmail','info@mycompany.com');
|
||||
INSERT INTO settings VALUES ('ldapURL','ldap://ldap.mycompany.com:389/o=MyCompany');
|
||||
INSERT INTO settings VALUES ('companyName','My Company');
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
alter table event add column recurringEventId int not null;
|
||||
INSERT INTO incrementer VALUES ('recurringEventId',1);
|
||||
323
docs/upgrade_2.0.0-2.1.0.sql
Normal file
323
docs/upgrade_2.0.0-2.1.0.sql
Normal 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 <br> 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');
|
||||
|
||||
|
||||
|
||||
4
etc/WebGUI.conf.original
Normal file
4
etc/WebGUI.conf.original
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
dsn = DBI:mysql:WebGUI
|
||||
dbuser = webgui
|
||||
dbpass = password
|
||||
logfile = /data/webgui.log
|
||||
537
extras/ieEdit.html
Normal file
537
extras/ieEdit.html
Normal file
|
|
@ -0,0 +1,537 @@
|
|||
<HTML>
|
||||
<HEAD>
|
||||
<SCRIPT language="JavaScript">
|
||||
var L_CANCEL_TEXT = "Cancel";
|
||||
var L_INSERT_TEXT = "Insert";
|
||||
var L_LINKIMGBORDER_TEXT = "Display a border around the image link";
|
||||
var L_LINKSELECT_TEXT = "Select a community page: ";
|
||||
var L_LINKSELECTPAGE_TEXT = "Select Page";
|
||||
var L_LINKWEB_TEXT = "or type in a URL to a page on the Web: ";
|
||||
var L_PUTITLEBGCOLOR_TEXT = "Set the Background Color";
|
||||
var L_PUTITLEFONTFACE_TEXT = "Set the Font Style";
|
||||
var L_PUTITLEFONTSIZE_TEXT = "Set The Font Size";
|
||||
var L_PUTITLEIMAGE_TEXT = "Insert/ Edit Image";
|
||||
var L_PUTITLELINK_TEXT = "Insert/ Edit a link";
|
||||
var L_PUTITLENEWTABLE_TEXT = "Create/ Edit Table";
|
||||
var L_PUTITLEPARAGRAPHSTYLE_TEXT = "Set the Paragraph Style";
|
||||
var L_PUTITLETEXTCOLOR_TEXT = "Set the Text Color";
|
||||
var L_STYLEFORMATTED_TEXT = "Preformatted";
|
||||
var L_STYLEHEADING_TEXT = "Heading ";
|
||||
var L_STYLENORMAL_TEXT = "Normal";
|
||||
var L_STYLESAMPLE_TEXT = "Sample Text";
|
||||
var L_TABLEBG_TEXT = "Background";
|
||||
var L_TABLEBORDERS_TEXT = "Borders";
|
||||
var L_TABLEINPUTBGCOLOR_TEXT = "Background Color: ";
|
||||
var L_TABLEINPUTBGIMGURL_TEXT = "Background Image URL: ";
|
||||
var L_TABLEINPUTBORDER_TEXT = "Border Width: ";
|
||||
var L_TABLEINPUTBORDERCOLOR_TEXT = "Border Color: ";
|
||||
var L_TABLEINPUTCELLPADDING_TEXT = "Cell Padding: ";
|
||||
var L_TABLEINPUTCELLSPACING_TEXT = "Cell Spacing: ";
|
||||
var L_TABLEINPUTCOLUMNS_TEXT = "Columns: ";
|
||||
var L_TABLEINPUTROWS_TEXT = "Rows: ";
|
||||
var L_TABLEPADDINGANDSPACING_TEXT = "Padding and Spacing";
|
||||
var L_TABLEROWSANDCOLS_TEXT = "Rows and Columns";
|
||||
var L_TABLEINSERTROW_TEXT = "Insert Row";
|
||||
var L_TABLEINSERTCELL_TEXT = "Insert Column";
|
||||
var L_TABLEINSERT_TEXT = "Insert Table";
|
||||
var L_TABLEUPDATE_TEXT = "Update Table";
|
||||
var L_TABLENEW_TEXT = "New Table";
|
||||
var L_TABLEEDIT_TEXT = "Edit Table";
|
||||
var L_TIPB_TEXT = "Bold";
|
||||
var L_TIPBGCOLOR_TEXT = "Background Color";
|
||||
var L_TIPCJ_TEXT = "Center Justify";
|
||||
var L_TIPCOPY_TEXT = "Copy Text";
|
||||
var L_TIPCUT_TEXT = "Cut Text";
|
||||
var L_TIPDINDENT_TEXT = "Decrease Indent";
|
||||
var L_TIPFGCOLOR_TEXT = "Text Color";
|
||||
var L_TIPFSIZE_TEXT = "Font Size";
|
||||
var L_TIPFSTYLE_TEXT = "Font Style";
|
||||
var L_TIPI_TEXT = "Italic";
|
||||
var L_TIPIINDENT_TEXT = "Increase Indent";
|
||||
var L_TIPLINE_TEXT = "Insert Line";
|
||||
var L_TIPLINK_TEXT = "Insert Link";
|
||||
var L_TIPLJ_TEXT = "Left Justify";
|
||||
var L_TIPOL_TEXT = "Numbered List";
|
||||
var L_TIPP_TEXT = "Paragraph Style";
|
||||
var L_TIPPASTE_TEXT = "Paste Text";
|
||||
var L_TIPRJ_TEXT = "Right Justify";
|
||||
var L_TIPTABLE_TEXT = "Insert Table";
|
||||
var L_TIPU_TEXT = "Underline";
|
||||
var L_TIPUL_TEXT = "Bulleted List";
|
||||
var L_MODETITLE_TEXT = "Advanced HTML Mode";
|
||||
var L_MODETITLE_TEXT = "Use HTML to create your page.";
|
||||
var L_MODEDESC_TEXT = " - Edit the HTML formatting commands directly.";
|
||||
var L_CUSTOMFONT_TEXT = "Other Font...";
|
||||
var L_CUSTOMFONTENTRY_TEXT = "Enter the name of your font:";
|
||||
var L_SAMPLEFONTENTRY_TEXT = "Arial, Geneva, Sans-serif";
|
||||
var L_CLOSEBUTTON_TEXT = "x";
|
||||
var L_TBDATABINDING_TEXT = "Columns";
|
||||
var L_TBDATALABEL_TEXT = 'Add a placeholder for the selected column.';
|
||||
var L_DEFAULTHTML_TEXT = "<DIV></DIV>";
|
||||
// Customize Font List
|
||||
// FONTNAME_TEXT - Displayed in the pop-up
|
||||
// FONTNAMEDEF_TEXT - The font definition used in the HTML
|
||||
var L_FONTARIAL_TEXT = "Arial";
|
||||
var L_FONTARIALDEF_TEXT = "Geneva, Arial, Sans-serif";
|
||||
var L_FONTARIALBLACK_TEXT = "Arial Black";
|
||||
var L_FONTARIALBLACKDEF_TEXT = "Arial Black, Geneva, Arial, Sans-serif";
|
||||
var L_FONTCOURIERNEW_TEXT = "Courier New";
|
||||
var L_FONTCOURIERNEWDEF_TEXT = "Courier New, Courier, Monospace";
|
||||
var L_FONTTIMESNEWROMAN_TEXT = "Times New Roman";
|
||||
var L_FONTTIMESNEWROMANDEF_TEXT = "Times New Roman, Times, Serif";
|
||||
var L_FONTVERDANA_TEXT = "Verdana";
|
||||
var L_FONTVERDANADEF_TEXT = "Verdana, Geneva, Arial, Sans-serif";
|
||||
var L_LUCIDAHAND_TEXT = "Lucida Handwriting";
|
||||
var L_LUCIDAHANDDEF_TEXT = "Lucida Handwriting, Cursive";
|
||||
var L_GARAMOND_TEXT = "Garamond";
|
||||
var L_GARAMONDDEF_TEXT = "Garamond, Times, Serif";
|
||||
var L_WEBDINGS_TEXT = "Webdings";
|
||||
var L_WEBDINGSDEF_TEXT = "Webdings";
|
||||
var L_WINGDINGS_TEXT = "Wingdings";
|
||||
var L_WINGDINGSDEF_TEXT = "Wingdings";
|
||||
// Add/ Remove fonts by modifying array
|
||||
// _CFont(Definition, Display Text, Symbol)
|
||||
// Set Symbol=true for non-alphabetic fonts to append display text in default font to the sample string
|
||||
function _CFont(szDef,szText,bSymbol) {
|
||||
return new Array(szDef,szText,bSymbol);
|
||||
};
|
||||
defaultFonts = new Array();
|
||||
defaultFonts[0] = _CFont(L_FONTARIALDEF_TEXT, L_FONTARIAL_TEXT, false);
|
||||
defaultFonts[1] = _CFont(L_FONTARIALBLACKDEF_TEXT, L_FONTARIALBLACK_TEXT, false);
|
||||
defaultFonts[2] = _CFont(L_FONTVERDANADEF_TEXT, L_FONTVERDANA_TEXT, false);
|
||||
defaultFonts[3] = _CFont(L_FONTTIMESNEWROMANDEF_TEXT, L_FONTTIMESNEWROMAN_TEXT, false);
|
||||
defaultFonts[4] = _CFont(L_GARAMONDDEF_TEXT,L_GARAMOND_TEXT, false);
|
||||
defaultFonts[5] = _CFont(L_LUCIDAHANDDEF_TEXT,L_LUCIDAHAND_TEXT, false);
|
||||
defaultFonts[6] = _CFont(L_FONTCOURIERNEWDEF_TEXT, L_FONTCOURIERNEW_TEXT, false);
|
||||
defaultFonts[7] = _CFont(L_WEBDINGSDEF_TEXT, L_WEBDINGS_TEXT, true);
|
||||
defaultFonts[8] = _CFont(L_WINGDINGSDEF_TEXT, L_WINGDINGS_TEXT, true);
|
||||
// Width of each toolbar button
|
||||
// Entry 5-8 are specify "Paragraph","Font Style", and "Font Size" respectively
|
||||
// Update widths if localized
|
||||
var L_TOOLBARGIF_TEXT = "toolbar.gif";
|
||||
var aSizes = new Array(25,25,25,7,80,76,71,7,25,25,25,8,25,25,25,8,25,25,25,25,8,25,25,25,8,25,25);
|
||||
function setHTML(szHTML)
|
||||
{
|
||||
if (g_state.bMode)
|
||||
idEditbox.document.body.innerHTML = szHTML
|
||||
else
|
||||
idEditbox.document.body.innerText = szHTML
|
||||
_Editor_MoveSelection(true)
|
||||
}
|
||||
function getHTML()
|
||||
{
|
||||
var szRet = (g_state.bMode ? idEditbox.document.body.innerHTML : idEditbox.document.body.innerText)
|
||||
return szRet
|
||||
}
|
||||
function getText() {
|
||||
var szRet = ""
|
||||
if (g_state.bMode)
|
||||
szRet = idEditbox.document.body.innerText
|
||||
else {
|
||||
setMode(true)
|
||||
szRet = idEditbox.document.body.innerText
|
||||
setMode(false)
|
||||
}
|
||||
return szRet
|
||||
}
|
||||
function getBody()
|
||||
{
|
||||
var oRet = idEditbox.document.body
|
||||
return oRet
|
||||
}
|
||||
function getWidth()
|
||||
{
|
||||
var nRet = document.body.offsetWidth
|
||||
return nRet
|
||||
}
|
||||
function getHeight()
|
||||
{
|
||||
var nRet = document.body.offsetHeight
|
||||
return nRet
|
||||
}
|
||||
|
||||
function insertHTML(szHTML)
|
||||
{
|
||||
var sType
|
||||
var sel = g_state.GetSelection()
|
||||
sType = sel.type
|
||||
if (g_state.bMode) {
|
||||
if (sType=="Control")
|
||||
sel.item(0).outerHTML = szHTML
|
||||
else
|
||||
sel.pasteHTML(szHTML)
|
||||
}
|
||||
else
|
||||
sel.text = szHTML
|
||||
}
|
||||
function setFocus() {
|
||||
idEditbox.focus()
|
||||
}
|
||||
function appendHTML(szHTML) {
|
||||
if (g_state.bMode)
|
||||
idEditbox.document.body.insertAdjacentHTML("beforeEnd",szHTML)
|
||||
else
|
||||
idEditbox.document.body.insertAdjacentText("beforeEnd",szHTML)
|
||||
}
|
||||
function setBGColor(szValue)
|
||||
{
|
||||
g_state.bgColor = szValue
|
||||
if (g_state.bMode)
|
||||
idEditbox.document.body.bgColor = g_state.bgColor
|
||||
}
|
||||
function getBGColor()
|
||||
{
|
||||
var szRet = g_state.bgColor
|
||||
return szRet
|
||||
}
|
||||
function setDefaultStyle(szValue)
|
||||
{
|
||||
g_state.css = szValue
|
||||
if (g_state.bMode)
|
||||
idEditbox.document.body.style.cssText = g_state.css
|
||||
}
|
||||
function getDefaultStyle()
|
||||
{
|
||||
var oRet = g_state.css
|
||||
return oRet
|
||||
}
|
||||
function setSkin(szSkin)
|
||||
{
|
||||
if (szSkin == null)
|
||||
document.styleSheets.skin.cssText = g_state.defaultSkin
|
||||
else
|
||||
document.styleSheets.skin.cssText = szSkin
|
||||
document.styleSheets.skin.disabled = false
|
||||
}
|
||||
function setPopupSkin(szSkin)
|
||||
{
|
||||
if (szSkin == null)
|
||||
document.styleSheets.popupSkin.cssText = g_state.popupSkin
|
||||
else
|
||||
document.styleSheets.popupSkin.cssText = szSkin
|
||||
_CPopup_Init()
|
||||
}
|
||||
function setToolbar(id,g_state)
|
||||
{
|
||||
var el = document.all[id]
|
||||
if (el)
|
||||
el.style.display = (g_state) ? "" : "none"
|
||||
if (id=="tbmode")
|
||||
_setSize()
|
||||
}
|
||||
function setLinks(arLinks)
|
||||
{
|
||||
g_state.aLinks = arLinks
|
||||
}
|
||||
function setBindings(aBindings)
|
||||
{
|
||||
if ((aBindings) && (aBindings.length>0))
|
||||
{
|
||||
g_state.aBindings = aBindings
|
||||
for (var iField = DBSelect.length-1; iField > 0; iField--)
|
||||
DBSelect[iField] = null
|
||||
for (var iField = 0; iField < g_state.aBindings.length; iField++)
|
||||
DBSelect.add(new Option(g_state.aBindings[iField]))
|
||||
tbDBSelect.style.display = "inline"
|
||||
}
|
||||
else
|
||||
tbDBSelect.style.display = ""
|
||||
}
|
||||
function setMode(bMode)
|
||||
{
|
||||
if (bMode!=g_state.bMode) {
|
||||
g_state.bMode = bMode
|
||||
var objBody = idEditbox.document.body
|
||||
if (!bMode&& !g_state.bMode)
|
||||
{
|
||||
_CPopup_Hide()
|
||||
objBody.bgColor = objBody.style.cssText = ""
|
||||
if (g_state.customButtons)
|
||||
idStandardBar.style.display = "none"
|
||||
else
|
||||
idToolbar.style.display = "none"
|
||||
objBody.innerText = idEditbox.document.body.innerHTML
|
||||
objBody.className = "textMode"
|
||||
}
|
||||
if ((bMode) && (g_state.bMode))
|
||||
{
|
||||
setDefaultStyle(g_state.css)
|
||||
setBGColor(g_state.bgColor)
|
||||
objBody.className = idStandardBar.style.display = idToolbar.style.display = ""
|
||||
objBody.innerHTML = idEditbox.document.body.innerText
|
||||
}
|
||||
_setSize()
|
||||
cbMode.checked = !bMode
|
||||
_Editor_MoveSelection(true)
|
||||
setFocus()
|
||||
}
|
||||
return bMode
|
||||
}
|
||||
function addButton(sID,sButton)
|
||||
{
|
||||
if (!sID)
|
||||
tbButtons.insertAdjacentHTML("beforeEnd","<BR>")
|
||||
else
|
||||
tbButtons.insertAdjacentHTML("beforeEnd","<INPUT TYPE=\"button\" ONCLICK=\"_userButtonClick(this)\" CLASS=\"userButton\" ID=\"" + sID + "\" VALUE=\"" + sButton + "\"> ")
|
||||
g_state.customButtons = true
|
||||
}
|
||||
// EDITOR PRIVATE
|
||||
function _Format(szHow, szValue) {
|
||||
var oSel = g_state.GetSelection()
|
||||
var sType = oSel.type
|
||||
var oTarget = (sType == "None" ? idEditbox.document : oSel)
|
||||
var oBlock = (oSel.parentElement != null ? _CUtil_GetBlock(oSel.parentElement()) : oSel.item(0))
|
||||
setFocus()
|
||||
switch(szHow)
|
||||
{
|
||||
case "BackColor":
|
||||
var el = null
|
||||
if (oSel.parentElement != null) {
|
||||
el = _CUtil_GetElement(oSel.parentElement(),"TD")
|
||||
if (!el) el = _CUtil_GetElement(oSel.parentElement(),"TH")
|
||||
if (!el) el = _CUtil_GetElement(oSel.parentElement(),"TR")
|
||||
if (!el) el = _CUtil_GetElement(oSel.parentElement(),"TABLE")
|
||||
}
|
||||
else
|
||||
el = _CUtil_GetElement(oSel.item(0),"TABLE")
|
||||
if (el)
|
||||
el.bgColor = szValue
|
||||
else
|
||||
setBGColor(szValue)
|
||||
break;
|
||||
case "Justify":
|
||||
if (oBlock)
|
||||
{
|
||||
oBlock.style.textAlign = ""
|
||||
if (((oBlock.tagName=="TABLE") || (oBlock.tagName=="IMG")) && (("left"==oBlock.align) && ("Left"==szValue))) {
|
||||
oBlock.align = ""
|
||||
break;
|
||||
}
|
||||
oBlock.align = szValue
|
||||
if ((oBlock.tagName=="HR") || ((oBlock.tagName=="IMG") && szValue!="Center")) break;
|
||||
}
|
||||
szHow=szHow+szValue
|
||||
szValue=""
|
||||
// Fall through
|
||||
default:
|
||||
oTarget.execCommand(szHow, false, szValue)
|
||||
break
|
||||
}
|
||||
g_state.RestoreSelection()
|
||||
setFocus()
|
||||
return true
|
||||
}
|
||||
function _initEditor() {
|
||||
g_state = new _CState()
|
||||
window.onresize = _setSize
|
||||
var sz = ""
|
||||
sz += ""+ "<STYLE>"+ ".DataBound{border:1 solid #999999;margin:1;font-family:Courier;background:#F1F1F1}\n"+ ".textMode {border-top: 1px black solid;font: 10pt courier}\n.NOBORDER TD {border:1px gray solid}"+ "BODY {border: 1px white solid;border-top: none;}"+ "</STYLE>"+ "<BODY ONCONTEXTMENU=\"return false\">"+ "<DIV></DIV>"+ "</BODY>"
|
||||
_CPopup_Init()
|
||||
idEditbox.document.designMode = "on"
|
||||
idEditbox.document.open("text/html","replace")
|
||||
idEditbox.document.write(sz)
|
||||
idEditbox.document.close()
|
||||
idEditbox.document.body.onblur = g_state.SaveSelection
|
||||
idEditbox.document.onkeydown = _Editor_KeyDownHandler
|
||||
idEditbox.document.onmousedown = _Editor_ClickHandler
|
||||
idEditbox.document.ondblclick = _Editor_DblClickHandler
|
||||
setTimeout("_pageReady()",0)
|
||||
}
|
||||
function _Editor_MoveSelection(bDir) {
|
||||
var tr = idEditbox.document.body.createTextRange()
|
||||
tr.collapse(bDir)
|
||||
tr.select()
|
||||
}
|
||||
function _Editor_ClickHandler() {
|
||||
g_state.selection = null
|
||||
}
|
||||
function _Editor_KeyDownHandler() {
|
||||
var ev = this.parentWindow.event
|
||||
if (ev.keyCode==9)
|
||||
g_state.SaveSelection()
|
||||
else
|
||||
g_state.selection=null
|
||||
}
|
||||
function _Editor_DblClickHandler() {
|
||||
// Shortcuts
|
||||
var el = this.parentWindow.event.srcElement
|
||||
if (el.tagName=="IMG") {
|
||||
el.removeAttribute("width")
|
||||
el.removeAttribute("height")
|
||||
el.style.removeAttribute("width")
|
||||
el.style.removeAttribute("height")
|
||||
el.width = el.width
|
||||
el.height = el.height
|
||||
}
|
||||
if (el.tagName=="TABLE")
|
||||
_CPopup_Show('Table')
|
||||
}
|
||||
function _setSize() {
|
||||
document.all.idEditbox.style.pixelHeight = document.body.clientHeight - idToolbar.offsetHeight - document.all.idMode.offsetHeight
|
||||
document.all.idPopup.style.pixelLeft = (document.body.clientWidth - idPopup.document.all.puRegion.offsetWidth) / 2
|
||||
}
|
||||
function _pageReady()
|
||||
{
|
||||
idEditbox.document.body.oncontextmenu = new Function("return false")
|
||||
if (g_state.szSearch!="")
|
||||
idPopup.document.domain = idEditbox.document.domain = document.domain = g_state.szSearch
|
||||
//_Editor_MoveSelection(false)
|
||||
if (self.parent.RTELoaded)
|
||||
self.parent.RTELoaded(self)
|
||||
if (document.styleSheets.skin.disabled)
|
||||
setSkin(null)
|
||||
_setSize()
|
||||
idEditor.style.visibility=""
|
||||
}
|
||||
function _userButtonClick(el)
|
||||
{
|
||||
if (parent.RTEButton) parent.RTEButton(self, el.id)
|
||||
}
|
||||
function _drawToolbar()
|
||||
{
|
||||
var aIds = new Array("cut","copy","paste","bar1","formatblock","fontstyle","fontsize","bar2","bold","italic","underline","bar3","left","center","right","bar4","orderedlist","unorderedlist","outdent","indent","bar5","line","link","table","bar6","bgcolor","textcolor")
|
||||
var aTips = new Array(L_TIPCUT_TEXT,L_TIPCOPY_TEXT,L_TIPPASTE_TEXT,"",L_TIPP_TEXT,L_TIPFSTYLE_TEXT,L_TIPFSIZE_TEXT,"",L_TIPB_TEXT,L_TIPI_TEXT,L_TIPU_TEXT,"",L_TIPLJ_TEXT,L_TIPCJ_TEXT,L_TIPRJ_TEXT,"",L_TIPOL_TEXT,L_TIPUL_TEXT,L_TIPDINDENT_TEXT,L_TIPIINDENT_TEXT,"",L_TIPLINE_TEXT,L_TIPLINK_TEXT,L_TIPTABLE_TEXT,"",L_TIPBGCOLOR_TEXT,L_TIPFGCOLOR_TEXT)
|
||||
var aCommand = new Array("_Format('cut')","_Format('copy')","_Format('paste')",null,"_CPopup_Show('formatblock')","_CPopup_Show('font')","_CPopup_Show('fontsize')",null,"_Format('bold')","_Format('italic')","_Format('underline')",null,"_Format('Justify','Left')","_Format('Justify','Center')","_Format('Justify','Right')",null,"_Format('insertorderedlist')","_Format('insertunorderedlist')","_Format('outdent')","_Format('indent')",null,"_Format('InsertHorizontalRule')","_CPopup_Show('Link')","_CPopup_Show('Table')",null,"_CPopup_Show('BackColor')","_CPopup_Show('ForeColor')")
|
||||
var sz = "<DIV ID=idStandardBar><NOBR>", iLeft=0, iHeight=24
|
||||
for (var i = 0 ; i < aSizes.length; i++)
|
||||
{
|
||||
sz += ""+ "<SPAN CLASS=tbButton ONKEYPRESS=\"if (event.keyCode==13) {" + aCommand[i] + ";event.keyCode=0}\" " + (aTips[i]=="" ? "" : ("TABINDEX=" + (i+1))) + " "+ "ID=\"tb" + aIds[i] + "\" "+ "STYLE=\"width: " + aSizes[i] + ";height:" + iHeight+ "\""+ ">" + "<SPAN "+ "STYLE=\""+ "position:absolute;"+ "width:" + aSizes[i] + ";height:" + iHeight + ";"+ "clip: rect(0 " + aSizes[i] + " " + iHeight + " 0)"+ "\""+ ">"+ "<IMG "+ "TITLE=\"" + aTips[i] + "\" "+ "ONCLICK=\"" + aCommand[i] + "; event.cancelBubble=true\" "+ "ONMOUSEDOWN=\"if (event.button==1) this.style.pixelTop=-" + (iHeight*2) + "\" "+ "ONMOUSEOVER=\"this.style.pixelTop=-" + iHeight + "\" "+ "ONMOUSEOUT=\"this.style.pixelTop=0\" "+ "ONMOUSEUP=\"this.style.pixelTop=-" + iHeight + "\" "+ "SRC=\"" + L_TOOLBARGIF_TEXT + "\" "+ "STYLE=\"position:absolute;top:0;left:-" + iLeft + "\""+ ">"+ "</SPAN>"+ "</SPAN>" + (aTips[i]=="" ? "</NOBR><NOBR>" : "")
|
||||
iLeft += aSizes[i]
|
||||
}
|
||||
sz += ""+ "</NOBR>"+ "<SPAN CLASS=tbButton ID=\"tbDBSelect\">" + "<SPAN "+ "STYLE=\""+ "position:absolute;"+ "width: 100;"+ "clip: rect(0 100 " + iHeight + " 0)"+ "\""+ ">"+ "<SELECT "+ "ID=DBSelect "+ "ONCLICK='event.cancelBubble=true;' "+ "ONCHANGE='_CPopup_InsertDatabound(this)' "+ ">"+ "<OPTION>"+ "- " + L_TBDATABINDING_TEXT + " -"+ "</OPTION>"+ "</SELECT>"
|
||||
document.write(sz + "</DIV>")
|
||||
}
|
||||
function _drawModeSelect() {
|
||||
var sz = "<TABLE CELLSPACING=0 CELLPADDING=0 ID=idMode>"
|
||||
+ "<TR><TD><INPUT TYPE=checkbox ID=cbMode ONCLICK=\"setMode(!this.checked)\"></TD>"
|
||||
+ "<TD><LABEL FOR=cbMode>" + L_MODETITLE_TEXT + "</LABEL>" + L_MODEDESC_TEXT
|
||||
+ "</TD></TR></TABLE>";
|
||||
document.write(sz);
|
||||
cbMode.checked = false;
|
||||
}
|
||||
// _CState
|
||||
function _CState()
|
||||
{
|
||||
this.selection = null
|
||||
this.bMode = true
|
||||
this.customButtons = false
|
||||
this.css = this.bgColor = ""
|
||||
this.defaultSkin = document.styleSheets.skin.cssText
|
||||
this.popupSkin = document.styleSheets.popupSkin.cssText
|
||||
this.aLinks = new Array()
|
||||
this.szSearch = location.search.substring(1)
|
||||
this.aBindings = new Array()
|
||||
this.aListPopups = new Object()
|
||||
this.aCache = new Object()
|
||||
this.RestoreSelection = _CState_RestoreSelection
|
||||
this.GetSelection = _CState_GetSelection
|
||||
this.SaveSelection = _CState_SaveSelection
|
||||
}
|
||||
function _CState_RestoreSelection()
|
||||
{
|
||||
if (this.selection) this.selection.select()
|
||||
}
|
||||
function _CState_GetSelection()
|
||||
{
|
||||
var oSel = this.selection
|
||||
if (!oSel) {
|
||||
oSel = idEditbox.document.selection.createRange()
|
||||
oSel.type = idEditbox.document.selection.type
|
||||
}
|
||||
return oSel
|
||||
}
|
||||
function _CState_SaveSelection()
|
||||
{
|
||||
g_state.selection = idEditbox.document.selection.createRange()
|
||||
g_state.selection.type = idEditbox.document.selection.type
|
||||
}
|
||||
|
||||
</SCRIPT>
|
||||
<SCRIPT SRC="ieEdit.js"></SCRIPT>
|
||||
<STYLE>
|
||||
body {margin:0pt;border:none;padding:0pt}
|
||||
#tbDBSelect {display:none;text-align:left;width: 100;margin-right: 1pt;margin-bottom: 0pt;margin-top: 0pt;padding: 0pt}
|
||||
#DBSelect, #idMode, .userButton {font:8pt arial}
|
||||
#DBSelect {width:100}
|
||||
#idMode {margin-top:0pt}
|
||||
.tbButton {text-align:left;margin:0pt 1pt 0pt 0pt;padding:0pt}
|
||||
#EditBox {position: relative}
|
||||
</STYLE>
|
||||
<STYLE ID=skin DISABLED>
|
||||
#EditBox {margin: 0px 11px 0px 11px}
|
||||
#tbUpRight, #tbUpLeft {width:20px}
|
||||
#idMode {margin-left:11px;padding:0pt}
|
||||
#idMode LABEL {color: navy;text-decoration: underline}
|
||||
#tbTopBar {height:19px}
|
||||
#tbButtons, #tbContents {background: #cccccc;vertical-align: top}
|
||||
#tbContents {padding:0px 5px}
|
||||
#tbBottomBar {height:6px}
|
||||
</STYLE>
|
||||
<STYLE ID=defPopupSkin>
|
||||
#popup BODY {margin:0px;border-top:none}
|
||||
#popup .colorTable {height:91px}
|
||||
#popup #header {width:100%}
|
||||
#popup #close {cursor:default;font:bold 8pt system;width:16px;text-align: center}
|
||||
#popup #content {padding:10pt}
|
||||
#popup TABLE {vertical-align:top}
|
||||
#popup .tabBody {border:1px black solid;border-top: none}
|
||||
#popup .tabItem, #popup .tabSpace {border-bottom:1px black solid;border-left:1px black solid}
|
||||
#popup .tabItem {border-top:1px black solid;font:10pt arial,geneva,sans-serif;}
|
||||
#popup .currentColor {width:20px;height:20px; margin: 0pt;margin-right:15pt;border:1px black solid}
|
||||
#popup .tabItem DIV {margin:3px;padding:0px;cursor: hand}
|
||||
#popup .tabItem DIV.disabled {color: gray;cursor: default}
|
||||
#popup .selected {font-weight:bold}
|
||||
</STYLE>
|
||||
<STYLE ID=popupSkin>
|
||||
#popup BODY {border: 3px #000000 solid; background: #F1F1F1}
|
||||
#popup #header {background: #aaaaaa; color: white}
|
||||
#popup #caption {text-align: left;font: bold 12pt arial , geneva, sans-serif}
|
||||
#popup .ColorTable, #popup #idList TD#current {border: 1px black solid}
|
||||
#popup #idList TD{cursor: hand;border: 1px #F1F1F1 solid}
|
||||
#popup #close {border: 1px #ffffff solid;background: #000000;cursor:hand;color: #ffbd21;font-weight: bold;margin-right: 6px;padding:0px 4px 2px}
|
||||
#popup #tableProps .tablePropsTitle {color:#006699;text-align:left;margin:0pt;border-bottom: 1px black solid;margin-bottom:5pt}
|
||||
#tableButtons, #tableProps {padding:5px}
|
||||
#popup #tableContents {height:175px}
|
||||
#popup #tableProps .tablePropsTitle, #popup #tableProps, #popup #tableProps TABLE {font:bold 9pt Arial, Geneva, Sans-serif}
|
||||
#popup #tableOptions {font:9pt Arial, Geneva, Sans-serif;padding:15pt 5pt}
|
||||
#popup #puDivider {background:black;width:1px}
|
||||
#popup #content {margin: 0pt;padding:5pt 5pt 10pt 5pt}
|
||||
#popup #ColorPopup {width: 250px}
|
||||
#popup .ColorTable TR {height:6px}
|
||||
#popup .ColorTable TD {width:6px;cursor:hand}
|
||||
#popup .block P,#popup .block H1,#popup .block H2,#popup .block H3,
|
||||
#popup .block H4, #popup .block H5,#popup .block H6,#popup .block PRE {margin:0pt;padding:0pt}
|
||||
#popup #customFont {font:12pt Arial;text-decoration:italic}
|
||||
</STYLE>
|
||||
<SCRIPT>
|
||||
var g_state
|
||||
window.onload = _initEditor
|
||||
</SCRIPT>
|
||||
<title>Edit Window</title>
|
||||
</HEAD>
|
||||
<BODY ONCONTEXTMENU="return false" TABINDEX ="-1" SCROLL ="no" ONSELECTSTART ="return false" ONDRAGSTART="return false" ONSCROLL="return false">
|
||||
<DIV ID="idEditor" STYLE="VISIBILITY:hidden">
|
||||
<TABLE ID=idToolbar WIDTH="100%" CELLSPACING=0 CELLPADDING=0 ONCLICK="_CPopup_Hide()">
|
||||
<TR ID=tbTopBar><TD ID=tbUpLeft></TD><TD COLSPAN=2 ID=tbUpMiddle></TD><TD ID=tbUpRight></TD></TR>
|
||||
<TR><TD ID=tbMidLeft></TD>
|
||||
<TD ID=tbContents><SCRIPT>_drawToolbar()</SCRIPT></TD></form>
|
||||
<TD ID=tbButtons ALIGN=right><input type="button" onClick="sendContentAndClose();" value="done" style="font-size: 8pt;"></TD><TD ID=tbMidRight></TD>
|
||||
</TR>
|
||||
<TR ID=tbbottomBar><TD ID=tbLowLeft></TD><TD COLSPAN=2 ID=tbLowMiddle></TD><TD ID=tbLowRight></TD></TR>
|
||||
</TABLE>
|
||||
<IFRAME NAME="idPopup" STYLE="HEIGHT: 200px; LEFT: 25px; MARGIN-TOP: 8px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 200px; Z-INDEX: -1"></IFRAME>
|
||||
<IFRAME ID="EditBox" NAME="idEditbox" WIDTH="100%" HEIGHT="100%" ONFOCUS="_CPopup_Hide()"></IFRAME>
|
||||
<DIV ID="tbmode" style="visibility : hidden;"><SCRIPT>_drawModeSelect()</SCRIPT></DIV>
|
||||
</DIV>
|
||||
<script language="JavaScript">
|
||||
function sendContentAndClose() {
|
||||
window.blur();
|
||||
window.opener.focus();
|
||||
window.opener.setContent("<div style='background-color:" +getBGColor() + "'>"+getHTML()+"</div>");
|
||||
window.close();
|
||||
}
|
||||
appendHTML(window.opener.formObj.value);
|
||||
//idEditbox.document.body.innerHTML=window.opener.formObj.value;
|
||||
</script>
|
||||
</BODY>
|
||||
</HTML>
|
||||
665
extras/ieEdit.js
Normal file
665
extras/ieEdit.js
Normal file
|
|
@ -0,0 +1,665 @@
|
|||
// EDITOR PUBLIC (API)
|
||||
|
||||
// POPUP (Link, table and image popup need to be worked on)
|
||||
function _CPopup_Init()
|
||||
{
|
||||
var sz = "<HTML ID=popup><STYLE>"+document.styleSheets.defPopupSkin.cssText+"\n"+document.styleSheets.popupSkin.cssText+"</STYLE><SCRIPT>function IMAGELoaded(w) {parent._IMAGELoaded(w,self)}</SCRIPT>"+ "<BODY "+ "ONSCROLL=\"return false\" SCROLL=no TABINDEX=-1 "+ "ONSELECTSTART=\"return event.srcElement.tagName=='INPUT'\" "+ "><DIV ID=puRegion>"+ "<TABLE ID=header>"+ "<TR>"+ "<TH NOWRAP ID=caption></TH>"+ "<TH VALIGN=middle ALIGN=RIGHT><DIV ID=close ONCLICK=\"parent._CPopup_Hide()\">"+ L_CLOSEBUTTON_TEXT+ "</DIV></TH>"+ "</TR>"+ "</TABLE>"+ "<DIV ALIGN=CENTER ID=content></DIV>"+ "</DIV></BODY>"+ "</HTML>";
|
||||
idPopup.document.open("text/html","replace");
|
||||
idPopup.document.write(sz);
|
||||
idPopup.document.close();
|
||||
}
|
||||
|
||||
|
||||
function _CPopup_InsertDatabound(eSelect)
|
||||
{
|
||||
if (eSelect.selectedIndex != 0)
|
||||
{
|
||||
var sElemName = eSelect.options[eSelect.selectedIndex].text;
|
||||
var iLen = sElemName.length
|
||||
sElemName = sElemName.replace(/"/g, '"')
|
||||
insertHTML('<INPUT CLASS=DataBound SIZE=' + (iLen + 2) + ' NAME="' + sElemName +'" VALUE=" ' + sElemName + ' ">')
|
||||
eSelect.selectedIndex = 0;
|
||||
idEditbox.focus()
|
||||
}
|
||||
}
|
||||
function _CPopup_Hide()
|
||||
{
|
||||
document.all.idPopup.style.zIndex=-1
|
||||
document.all.idPopup.style.visibility = "hidden"
|
||||
idPopup.document._type = ""
|
||||
idPopup.document.onkeydown=idPopup.document.onmouseover=idPopup.document.onclick = null
|
||||
idEditbox.focus()
|
||||
}
|
||||
function _CPopup_Show(szType)
|
||||
{
|
||||
var oRenderer, szCacheKey = "PopupRenderer." + szType
|
||||
if (idPopup.document._type == szType)
|
||||
_CPopup_Hide()
|
||||
else
|
||||
{
|
||||
document.all.idPopup.style.zIndex = -1
|
||||
oRenderer = g_state.aCache[szCacheKey]
|
||||
if ((!oRenderer) || ("Link"==szType))
|
||||
g_state.aCache[szCacheKey] = oRenderer = new _CPopupRenderer(szType)
|
||||
// Force Sizing
|
||||
document.all.idPopup.style.visibility = ""
|
||||
idPopup.document.all.puRegion.style.pixelHeight = idPopup.document.all.puRegion.style.pixelWidth = 100
|
||||
idPopup.document._type = szType
|
||||
idPopup.document._renderer = oRenderer
|
||||
idPopup.document.all.caption.innerText = oRenderer.GetCaption()
|
||||
idPopup.document.all.content.innerHTML = oRenderer.GetHTML()
|
||||
idPopup.document.onkeydown = new Function("this._renderer.OnKeyDown()")
|
||||
idPopup.document.onmouseover = new Function("this._renderer.OnMouseOver()")
|
||||
idPopup.document.onclick = new Function("this._renderer.OnClick()")
|
||||
oRenderer.ResetContext(idPopup.document)
|
||||
setTimeout("_CPopupRenderer_Display('" + szType + "')",0)
|
||||
}
|
||||
}
|
||||
function _CPopupRenderer_Display(szType) {
|
||||
var oRenderer, szCacheKey = "PopupRenderer." + szType
|
||||
oRenderer = g_state.aCache[szCacheKey]
|
||||
if (oRenderer.autoSize) {
|
||||
idPopup.document.all.puRegion.style.pixelHeight = document.all.idPopup.style.pixelHeight = idPopup.document.all.puRegion.offsetHeight
|
||||
idPopup.document.all.puRegion.style.pixelWidth = document.all.idPopup.style.pixelWidth = idPopup.document.all.puRegion.offsetWidth + 50
|
||||
document.all.idPopup.style.pixelLeft = (document.body.clientWidth - idPopup.document.all.puRegion.offsetWidth) / 2
|
||||
}
|
||||
else {
|
||||
idPopup.document.all.puRegion.style.pixelHeight = document.all.idPopup.style.pixelHeight = document.body.clientHeight - idToolbar.offsetHeight- document.all.idMode.offsetHeight-20
|
||||
idPopup.document.all.puRegion.style.pixelWidth = document.all.idPopup.style.pixelWidth = document.body.clientWidth - 50
|
||||
document.all.idPopup.style.pixelLeft = 25
|
||||
}
|
||||
document.all.idPopup.style.zIndex=2
|
||||
idPopup.focus()
|
||||
}
|
||||
function _CPopupRenderer(szType)
|
||||
{
|
||||
this.szType = szType
|
||||
this.elCurrent = this.oDocument = null
|
||||
this.ResetContext = _CPopupRenderer_ResetContext
|
||||
this.GetCaption = _CPopupRenderer_GetCaption
|
||||
this.GetHTML = _CPopupRenderer_GetHTML
|
||||
this.autoSize = true
|
||||
this.OnMouseOver = new Function()
|
||||
this.OnKeyDown = _CListPopupRenderer_GenericOnKeyDown
|
||||
switch(szType)
|
||||
{
|
||||
case "formatblock":
|
||||
case "font":
|
||||
case "fontsize":
|
||||
this.OnMouseOver= _CListPopupRenderer_OnMouseOver
|
||||
this.OnKeyDown = _CListPopupRenderer_OnKeyDown
|
||||
case "BackColor":
|
||||
case "ForeColor":
|
||||
this.OnClick = _CListPopupRenderer_OnClick
|
||||
this.Highlight = _CListPopupRenderer_Highlight
|
||||
this.Select = _CListPopupRenderer_Select
|
||||
break
|
||||
default:
|
||||
this.OnClick = new Function()
|
||||
break
|
||||
}
|
||||
switch(szType)
|
||||
{
|
||||
case "formatblock":
|
||||
this.szCaption = L_PUTITLEPARAGRAPHSTYLE_TEXT
|
||||
this.PrepareHTML = _CFormatBlockPopupRenderer_PrepareHTML
|
||||
this.szHTML = this.PrepareHTML()
|
||||
break
|
||||
case "font":
|
||||
this.szCaption = L_PUTITLEFONTFACE_TEXT
|
||||
this.PrepareHTML = _CFontFacesPopupRenderer_PrepareHTML
|
||||
this.szHTML = this.PrepareHTML()
|
||||
break
|
||||
case "fontsize":
|
||||
this.szCaption = L_PUTITLEFONTSIZE_TEXT
|
||||
this.PrepareHTML =_CFontSizesPopupRenderer_PrepareHTML
|
||||
this.szHTML = this.PrepareHTML()
|
||||
break
|
||||
case "Link":
|
||||
this.szCaption = L_PUTITLELINK_TEXT
|
||||
this.PrepareHTML = _CLinkPopupRenderer_PrepareHTML
|
||||
this.szHTML = this.PrepareHTML()
|
||||
break
|
||||
case "Table":
|
||||
this.szCaption = L_PUTITLENEWTABLE_TEXT
|
||||
this.PrepareHTML = _CTablePopupRenderer_PrepareHTML
|
||||
this.szHTML = this.PrepareHTML()
|
||||
break
|
||||
case "Image":
|
||||
this.szCaption = L_PUTITLEIMAGE_TEXT
|
||||
this.PrepareHTML = _CImagePopupRenderer_PrepareHTML
|
||||
this.szHTML = this.PrepareHTML()
|
||||
this.autoSize = false
|
||||
break
|
||||
case "BackColor":
|
||||
this.szCaption = L_PUTITLEBGCOLOR_TEXT
|
||||
this.szHTML = "<DIV ID=ColorPopup ALIGN=CENTER>" + _CUtil_BuildColorTable("") + "</DIV>"
|
||||
break
|
||||
case "ForeColor":
|
||||
this.szCaption = L_PUTITLETEXTCOLOR_TEXT
|
||||
this.szHTML = "<DIV ID=ColorPopup ALIGN=CENTER>" + _CUtil_BuildColorTable("") + "</DIV>"
|
||||
break
|
||||
default:
|
||||
this.szCaption = ""
|
||||
break
|
||||
}
|
||||
}
|
||||
function _CPopupRenderer_ResetContext(oDoc)
|
||||
{
|
||||
this.oDocument = oDoc
|
||||
this.elCurrent = null
|
||||
if (this.szType=="Table") {
|
||||
var oSel = idEditbox.document.selection.createRange()
|
||||
var oBlock = (oSel.parentElement != null ? _CUtil_GetElement(oSel.parentElement(),"TABLE") : _CUtil_GetElement(oSel.item(0),"TABLE"))
|
||||
if (oBlock!=null) {
|
||||
oDoc.all.tabEdit.className=""
|
||||
oDoc.all.tabEditBodytxtPadding.value = oBlock.cellPadding
|
||||
oDoc.all.tabEditBodytxtSpacing.value = oBlock.cellSpacing
|
||||
oDoc.all.tabEditBodytxtBorder.value = oBlock.border
|
||||
oDoc.all.tabEditBodytxtBorderColor.value = oBlock.borderColor
|
||||
oDoc.all.tabEditBodytxtBackgroundImage.value = oBlock.background
|
||||
oDoc.all.tabEditBodytxtBackgroundColor.value = oBlock.bgColor
|
||||
}
|
||||
oDoc.elCurrent = oBlock
|
||||
}
|
||||
}
|
||||
function _CPopupRenderer_GetCaption()
|
||||
{
|
||||
return this.szCaption
|
||||
}
|
||||
function _CPopupRenderer_GetHTML()
|
||||
{
|
||||
return this.szHTML
|
||||
}
|
||||
function _CFontSizesPopupRenderer_PrepareHTML()
|
||||
{
|
||||
var sz = "<TABLE ALIGN=center ID=idList CELLSPACING=0 CELLPADDING=0>"
|
||||
for (var i=1; i <= 7; i++)
|
||||
{
|
||||
sz += ""
|
||||
+ "<TR>"
|
||||
+ "<TD NOWRAP "
|
||||
+ "_item=" + i + " "
|
||||
+ "ALIGN=center "
|
||||
+ "STYLE=\"margin:0pt;padding:0pt\""
|
||||
+ ">"
|
||||
+ "<FONT SIZE=" + i + ">"
|
||||
+ L_STYLESAMPLE_TEXT
|
||||
+ "</FONT>"
|
||||
+ "</TD>"
|
||||
+ "</TR>"
|
||||
}
|
||||
sz += "</TABLE>"
|
||||
return sz
|
||||
}
|
||||
function _CFontFacesPopupRenderer_PrepareHTML()
|
||||
{
|
||||
var sz = "<TABLE ALIGN=center ID=idList CELLSPACING=0 CELLPADDING=0>"
|
||||
for (var i=0; i < defaultFonts.length; i++)
|
||||
{
|
||||
sz += ""
|
||||
+ "<TR>"
|
||||
+ "<TD NOWRAP "
|
||||
+ "_item=" + i + " "
|
||||
+ "ALIGN=center "
|
||||
+ "STYLE=\"margin:0pt;padding:0pt\""
|
||||
+ ">"
|
||||
+ "<FONT FACE=\"" + defaultFonts[i][0] + "\">"
|
||||
+ defaultFonts[i][1]
|
||||
+ "</FONT>"
|
||||
+ (defaultFonts[i][2] ? ("(" + defaultFonts[i][1] + ")") : "")
|
||||
+ "</TD>"
|
||||
+ "</TR>"
|
||||
}
|
||||
// sz += "<TR><TD ONCLICK=\"parent._CFontFacesPopupRenderer_InsertOther(this)\" ALIGN=center _item=\"custom\" STYLE=\"margin:0pt;padding:0pt\" NOWRAP><FONT ID=customFont>" + L_CUSTOMFONT_TEXT + "</FONT></TR>"
|
||||
sz += "</TABLE>"
|
||||
return sz
|
||||
}
|
||||
function _CFontFacesPopupRenderer_InsertOther(el) {
|
||||
if (el._item=="custom") {
|
||||
el._item = "input"
|
||||
var sz = "<INPUT ONSELECTSTART=\"event.cancelBubble=true\" ONKEYDOWN=\"event.cancelBubble=true\" ONKEYPRESS=\"if (event.keyCode==13) {this.face=this.value;document._renderer.Select(this.parentElement)};event.cancelBubble=true\" VALUE=\"" + L_CUSTOMFONTENTRY_TEXT + "\" ONFOCUS=\"if (this.value==this.defaultValue) this.select()\" TYPE=text>"
|
||||
el.innerHTML = sz
|
||||
el.children[0].focus()
|
||||
}
|
||||
el.document.parentWindow.event.cancelBubble = true
|
||||
}
|
||||
function _CFormatBlockPopupRenderer_PrepareHTML()
|
||||
{
|
||||
var sz, defaultParagraphs = new Array()
|
||||
defaultParagraphs[0] = new Array("<P>", L_STYLENORMAL_TEXT)
|
||||
defaultParagraphs[1] = new Array("<PRE>", L_STYLEFORMATTED_TEXT)
|
||||
for (var i=2; i <= 7; i++)
|
||||
defaultParagraphs[i] = new Array("<H"+(i-1)+">", L_STYLEHEADING_TEXT + (i-1))
|
||||
sz = "<TABLE CLASS=block ALIGN=center ID=idList CELLSPACING=0 CELLPADDING=0>"
|
||||
for (var i=0; i < defaultParagraphs.length; i++)
|
||||
{
|
||||
sz += ""
|
||||
+ "<TR>"
|
||||
+ "<TD NOWRAP "
|
||||
+ "_item=" + i + " "
|
||||
+ "ALIGN=center "
|
||||
+ "STYLE=\"margin:0pt;padding:0pt\""
|
||||
+ ">"
|
||||
+ defaultParagraphs[i][0]
|
||||
+ defaultParagraphs[i][1]
|
||||
+ "</" + defaultParagraphs[i][0].substring(1)
|
||||
+ "</TD>"
|
||||
+ "</TR>"
|
||||
}
|
||||
sz += "</TABLE>"
|
||||
return sz
|
||||
}
|
||||
function _CTablePopupRenderer_PrepareHTMLPage(szID,bDisplay) {
|
||||
var sz=""
|
||||
+ "<TABLE height=100% " + ((!bDisplay) ? " style=\"display: none\"" : "") + " width=100% CELLSPACING=0 CELLPADDING=0 ID=" + szID + ">"
|
||||
+ "<TR ID=tableContents>"
|
||||
+ "<TD ID=tableOptions VALIGN=TOP NOWRAP WIDTH=150 ROWSPAN=2>"
|
||||
+ "<A HREF=\"javascript:parent._CTablePopupRenderer_Select(this,'" + szID + "','prop1')\">"
|
||||
+ L_TABLEROWSANDCOLS_TEXT
|
||||
+ "</A>"
|
||||
+ "<BR>"
|
||||
+ "<A HREF=\"javascript:parent._CTablePopupRenderer_Select(this,'" + szID + "','prop2')\">"
|
||||
+ L_TABLEPADDINGANDSPACING_TEXT
|
||||
+ "</A>"
|
||||
+ "<BR>"
|
||||
+ "<A HREF=\"javascript:parent._CTablePopupRenderer_Select(this,'" + szID + "','prop3')\">"
|
||||
+ L_TABLEBORDERS_TEXT
|
||||
+ "</A>"
|
||||
+ "<BR>"
|
||||
+ "<A HREF=\"javascript:parent._CTablePopupRenderer_Select(this,'" + szID + "','prop4')\">"
|
||||
+ L_TABLEBG_TEXT
|
||||
+ "</A>"
|
||||
+ "<BR>"
|
||||
+ "</TD>"
|
||||
+ "<TD BGCOLOR=black ID=puDivider ROWSPAN=2>"
|
||||
+ "</TD>"
|
||||
+ "<TD ID=tableProps VALIGN=TOP>"
|
||||
if (szID=="tabNewBody") {
|
||||
sz+= "<DIV ID='" + szID + "prop1'>"
|
||||
+ "<P CLASS=tablePropsTitle>" + L_TABLEROWSANDCOLS_TEXT + "</P>"
|
||||
+ "<TABLE><TR><TD>"
|
||||
+ L_TABLEINPUTROWS_TEXT
|
||||
+ "</TD><TD><INPUT SIZE=2 TYPE=text ID=" + szID + "txtRows VALUE=2 >"
|
||||
+ "</TD></TR><TR><TD>"
|
||||
+ L_TABLEINPUTCOLUMNS_TEXT
|
||||
+ "</TD><TD><INPUT SIZE=2 TYPE=text ID=" + szID + "txtColumns VALUE=2 >"
|
||||
+ "</TD></TR></TABLE></DIV>"
|
||||
}
|
||||
else {
|
||||
sz+= "<DIV ID='" + szID + "prop1'>"
|
||||
+ "<P CLASS=tablePropsTitle>" + L_TABLEROWSANDCOLS_TEXT + "</P>"
|
||||
+ "<INPUT type=button ID=" + szID + "txtRows VALUE=\"" + L_TABLEINSERTROW_TEXT + "\" ONCLICK=\"parent._CTablePopupRenderer_AddRow(this)\"><P>"
|
||||
+ "<INPUT type=button ID=" + szID + "txtCells VALUE=\"" + L_TABLEINSERTCELL_TEXT + "\" ONCLICK=\"parent._CTablePopupRenderer_AddCell(this)\"><BR>"
|
||||
+ "</DIV>"
|
||||
}
|
||||
sz += "<DIV ID='" + szID + "prop2' STYLE=\"display: none\">"
|
||||
+ "<P CLASS=tablePropsTitle>" + L_TABLEPADDINGANDSPACING_TEXT + "</P>"
|
||||
+ L_TABLEINPUTCELLPADDING_TEXT
|
||||
+ "<INPUT SIZE=2 TYPE=text ID=" + szID + "txtPadding VALUE=0>"
|
||||
+ "<BR>"
|
||||
+ L_TABLEINPUTCELLSPACING_TEXT
|
||||
+ "<INPUT SIZE=2 TYPE=text ID=" + szID + "txtSpacing VALUE=0>"
|
||||
+ "</DIV>"
|
||||
+ "<DIV ID=" + szID + "prop3 STYLE=\"display: none\">"
|
||||
+ "<P CLASS=tablePropsTitle>" + L_TABLEBORDERS_TEXT + "</P>"
|
||||
+ L_TABLEINPUTBORDER_TEXT
|
||||
+ "<INPUT SIZE=2 TYPE=text ID=" + szID + "txtBorder VALUE=1>"
|
||||
+ "<BR>"
|
||||
+ L_TABLEINPUTBORDERCOLOR_TEXT
|
||||
+ "<INPUT SIZE=4 TYPE=text ID=" + szID + "txtBorderColor value=#000000><BR>"
|
||||
+ _CUtil_BuildColorTable("idBorder"+szID, "", "parent._CTablePopupRenderer_ColorSelect(this,'" + szID + "txtBorderColor')")
|
||||
+ "</DIV>"
|
||||
+ "<DIV ID=" + szID + "prop4 SIZE=12 STYLE=\"display: none\">"
|
||||
+ "<P CLASS=tablePropsTitle>" + L_TABLEBG_TEXT + "</P>"
|
||||
+ L_TABLEINPUTBGIMGURL_TEXT
|
||||
+ "<INPUT TYPE=text ID=" + szID + "txtBackgroundImage SIZE=15>"
|
||||
+ "<BR>"
|
||||
+ L_TABLEINPUTBGCOLOR_TEXT
|
||||
+ "<INPUT TYPE=text SIZE=4 ID=" + szID + "txtBackgroundColor><BR>"
|
||||
+ _CUtil_BuildColorTable("idBackground"+szID, "", "parent._CTablePopupRenderer_ColorSelect(this,'" + szID + "txtBackgroundColor')")
|
||||
+ "</DIV>"
|
||||
+ "</TD>"
|
||||
+ "</TR><TR><TD align=center ID=tableButtons valign=bottom>"
|
||||
if (szID=="tabNewBody") {
|
||||
sz += "<INPUT TYPE=submit ONCLICK=\"parent._CTablePopupRenderer_BuildTable('" + szID + "',this.document)\" VALUE=\"" + L_TABLEINSERT_TEXT + "\">"
|
||||
+ " <INPUT TYPE=reset VALUE=\"" + L_CANCEL_TEXT + "\" ONCLICK=\"parent._CPopup_Hide()\">"
|
||||
} else {
|
||||
sz += "<INPUT TYPE=submit ONCLICK=\"parent._CTablePopupRenderer_BuildTable('" + szID + "',this.document)\" VALUE=\"" + L_TABLEUPDATE_TEXT + "\">"
|
||||
+ " <INPUT TYPE=reset VALUE=\"" + L_CANCEL_TEXT + "\" ONCLICK=\"parent._CPopup_Hide()\">"
|
||||
}
|
||||
sz+= "</TD></TR></TABLE>"
|
||||
return sz
|
||||
}
|
||||
function _CTablePopupRenderer_PrepareHTML()
|
||||
{
|
||||
var sz = "<TABLE CLASS=tabBox ID=\"tabSelect\" CELLSPACING=0 CELLPADDING=0 WIDTH=95%><TR HEIGHT=15><TD CLASS=tabItem STYLE=\"border-bottom: none\" NOWRAP><DIV ONCLICK=\"if (tabEdit.className!='disabled') {this.className='selected';this.parentElement.style.borderBottom = tabEdit.className=tabNewBody.style.display='';tabEditBody.style.display='none';tabEdit.parentElement.style.borderBottom='1px black solid'}\" CLASS=selected ID=tabNew>New Table</DIV></TD>"
|
||||
+ "<TD CLASS=tabItem NOWRAP><DIV ONCLICK=\"if (this.className!='disabled') {this.className='selected';this.parentElement.style.borderBottom = tabNew.className=tabEditBody.style.display='';tabNew.parentElement.style.borderBottom='1px black solid';tabNewBody.style.display='none'}\" CLASS=disabled ID=tabEdit>Edit Table</DIV></TD><TD CLASS=tabSpace WIDTH=100%> </TD></TR><TR><TD VALIGN=TOP CLASS=tabBody COLSPAN=3>"
|
||||
+ _CTablePopupRenderer_PrepareHTMLPage("tabNewBody",true)
|
||||
+ _CTablePopupRenderer_PrepareHTMLPage("tabEditBody",false)
|
||||
+ "</TD></TR></TABLE>"
|
||||
return sz
|
||||
}
|
||||
function _CTablePopupRenderer_Select(el,szID, id)
|
||||
{
|
||||
var d = el.document
|
||||
for (var i = 1; i < 5; i++)
|
||||
d.all[szID + "prop" + i].style.display = "none"
|
||||
d.all[szID + id].style.display = ""
|
||||
}
|
||||
function _CTablePopupRenderer_ColorSelect(el,id)
|
||||
{
|
||||
el.document.all[id].value = el.bgColor
|
||||
}
|
||||
function _CTablePopupRenderer_AddRow(el) {
|
||||
var elRow = el.document.elCurrent.insertRow()
|
||||
for (var i=0;i<el.document.elCurrent.rows[0].cells.length;i++) {
|
||||
var elCell = elRow.insertCell()
|
||||
elCell.innerHTML = " "
|
||||
}
|
||||
}
|
||||
function _CTablePopupRenderer_AddCell(el) {
|
||||
for (var i=0;i<el.document.elCurrent.rows.length;i++) {
|
||||
var elCell = el.document.elCurrent.rows[i].insertCell()
|
||||
elCell.innerHTML = " "
|
||||
}
|
||||
}
|
||||
function _CTablePopupRenderer_BuildTable(szID, d)
|
||||
{
|
||||
if (szID=="tabNewBody") {
|
||||
var sz = ""
|
||||
+ "<TABLE "
|
||||
+ (((d.all[szID + "txtBorder"].value=="") || (d.all[szID + "txtBorder"].value=="0")) ? "class=\"NOBORDER\"" : "")
|
||||
+ (d.all[szID + "txtPadding"].value != "" ? "cellPadding=\"" + d.all[szID + "txtPadding"].value + "\" " : "")
|
||||
+ (d.all[szID + "txtSpacing"].value != "" ? "cellSpacing=\"" + d.all[szID + "txtSpacing"].value + "\" " : "")
|
||||
+ (d.all[szID + "txtBorder"].value != "" ? "border=\"" + d.all[szID + "txtBorder"].value + "\" " : "")
|
||||
+ (d.all[szID + "txtBorderColor"].value != "" ? "bordercolor=\"" + d.all[szID + "txtBorderColor"].value + "\" " : "")
|
||||
+ (d.all[szID + "txtBackgroundImage"].value != "" ? "background=\"" + d.all[szID + "txtBackgroundImage"].value + "\" " : "")
|
||||
+ (d.all[szID + "txtBackgroundColor"].value != "" ? "bgColor=\"" + d.all[szID + "txtBackgroundColor"].value + "\" " : "")
|
||||
+ ">"
|
||||
for (var r=0; r < d.all[szID + "txtRows"].value; r++)
|
||||
{
|
||||
sz += "<TR>"
|
||||
for (var c=0; c < d.all[szID + "txtColumns"].value; c++)
|
||||
sz += "<TD> </TD>"
|
||||
sz += "</TR>"
|
||||
}
|
||||
sz += "</TABLE>"
|
||||
insertHTML(sz)
|
||||
} else
|
||||
if (d.elCurrent) {
|
||||
d.elCurrent.cellPadding = d.all.tabEditBodytxtPadding.value
|
||||
d.elCurrent.cellSpacing = d.all.tabEditBodytxtSpacing.value
|
||||
d.elCurrent.border = d.all.tabEditBodytxtBorder.value
|
||||
d.elCurrent.className = (d.elCurrent.border=="" || d.elCurrent.border==0) ? "NOBORDER" : ""
|
||||
d.elCurrent.borderColor = d.all.tabEditBodytxtBorderColor.value
|
||||
d.elCurrent.bgColor = d.all.tabEditBodytxtBackgroundColor.value
|
||||
d.elCurrent.background = d.all.tabEditBodytxtBackgroundImage.value
|
||||
}
|
||||
_CPopup_Hide()
|
||||
}
|
||||
function _CListPopupRenderer_OnClick()
|
||||
{
|
||||
var elTD = _CUtil_GetElement(this.oDocument.parentWindow.event.srcElement, "TD")
|
||||
if (elTD && elTD._item) this.Select(elTD)
|
||||
}
|
||||
function _CListPopupRenderer_GenericOnKeyDown() {
|
||||
var ev = this.oDocument.parentWindow.event
|
||||
if (ev.keyCode==27) _CPopup_Hide()
|
||||
}
|
||||
function _CListPopupRenderer_OnKeyDown()
|
||||
{
|
||||
var el
|
||||
var iRow = iCell = 0
|
||||
var ev = this.oDocument.parentWindow.event
|
||||
var idList = this.oDocument.all.idList
|
||||
var elTR = _CUtil_GetElement(this.elCurrent,"TR")
|
||||
var elTD = _CUtil_GetElement(this.elCurrent,"TD")
|
||||
if (elTR != null)
|
||||
{
|
||||
iRow = elTR.rowIndex
|
||||
iCell = elTD.cellIndex
|
||||
}
|
||||
switch (ev.keyCode)
|
||||
{
|
||||
case 37:
|
||||
iCell--
|
||||
if (iCell < 0)
|
||||
iCell = idList.rows[iRow].cells.length-1
|
||||
break
|
||||
case 38:
|
||||
iRow--
|
||||
if (iRow < 0)
|
||||
iRow = idList.rows.length-1
|
||||
break
|
||||
case 39:
|
||||
iCell++
|
||||
if (iCell > idList.rows[iRow].cells.length-1)
|
||||
iCell = 0
|
||||
break
|
||||
case 40:
|
||||
iRow++
|
||||
if (iRow > idList.rows.length-1)
|
||||
iRow = 0
|
||||
break
|
||||
case 13:
|
||||
break;
|
||||
case 27:
|
||||
_CPopup_Hide()
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
el = idList.rows[iRow].cells[iCell]
|
||||
if (el && el._item)
|
||||
if (13 == ev.keyCode) {
|
||||
ev.keyCode=0
|
||||
this.Select(el)
|
||||
}
|
||||
else
|
||||
this.Highlight(el)
|
||||
}
|
||||
function _CListPopupRenderer_OnMouseOver()
|
||||
{
|
||||
var el = _CUtil_GetElement(this.oDocument.parentWindow.event.srcElement, "TD")
|
||||
if (el && el._item && el != this.elCurrent)
|
||||
this.Highlight(el)
|
||||
}
|
||||
function _CListPopupRenderer_Highlight(el)
|
||||
{
|
||||
var elC = this.elCurrent
|
||||
if (elC) elC.style.borderWidth = elC.style.borderColor = elC.style.borderStyle = ""
|
||||
el.style.borderWidth = "1px"
|
||||
el.style.borderColor = "green"
|
||||
el.style.borderStyle = "solid"
|
||||
this.elCurrent = el
|
||||
}
|
||||
function _CListPopupRenderer_Select(elTD)
|
||||
{
|
||||
g_state.RestoreSelection()
|
||||
var el = elTD.children[0]
|
||||
switch (this.szType)
|
||||
{
|
||||
case "font":
|
||||
_Format("FontName",el.face)
|
||||
break
|
||||
case "fontsize":
|
||||
_Format("FontSize",el.size)
|
||||
break
|
||||
case "formatblock":
|
||||
_Format("FormatBlock","<" + el.tagName + ">")
|
||||
break
|
||||
case "ForeColor":
|
||||
_Format("ForeColor", elTD.bgColor)
|
||||
break
|
||||
case "BackColor":
|
||||
_Format("BackColor",elTD.bgColor)
|
||||
break
|
||||
}
|
||||
_CPopup_Hide()
|
||||
}
|
||||
function _CLinkPopupRenderer_AddLink(d)
|
||||
{
|
||||
var szURL = d.all.urlValue.value
|
||||
var szType = d.all.urlType[d.all.urlType.selectedIndex].text
|
||||
var oSel = g_state.GetSelection()
|
||||
var sType = oSel.type
|
||||
szURL = ((0 == szURL.indexOf("mailto:") || 0 == szURL.indexOf("http://") || 0 == szURL.indexOf("ftp://")) ? "" : szType) + szURL
|
||||
if (szURL!="")
|
||||
{
|
||||
if ((oSel.parentElement) && (oSel.text==""))
|
||||
{
|
||||
oSel.expand("word")
|
||||
if (oSel.text=="")
|
||||
{
|
||||
var oStore = oSel.duplicate()
|
||||
if (d.all.pageList) {
|
||||
var idx = d.all.pageList.selectedIndex
|
||||
if (d.all.pageList[idx].value==szURL)
|
||||
oSel.text = d.all.pageList[idx].text
|
||||
else
|
||||
oSel.text = szURL
|
||||
}
|
||||
else
|
||||
oSel.text = szURL
|
||||
oSel.setEndPoint("StartToStart",oStore)
|
||||
}
|
||||
oSel.select()
|
||||
sType="Text"
|
||||
}
|
||||
if ((oSel.item) && (oSel.item(0).tagName=="IMG"))
|
||||
{
|
||||
oSel.item(0).width = oSel.item(0).offsetWidth
|
||||
oSel.item(0).height = oSel.item(0).offsetHeight
|
||||
oSel.item(0).border = (d.all.displayBorder.checked) ? 1 : ""
|
||||
}
|
||||
if (d.all.urlValue.value!="")
|
||||
oSel.execCommand("CreateLink",false,szURL)
|
||||
else
|
||||
oSel.execCommand("UnLink",false,szURL)
|
||||
}
|
||||
idEditbox.focus()
|
||||
}
|
||||
function _CLinkPopupRenderer__UpdateURL(oDoc,szURL) {
|
||||
var szType = szURL.substring(0,szURL.indexOf(":"))
|
||||
for (var i=0;i<oDoc.all.urlType.length;i++)
|
||||
if (oDoc.all.urlType[i].value==szType)
|
||||
oDoc.all.urlType.selectedIndex = i
|
||||
if (("http"==szType) || ("ftp"==szType))
|
||||
szURL = szURL.substring(szURL.indexOf("//")+2)
|
||||
else
|
||||
szURL = szURL.substring(szURL.indexOf(":")+1)
|
||||
oDoc.all.urlValue.value = szURL
|
||||
}
|
||||
function _CLinkPopupRenderer_PrepareHTML()
|
||||
{
|
||||
var d = this.oDocument
|
||||
var oSel = g_state.GetSelection()
|
||||
var oEl, sType = oSel.type, bImg = false, szURL = sz = ""
|
||||
if (oSel.parentElement)
|
||||
{
|
||||
oEl = _CUtil_GetElement(oSel.parentElement(),"A")
|
||||
}
|
||||
else
|
||||
{
|
||||
oEl = _CUtil_GetElement(oSel.item(0),"A")
|
||||
bImg = oSel.item(0).tagName=="IMG"
|
||||
}
|
||||
if (oEl)
|
||||
szURL = oEl.href
|
||||
sz ="<TABLE ALIGN=center>"
|
||||
if (g_state.aLinks.length>0)
|
||||
{
|
||||
sz += ""
|
||||
+ "<TR>"
|
||||
+ "<TD>"
|
||||
+ L_LINKSELECT_TEXT
|
||||
+ "<SELECT ID=pageList ONCHANGE=\"parent._CLinkPopupRenderer__UpdateURL(this.document,this[this.selectedIndex].value)\">"
|
||||
+ "<OPTION VALUE=''>"
|
||||
+ "=="
|
||||
+ L_LINKSELECTPAGE_TEXT
|
||||
+ "=="
|
||||
+ "</OPTION>"
|
||||
for (var i = 0; i < g_state.aLinks.length; i++)
|
||||
{
|
||||
sz += ""
|
||||
+ "<OPTION VALUE=\"" + g_state.aLinks[i][0] + "\" "
|
||||
+ (oEl && (g_state.aLinks[i][0]==oEl.href) ? "SELECTED" : "")
|
||||
+ ">"
|
||||
+ g_state.aLinks[i][1]
|
||||
+ "</OPTION>"
|
||||
}
|
||||
sz += "</SELECT>"
|
||||
}
|
||||
var arTypes = new Array("http","ftp","mailto")
|
||||
var arText = new Array("http://","ftp://","mailto:")
|
||||
var szType = szURL.substring(0,szURL.indexOf(":"))
|
||||
if (("http"==szType) || ("ftp"==szType))
|
||||
szURL = szURL.substring(szURL.indexOf("//")+2)
|
||||
else
|
||||
szURL = szURL.substring(szURL.indexOf(":")+1)
|
||||
sz += ""
|
||||
+ "<BR>"
|
||||
+ L_LINKWEB_TEXT
|
||||
+ "<NOBR><SELECT ID=urlType>"
|
||||
for (var i=0;i<arTypes.length;i++) {
|
||||
sz+= "<OPTION VALUE='" + arTypes[i] + "' "
|
||||
+ (arTypes[i]==szType ? " SELECTED " : "")
|
||||
+ ">" + arText[i]
|
||||
}
|
||||
sz += "</SELECT><INPUT ID=urlValue SIZE=45 VALUE=\"" + szURL + "\" TYPE=text></NOBR>"
|
||||
if (bImg)
|
||||
{
|
||||
sz += ""
|
||||
+ "<BR>"
|
||||
+ "<INPUT TYPE=checkbox ID=displayBorder " + ((oSel.item(0).border!=0) ? " checked " : "") + ">"
|
||||
+ L_LINKIMGBORDER_TEXT
|
||||
}
|
||||
sz += ""
|
||||
+ "</TD>"
|
||||
+ "</TR>"
|
||||
+ "<TR>"
|
||||
+ "<TD ALIGN=center>"
|
||||
+ "<INPUT ONCLICK=\"parent._CLinkPopupRenderer_AddLink(this.document)\" TYPE=submit ID=idSave VALUE=\"" + L_INSERT_TEXT + "\"> <INPUT ONCLICK=\"parent._CPopup_Hide()\" TYPE=reset ID=idCancel VALUE=\"" + L_CANCEL_TEXT + "\">"
|
||||
+ "</TD>"
|
||||
+ "</TR>"
|
||||
+ "</TABLE>"
|
||||
return sz
|
||||
}
|
||||
// UTIL
|
||||
function _CUtil_GetElement(oEl,sTag)
|
||||
{
|
||||
while (oEl!=null && oEl.tagName!=sTag)
|
||||
oEl = oEl.parentElement
|
||||
return oEl
|
||||
}
|
||||
function _CUtil_BuildColorTable(sID,fmt,szClick)
|
||||
{
|
||||
var sz, cPick = new Array("00","33","66","99","CC","FF"), iCnt=2
|
||||
var iColors = cPick.length, szColor = ""
|
||||
sz = "<TABLE CELLSPACING=0 CELLPADDING=0><TR><TD VALIGN=middle><DIV CLASS=currentColor ID=\"" + sID + "Current\"> </DIV></TD><TD>"
|
||||
+ "<TABLE ONMOUSEOUT=\"document.all." + sID + "Current.style.backgroundColor = ''\" ONMOUSEOVER=\"document.all." + sID + "Current.style.backgroundColor = event.srcElement.bgColor\" CLASS=colorTable CELLSPACING=0 CELLPADDING=0 ID=\"" + sID + "\">"
|
||||
for (var r=0;r<iColors;r++) {
|
||||
sz+="<TR>"
|
||||
for (var g=iColors-1;g>=0;g--)
|
||||
for (var b=iColors-1;b>=0;b--) {
|
||||
szColor = cPick[r]+cPick[g]+cPick[b]
|
||||
sz+="<TD"
|
||||
+ " BGCOLOR=\"#" + szColor + "\""
|
||||
+ "_item=\"" + szColor + "\" "
|
||||
+ "TITLE=\"#" + szColor + "\" "
|
||||
+ (szClick ? "ONCLICK=\"" + szClick + "\" " : "")
|
||||
+ "> </TD>"
|
||||
}
|
||||
sz+="</TR>"
|
||||
}
|
||||
sz+="</TABLE></TD></TR></TABLE>"
|
||||
return sz
|
||||
}
|
||||
function _CUtil_GetBlock(oEl)
|
||||
{
|
||||
var sBlocks = "|H1|H2|H3|H4|H5|H6|P|PRE|LI|TD|DIV|BLOCKQUOTE|DT|DD|TABLE|HR|IMG|"
|
||||
while ((oEl!=null) && (sBlocks.indexOf("|"+oEl.tagName+"|")==-1))
|
||||
oEl = oEl.parentElement
|
||||
return oEl
|
||||
}
|
||||
109
extras/nonIeEdit.html
Normal file
109
extras/nonIeEdit.html
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Edit Window</title>
|
||||
<script language="JavaScript">
|
||||
/*
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# 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
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
*/
|
||||
|
||||
var color;
|
||||
var formObj;
|
||||
|
||||
function boldText(obj) {
|
||||
obj.value = obj.value+'<b>'+prompt("Enter the text to bold:", "")+'</b>';
|
||||
}
|
||||
|
||||
function centerText(obj) {
|
||||
obj.value = obj.value+'<div align="center">'+prompt("Enter the text to center:", "")+'</div>';
|
||||
}
|
||||
|
||||
function colorText(obj) {
|
||||
formObj = obj;
|
||||
window.alert(window.opener.extrasDir);
|
||||
window.open(window.opener.extrasDir+"/colorPicker.html","colorPicker","width=438,height=258");
|
||||
}
|
||||
|
||||
function copyright(obj) {
|
||||
obj.value = obj.value+'©';
|
||||
}
|
||||
|
||||
function email(obj) {
|
||||
var email = prompt("Enter the Email address:", "");
|
||||
obj.value = obj.value+'<a href="mailto:'+email+'">'+email+'</a>';
|
||||
}
|
||||
|
||||
function getShowMeText() {
|
||||
return formObj.value;
|
||||
}
|
||||
|
||||
function imageAdd(obj) {
|
||||
obj.value = obj.value+'<img src="'+prompt("Enter the image URL:", "http://somesite.com/image.jpg")+'" border="0">';
|
||||
}
|
||||
|
||||
function italicText(obj) {
|
||||
obj.value = obj.value+'<i>'+prompt("Enter the text to italicize:", "")+'</i>';
|
||||
}
|
||||
|
||||
function list(obj) {
|
||||
var item;
|
||||
obj.value = obj.value+'<ul>';
|
||||
obj.value = obj.value+'<li>'+prompt("Enter the first item in the list:", "");
|
||||
while (item = prompt("Enter the next item in the list (cancel when done):", "")) {
|
||||
obj.value = obj.value+'<li>'+item;
|
||||
}
|
||||
obj.value = obj.value+'</ul>';
|
||||
}
|
||||
|
||||
function registered(obj) {
|
||||
obj.value = obj.value+'®';
|
||||
}
|
||||
|
||||
function setColor(remoteColor) {
|
||||
formObj.value = formObj.value+'<span style="color: #'+remoteColor+';">'+prompt("Enter the text to color:","")+'</span>';
|
||||
}
|
||||
|
||||
function showMe(obj) {
|
||||
formObj = obj;
|
||||
window.open(window.opener.extrasDir+"/viewer.html","showMeViewer","width=500,height=300,scrollbars=1");
|
||||
}
|
||||
|
||||
function trademark(obj) {
|
||||
obj.value = obj.value+'<font size="-2"><sup>TM</sup></font>';
|
||||
}
|
||||
|
||||
function url(obj) {
|
||||
obj.value = obj.value+'<a href="'+prompt("Enter the URL of the link:", "http://www.google.com")+'">'+prompt("Enter the title of the link:", "Google")+'</a>';
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onLoad="edit.editor.value=window.opener.formObj.value">
|
||||
<form name="edit">
|
||||
<input type="button" onClick="colorText(this.form.editor)" value="color" style="font-size: 8pt;">
|
||||
<input type="button" onClick="boldText(this.form.editor)" value="bold" style="font-size: 8pt;">
|
||||
<input type="button" onClick="italicText(this.form.editor)" value="italics" style="font-size: 8pt;">
|
||||
<input type="button" onClick="centerText(this.form.editor)" value="center" style="font-size: 8pt;">
|
||||
<input type="button" onClick="list(this.form.editor)" value="list" style="font-size: 8pt;">
|
||||
<input type="button" onClick="url(this.form.editor)" value="link" style="font-size: 8pt;">
|
||||
<input type="button" onClick="email(this.form.editor)" value="email" style="font-size: 8pt;">
|
||||
<input type="button" onClick="imageAdd(this.form.editor)" value="image" style="font-size: 8pt;">
|
||||
<input type="button" onClick="copyright(this.form.editor)" value="(C)" style="font-size: 8pt;">
|
||||
<input type="button" onClick="registered(this.form.editor)" value="(R)" style="font-size: 8pt;">
|
||||
<input type="button" onClick="trademark(this.form.editor)" value="TM" style="font-size: 8pt;">
|
||||
<br>
|
||||
<textarea name="editor" rows=10 cols=50></textarea>
|
||||
<br>
|
||||
<input type="button" onClick="showMe(this.form.editor)" value="show me" style="font-size: 8pt;">
|
||||
<input type="button" onClick="window.blur(); window.opener.focus();window.opener.setContent(this.form.editor.value);window.close();" value="done" style="font-size: 8pt;">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
82
extras/nonIeEdit.js
Normal file
82
extras/nonIeEdit.js
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# 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
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
*/
|
||||
|
||||
var color;
|
||||
var formObj;
|
||||
|
||||
function boldText(obj) {
|
||||
obj.value = obj.value+'<b>'+prompt("Enter the text to bold:", "")+'</b>';
|
||||
}
|
||||
|
||||
function centerText(obj) {
|
||||
obj.value = obj.value+'<div align="center">'+prompt("Enter the text to center:", "")+'</div>';
|
||||
}
|
||||
|
||||
function colorText(obj) {
|
||||
formObj = obj;
|
||||
window.open("/extras/colorPicker.html","colorPicker","width=438,height=258");
|
||||
}
|
||||
|
||||
function copyright(obj) {
|
||||
obj.value = obj.value+'©';
|
||||
}
|
||||
|
||||
function email(obj) {
|
||||
var email = prompt("Enter the Email address:", "");
|
||||
obj.value = obj.value+'<a href="mailto:'+email+'">'+email+'</a>';
|
||||
}
|
||||
|
||||
function getShowMeText() {
|
||||
return formObj.value;
|
||||
}
|
||||
|
||||
function imageAdd(obj) {
|
||||
obj.value = obj.value+'<img src="'+prompt("Enter the image URL:", "http://somesite.com/image.jpg")+'" border="0">';
|
||||
}
|
||||
|
||||
function italicText(obj) {
|
||||
obj.value = obj.value+'<i>'+prompt("Enter the text to italicize:", "")+'</i>';
|
||||
}
|
||||
|
||||
function list(obj) {
|
||||
var item;
|
||||
obj.value = obj.value+'<ul>';
|
||||
obj.value = obj.value+'<li>'+prompt("Enter the first item in the list:", "");
|
||||
while (item = prompt("Enter the next item in the list (cancel when done):", "")) {
|
||||
obj.value = obj.value+'<li>'+item;
|
||||
}
|
||||
obj.value = obj.value+'</ul>';
|
||||
}
|
||||
|
||||
function registered(obj) {
|
||||
obj.value = obj.value+'®';
|
||||
}
|
||||
|
||||
function setColor(remoteColor) {
|
||||
formObj.value = formObj.value+'<span style="color: #'+remoteColor+';">'+prompt("Enter the text to color:","")+'</span>';
|
||||
}
|
||||
|
||||
function showMe(obj) {
|
||||
formObj = obj;
|
||||
window.open("/extras/viewer.html","showMeViewer","width=500,height=300,scrollbars=1");
|
||||
}
|
||||
|
||||
function trademark(obj) {
|
||||
obj.value = obj.value+'<font size="-2"><sup>TM</sup></font>';
|
||||
}
|
||||
|
||||
function url(obj) {
|
||||
obj.value = obj.value+'<a href="'+prompt("Enter the URL of the link:", "http://www.google.com")+'">'+prompt("Enter the title of the link:", "Google")+'</a>';
|
||||
}
|
||||
|
||||
BIN
extras/toolbar.gif
Normal file
BIN
extras/toolbar.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
|
|
@ -1,5 +1,5 @@
|
|||
package WebGUI;
|
||||
our $VERSION = "2.0.0";
|
||||
our $VERSION = "2.1.0";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -15,6 +15,7 @@ use strict qw(vars subs);
|
|||
use Tie::CPHash;
|
||||
use Tie::IxHash;
|
||||
use WebGUI::ErrorHandler;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Operation;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
|
|
@ -28,15 +29,16 @@ sub _displayAdminBar {
|
|||
tie %hash2, "Tie::IxHash";
|
||||
#--content adder
|
||||
@widgetArray = @_;
|
||||
$hash2{$session{page}{url}} = "Add content...";
|
||||
$hash2{$session{page}{url}.'?op=addPage'} = 'Page';
|
||||
$hash2{$session{page}{url}} = WebGUI::International::get(1);
|
||||
$hash2{$session{page}{url}.'?op=addPage'} = WebGUI::International::get(2);
|
||||
foreach $widget (@widgetArray) {
|
||||
$widgetName = "WebGUI::Widget::".$widget."::widgetName";
|
||||
$hash2{$session{page}{url}.'?func=add&widget='.$widget} = &$widgetName;
|
||||
}
|
||||
$contentSelect = WebGUI::Form::selectList("contentSelect",\%hash2,"","","","goContent()");
|
||||
#--clipboard paster
|
||||
%hash2 = ( $session{page}{url}=> "Paste from clipboard..." );
|
||||
%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});
|
||||
foreach $key (keys %hash) {
|
||||
$hash2{$session{page}{url}.'?op=pastePage&pageId='.$key} = $hash{$key};
|
||||
|
|
@ -50,20 +52,20 @@ sub _displayAdminBar {
|
|||
%hash = ();
|
||||
if (WebGUI::Privilege::isInGroup(3,$session{user}{userId})) {
|
||||
%hash = (
|
||||
$session{page}{url}.'?op=editSettings'=>'Edit Settings',
|
||||
$session{page}{url}.'?op=listGroups'=>'Manage Groups',
|
||||
$session{page}{url}.'?op=listStyles'=>'Manage Styles',
|
||||
$session{page}{url}.'?op=listUsers'=>'Manage Users',
|
||||
$session{env}{SCRIPT_NAME}.'/page_not_found'=>'View Page Not Found',
|
||||
$session{env}{SCRIPT_NAME}.'/clipboard'=>'View Clipboard',
|
||||
$session{env}{SCRIPT_NAME}.'/trash'=>'View Trash',
|
||||
$session{page}{url}.'?op=purgeTrash'=>'Empty Trash'
|
||||
$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)
|
||||
);
|
||||
}
|
||||
%hash = ( $session{page}{url}=>'Admin...',
|
||||
$session{page}{url}.'?op=switchOffAdmin'=>'Turn Admin Off',
|
||||
$session{page}{url}.'?op=viewHelpIndex'=>'View Help Index',
|
||||
$session{page}{url}.'?op=viewPendingSubmissions'=>'View Pending Submissions',
|
||||
%hash = ( $session{page}{url}=>WebGUI::International::get(82),
|
||||
$session{page}{url}.'?op=switchOffAdmin'=>WebGUI::International::get(12),
|
||||
$session{page}{url}.'?op=viewHelpIndex'=>WebGUI::International::get(13),
|
||||
$session{page}{url}.'?op=viewPendingSubmissions'=>WebGUI::International::get(14),
|
||||
%hash
|
||||
);
|
||||
$adminSelect = WebGUI::Form::selectList("adminSelect",\%hash,"","","","goAdmin()");
|
||||
|
|
@ -91,8 +93,13 @@ sub _displayAdminBar {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub _loadWidgets {
|
||||
my (@files, $file, $use, @widget, $i);
|
||||
opendir (DIR,$session{config}{webguiRoot}."/lib/WebGUI/Widget") or WebGUI::ErrorHandler::fatalError("Can't open widget directory!");
|
||||
my ($widgetDir, @files, $file, $use, @widget, $i);
|
||||
if ($^O =~ /Win/i) {
|
||||
$widgetDir = "\\lib\\WebGUI\\Widget";
|
||||
} else {
|
||||
$widgetDir = "/lib/WebGUI/Widget";
|
||||
}
|
||||
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/) {
|
||||
|
|
@ -146,7 +153,7 @@ sub page {
|
|||
}
|
||||
$sth->finish;
|
||||
} else {
|
||||
$content = ' <h1>Permission Denied!</h1> You do not have sufficient privileges to access this page. ';
|
||||
$content = WebGUI::Privilege::noAccess();
|
||||
}
|
||||
}
|
||||
if ($session{var}{adminOn}) {
|
||||
|
|
|
|||
|
|
@ -13,36 +13,47 @@ package WebGUI::DateTime;
|
|||
use Exporter;
|
||||
use strict;
|
||||
use Time::Local;
|
||||
use WebGUI::International;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&epochToHuman &epochToSet &humanToEpoch &setToEpoch);
|
||||
our %month = (
|
||||
1=> "January",
|
||||
2=> "February",
|
||||
3=> "March",
|
||||
4=> "April",
|
||||
5=> "May",
|
||||
6=> "June",
|
||||
7=> "July",
|
||||
8=> "August",
|
||||
9=> "September",
|
||||
10=> "October",
|
||||
11=> "November",
|
||||
12=> "December"
|
||||
);
|
||||
our %weekday = (
|
||||
1=> "Sunday",
|
||||
2=> "Monday",
|
||||
3=> "Tuesday",
|
||||
4=> "Wednesday",
|
||||
5=> "Thursday",
|
||||
6=> "Friday",
|
||||
7=> "Saturday"
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _getMonth {
|
||||
my %month = (
|
||||
1=> WebGUI::International::get(15),
|
||||
2=> WebGUI::International::get(16),
|
||||
3=> WebGUI::International::get(17),
|
||||
4=> WebGUI::International::get(18),
|
||||
5=> WebGUI::International::get(19),
|
||||
6=> WebGUI::International::get(20),
|
||||
7=> WebGUI::International::get(21),
|
||||
8=> WebGUI::International::get(22),
|
||||
9=> WebGUI::International::get(23),
|
||||
10=> WebGUI::International::get(24),
|
||||
11=> WebGUI::International::get(25),
|
||||
12=> WebGUI::International::get(26)
|
||||
);
|
||||
return %month;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _getWeekday {
|
||||
my %weekday = (
|
||||
1=> WebGUI::International::get(27),
|
||||
2=> WebGUI::International::get(28),
|
||||
3=> WebGUI::International::get(29),
|
||||
4=> WebGUI::International::get(30),
|
||||
5=> WebGUI::International::get(31),
|
||||
6=> WebGUI::International::get(32),
|
||||
7=> WebGUI::International::get(33)
|
||||
);
|
||||
return %weekday;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub epochToHuman {
|
||||
my ($hour12, $value, $output, @date);
|
||||
my ($hour12, $value, $output, @date, %weekday, %month);
|
||||
@date = localtime($_[0]);
|
||||
$date[4]++; # offset the months starting from 0
|
||||
$date[5] += 1900; # original value is Year-1900
|
||||
|
|
@ -58,12 +69,18 @@ sub epochToHuman {
|
|||
$value = sprintf("%02d",$date[4]);
|
||||
$output =~ s/\%m/$value/g;
|
||||
$output =~ s/\%M/$date[4]/g;
|
||||
$output =~ s/\%c/$month{$date[4]}/g;
|
||||
if ($output =~ /\%c/) {
|
||||
%month = _getMonth();
|
||||
$output =~ s/\%c/$month{$date[4]}/g;
|
||||
}
|
||||
#---day stuff
|
||||
$value = sprintf("%02d",$date[3]);
|
||||
$output =~ s/\%d/$value/g;
|
||||
$output =~ s/\%D/$date[3]/g;
|
||||
$output =~ s/\%w/$weekday{$date[6]}/g;
|
||||
if ($output =~ /\%w/) {
|
||||
%weekday = _getWeekday();
|
||||
$output =~ s/\%w/$weekday{$date[6]}/g;
|
||||
}
|
||||
#---hour stuff
|
||||
$hour12 = $date[2]+1;
|
||||
if ($hour12 > 12) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ package WebGUI::Form;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict qw(vars subs);
|
||||
use WebGUI::International;
|
||||
use WebGUI::Session;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -116,19 +117,22 @@ sub submit {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub text {
|
||||
my ($output, $assistance, $name, $size, $maxLength, $value);
|
||||
($name, $size, $maxLength, $value, $assistance) = @_;
|
||||
my ($output, $assistance, $name, $size, $maxLength, $value, $events);
|
||||
($name, $size, $maxLength, $value, $assistance, $events) = @_;
|
||||
if ($size eq "") {
|
||||
$size = 15;
|
||||
}
|
||||
if ($maxLength ne "") {
|
||||
$maxLength = ' maxlength="'.$maxLength.'"';
|
||||
}
|
||||
if ($events ne "") {
|
||||
$events = ' '.$events;
|
||||
}
|
||||
if ($assistance == 1) {
|
||||
$assistance = '<input type="button" style="font-size: 8pt;" onClick="window.dateField = this.form.'.$name.';calendar = window.open(\''.$session{setting}{lib}.'/calendar.html\',\'cal\',\'WIDTH=200,HEIGHT=250\');return false" value="set date">';
|
||||
$assistance = '<input type="button" style="font-size: 8pt;" onClick="window.dateField = this.form.'.$name.';calendar = window.open(\''.$session{setting}{lib}.'/calendar.html\',\'cal\',\'WIDTH=200,HEIGHT=250\');return false" value="'.WebGUI::International::get(34).'">';
|
||||
}
|
||||
$value = _fixQuotes($value);
|
||||
$output = '<input type="text" name="'.$name.'" value="'.$value.'" size="'.$size.'" '.$maxLength.'>'.$assistance;
|
||||
$output = '<input type="text" name="'.$name.'" value="'.$value.'" size="'.$size.'" '.$maxLength.$events.'>'.$assistance;
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +147,8 @@ sub textArea {
|
|||
$rows = 5;
|
||||
}
|
||||
if ($htmlEdit > 0) {
|
||||
$output = '<input type="button" onClick="colorText(this.form.'.$name.')" value="color" style="font-size: 8pt;"><input type="button" onClick="boldText(this.form.'.$name.')" value="bold" style="font-size: 8pt;"><input type="button" onClick="italicText(this.form.'.$name.')" value="italics" style="font-size: 8pt;"><input type="button" onClick="centerText(this.form.'.$name.')" value="center" style="font-size: 8pt;"><input type="button" onClick="list(this.form.'.$name.')" value="list" style="font-size: 8pt;"><input type="button" onClick="url(this.form.'.$name.')" value="link" style="font-size: 8pt;"><input type="button" onClick="email(this.form.'.$name.')" value="email" style="font-size: 8pt;"><input type="button" onClick="imageAdd(this.form.'.$name.')" value="image" style="font-size: 8pt;"><input type="button" onClick="showMe(this.form.'.$name.')" value="show me" style="font-size: 8pt;"><input type="button" onClick="copyright(this.form.'.$name.')" value="(C)" style="font-size: 8pt;"><input type="button" onClick="registered(this.form.'.$name.')" value="(R)" style="font-size: 8pt;"><input type="button" onClick="trademark(this.form.'.$name.')" value="TM" style="font-size: 8pt;"><br>';
|
||||
$output .= '<script language="JavaScript"> var formObj; var extrasDir="'.$session{setting}{lib}.'"; function openEditWindow(obj) { formObj = obj; /* if (navigator.userAgent.substr(navigator.userAgent.indexOf("MSIE")+5,1)>=5) window.open("'.$session{setting}{lib}.'/ieEdit.html","editWindow","width=500,height=400"); else */ window.open("'.$session{setting}{lib}.'/nonIeEdit.html","editWindow","width=450,height=240"); } function setContent(content) { formObj.value = content; } </script>';
|
||||
$output .= '<input type="button" onClick="openEditWindow(this.form.'.$name.')" value="'.WebGUI::International::get(171).'" style="font-size: 8pt;"><br>';
|
||||
}
|
||||
if ($wrap eq "") {
|
||||
$wrap = "virtual";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::T;
|
||||
package WebGUI::International;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -11,26 +11,28 @@ package WebGUI::Macro::T;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
my %international;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp, @data, $sth);
|
||||
$output = $_[0];
|
||||
#---top menu vertical---
|
||||
if ($output =~ /\^T/) {
|
||||
$temp = '<span class="verticalMenu">';
|
||||
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=1 order by sequenceNumber",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
if (WebGUI::Privilege::canViewPage($data[2])) {
|
||||
$temp .= '<a href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a><br>';
|
||||
}
|
||||
sub get {
|
||||
my ($output, $language);
|
||||
if ($session{user}{language} ne "") {
|
||||
$language = $session{user}{language};
|
||||
} elsif ($_[1] ne "") {
|
||||
$language = $_[1];
|
||||
} else {
|
||||
$language = "English";
|
||||
}
|
||||
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 language='$language'",$session{dbh});
|
||||
if ($output eq "" && $language ne "English") {
|
||||
$output = get($_[0],"English");
|
||||
}
|
||||
$sth->finish;
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^T/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -16,9 +16,14 @@ use WebGUI::Session;
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my (@files, $file, $cmd, $output);
|
||||
my (@files, $file, $cmd, $output, $macroDir);
|
||||
$output = $_[0];
|
||||
opendir (DIR,$session{config}{webguiRoot}."/lib/WebGUI/Macro") or WebGUI::ErrorHandler::fatalError("Can't open macro directory!");
|
||||
if ($^O =~ /Win/i) {
|
||||
$macroDir = "\\lib\\WebGUI\\Macro";
|
||||
} else {
|
||||
$macroDir = "/lib/WebGUI/Macro";
|
||||
}
|
||||
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/) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::P;
|
||||
package WebGUI::Macro::A_anyMenu;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -11,26 +11,29 @@ package WebGUI::Macro::P;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::Macro::Shared;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp, @data, $sth);
|
||||
my ($output, $temp, $pageTitle, $depth, @data);
|
||||
$output = $_[0];
|
||||
#---previous menu vertical---
|
||||
if ($output =~ /\^P/) {
|
||||
$temp = '<span class="verticalMenu">';
|
||||
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{parentId} order by sequenceNumber",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
if (WebGUI::Privilege::canViewPage($data[2])) {
|
||||
$temp .= '<a href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a><br>';
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
#---any page sub menu vertical---
|
||||
if ($output =~ /\^A(.*)\^\/A/) {
|
||||
($pageTitle,$depth) = split(/,/,$1);
|
||||
if ($depth eq "") {
|
||||
$depth = 1;
|
||||
}
|
||||
@data = WebGUI::SQL->quickArray("select pageId,title,urlizedTitle from page where urlizedTitle='$pageTitle'",$session{dbh});
|
||||
$temp = $pageTitle.'|'.$depth.'<span class="verticalMenu">';
|
||||
if (defined $data[0] && WebGUI::Privilege::canViewPage($data[0])) {
|
||||
$temp .= '<a href="'.$session{env}{SCRIPT_URL}.'/'.$data[2].'">'.$data[1].'</a><br>';
|
||||
$temp .= traversePageTree($data[0],1,$depth);
|
||||
}
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^P/$temp/g;
|
||||
$output =~ s/\^A(.*)\^\/A/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::At;
|
||||
package WebGUI::Macro::At_username;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::Backslash;
|
||||
package WebGUI::Macro::Backslash_pageUrl;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::C;
|
||||
package WebGUI::Macro::C_crumbTrail;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::Carat;
|
||||
package WebGUI::Macro::Carat_carat;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::D;
|
||||
package WebGUI::Macro::D_date;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::H;
|
||||
package WebGUI::Macro::H_homeLink;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -11,6 +11,7 @@ package WebGUI::Macro::H;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Session;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -22,7 +23,7 @@ sub process {
|
|||
$temp = '<a href="'.$session{env}{SCRIPT_NAME}.'/home">'.$1.'</a>';
|
||||
$output =~ s/\^H(.*)\^\/H/$temp/g;
|
||||
} elsif ($output =~ /\^H/) {
|
||||
$temp = '<a href="'.$session{env}{SCRIPT_NAME}.'/home">Home</a>';
|
||||
$temp = '<a href="'.$session{env}{SCRIPT_NAME}.'/home">'.WebGUI::International::get(47).'</a>';
|
||||
$output =~ s/\^H/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::Hash;
|
||||
package WebGUI::Macro::Hash_userId;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::L;
|
||||
package WebGUI::Macro::L_loginBox;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -12,6 +12,8 @@ package WebGUI::Macro::L;
|
|||
|
||||
use strict;
|
||||
use WebGUI::Form;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro::Backslash_pageUrl;
|
||||
use WebGUI::Session;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -22,13 +24,20 @@ sub process {
|
|||
if ($output =~ /\^L/) {
|
||||
$temp = '<div class="loginBox">';
|
||||
if ($session{var}{sessionId}) {
|
||||
$temp .= 'Hello '.$session{user}{username}.'. Click <a href="'.$session{page}{url}.'?op=logout">here</a> to log out.';
|
||||
$temp .= WebGUI::International::get(48);
|
||||
$temp .= ' '.$session{user}{username}.'. ';
|
||||
$temp .= WebGUI::International::get(49);
|
||||
$temp = WebGUI::Macro::Backslash::process($temp);
|
||||
} else {
|
||||
$temp .= '<form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$temp .= WebGUI::Form::hidden("op","login").'<span class="formSubtext">Username:<br></span>';
|
||||
$temp .= WebGUI::Form::text("username",12,30).'<span class="formSubtext"><br>Password:<br></span>';
|
||||
$temp .= WebGUI::Form::hidden("op","login").'<span class="formSubtext">';
|
||||
$temp .= WebGUI::International::get(50);
|
||||
$temp .= '<br></span>';
|
||||
$temp .= WebGUI::Form::text("username",12,30).'<span class="formSubtext"><br>';
|
||||
$temp .= WebGUI::International::get(51);
|
||||
$temp .= '<br></span>';
|
||||
$temp .= WebGUI::Form::password("identifier",12,30).'<span class="formSubtext"><br></span>';
|
||||
$temp .= WebGUI::Form::submit("login");
|
||||
$temp .= WebGUI::Form::submit(WebGUI::International::get(52));
|
||||
$temp .= '</form>';
|
||||
}
|
||||
$temp .= '</div>';
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::j;
|
||||
package WebGUI::Macro::M_currentMenuVertical;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -18,12 +18,17 @@ use WebGUI::Session;
|
|||
sub process {
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
#---2 level current level menu (vertical)---
|
||||
if ($output =~ /\^j/) {
|
||||
#---current menu vertical---
|
||||
if ($output =~ /\^M(.*)\^\/M/) {
|
||||
$temp = '<span class="verticalMenu">';
|
||||
$temp .= traversePageTree($session{page}{pageId},0,2);
|
||||
$temp .= traversePageTree($session{page}{pageId},0,$1);
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^j/$temp/g;
|
||||
$output =~ s/\^M(.*)\^\/M/$temp/g;
|
||||
} elsif ($output =~ /\^M/) {
|
||||
$temp = '<span class="verticalMenu">';
|
||||
$temp .= traversePageTree($session{page}{pageId},0,1);
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^M/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::F;
|
||||
package WebGUI::Macro::P_previousMenuVertical;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -12,17 +12,23 @@ package WebGUI::Macro::F;
|
|||
|
||||
use strict;
|
||||
use WebGUI::Macro::Shared;
|
||||
use WebGUI::Session;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
#---2 level menu (vertical)---
|
||||
if ($output =~ /\^F/) {
|
||||
#---previous menu vertical---
|
||||
if ($output =~ /\^P(.*)\^\/P/) {
|
||||
$temp = '<span class="verticalMenu">';
|
||||
$temp .= traversePageTree(1,0,2);
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^F/$temp/g;
|
||||
$temp .= traversePageTree($session{page}{parentId},0,$1);
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^P(.*)\^\/P/$temp/g;
|
||||
} elsif ($output =~ /\^P/) {
|
||||
$temp = '<span class="verticalMenu">';
|
||||
$temp .= traversePageTree($session{page}{parentId},0,1);
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^P/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::Splat;
|
||||
package WebGUI::Macro::Splat_random;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -11,14 +11,18 @@ package WebGUI::Macro::Splat;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::Utility;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
#---random number---
|
||||
if ($output =~ /\^\*/) {
|
||||
$temp = rand()*1000000000;
|
||||
if ($output =~ /\^\*(.*)\^\/\*/) {
|
||||
$temp = round(rand()*$1);
|
||||
$output =~ s/\^\*(.*)\^\/\*/$temp/g;
|
||||
} elsif ($output =~ /\^\*/) {
|
||||
$temp = round(rand()*1000000000);
|
||||
$output =~ s/\^\*/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::J;
|
||||
package WebGUI::Macro::T_topMenuVertical;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -12,18 +12,22 @@ package WebGUI::Macro::J;
|
|||
|
||||
use strict;
|
||||
use WebGUI::Macro::Shared;
|
||||
use WebGUI::Session;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp, @data, $sth, $first);
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
#---3 level current level menu (vertical)---
|
||||
if ($output =~ /\^J/) {
|
||||
#---top menu vertical---
|
||||
if ($output =~ /\^T(.*)\^\/T/) {
|
||||
$temp = '<span class="verticalMenu">';
|
||||
$temp .= traversePageTree($session{page}{pageId},0,3);
|
||||
$temp .= traversePageTree(1,0,$1);
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^J/$temp/g;
|
||||
$output =~ s/\^T(.*)\^\/T/$temp/g;
|
||||
} elsif ($output =~ /\^T/) {
|
||||
$temp = '<span class="verticalMenu">';
|
||||
$temp .= traversePageTree(1,0,1);
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^T/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::a;
|
||||
package WebGUI::Macro::a_account;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -11,6 +11,7 @@ package WebGUI::Macro::a;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Session;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -22,7 +23,7 @@ sub process {
|
|||
$temp = '<a href="'.$session{page}{url}.'?op=displayAccount">'.$1.'</a>';
|
||||
$output =~ s/\^a(.*)\^\/a/$temp/g;
|
||||
} elsif ($output =~ /\^a/) {
|
||||
$temp = '<a href="'.$session{page}{url}.'?op=displayAccount">My Account</a>';
|
||||
$temp = '<a href="'.$session{page}{url}.'?op=displayAccount">'.WebGUI::International::get(46).'</a>';
|
||||
$output =~ s/\^a/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::c;
|
||||
package WebGUI::Macro::c_companyName;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::e;
|
||||
package WebGUI::Macro::e_companyEmail;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package WebGUI::Macro::f;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# 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 strict;
|
||||
use WebGUI::Macro::Shared;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
#---full menu (vertical)---
|
||||
if ($output =~ /\^f/) {
|
||||
$temp = '<span class="verticalMenu">';
|
||||
$temp .= traversePageTree(1,0);
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^f/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package WebGUI::Macro::h;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# 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 strict;
|
||||
use WebGUI::Macro::Shared;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
#---3 level menu (vertical)---
|
||||
if ($output =~ /\^h/) {
|
||||
$temp = '<span class="verticalMenu">';
|
||||
$temp .= traversePageTree(1,0,3);
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^h/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
package WebGUI::Macro::m;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# 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 strict;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp, @data, $sth, $first);
|
||||
$output = $_[0];
|
||||
#---current menu vertical---
|
||||
if ($output =~ /\^M/) {
|
||||
$temp = '<span class="verticalMenu">';
|
||||
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{pageId} order by sequenceNumber",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
if (WebGUI::Privilege::canViewPage($data[2])) {
|
||||
$temp .= '<a href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a><br>';
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^M/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::M;
|
||||
package WebGUI::Macro::m_currentMenuHorizontal;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::p;
|
||||
package WebGUI::Macro::p_previousMenuHorizontal;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::r;
|
||||
package WebGUI::Macro::r_printable;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -11,6 +11,7 @@ package WebGUI::Macro::r;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Session;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -34,7 +35,9 @@ sub process {
|
|||
} else {
|
||||
$temp .= '?makePrintable=1';
|
||||
}
|
||||
$temp = '<a href="'.$temp.'">Make Page Printable</a>';
|
||||
$temp = '<a href="'.$temp.'">';
|
||||
$temp .= WebGUI::International::get(53);
|
||||
$temp .= '</a>';
|
||||
$output =~ s/\^r/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::t;
|
||||
package WebGUI::Macro::t_topMenuHorizontal;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::u;
|
||||
package WebGUI::Macro::u_companyUrl;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -15,8 +15,10 @@ use Exporter;
|
|||
use Net::LDAP;
|
||||
use strict;
|
||||
use URI;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::ErrorHandler;
|
||||
use WebGUI::Form;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Mail;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
|
|
@ -56,40 +58,43 @@ sub _login {
|
|||
WebGUI::Session::setCookie("wgSession",$cookieInfo);
|
||||
return "";
|
||||
} else {
|
||||
WebGUI::ErrorHandler::warn("Session signature '".$cookieInfo."' does not match account info for user ID ".$_[0]);
|
||||
return "<b>Error:</b> Unable to initialize session vars because your session signature does not match your account information.<p>";
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_createAccount {
|
||||
my ($output);
|
||||
my ($output, %language);
|
||||
if ($session{user}{userId} != 1) {
|
||||
$output .= www_displayAccount();
|
||||
} elsif ($session{setting}{anonymousRegistration} eq "no") {
|
||||
$output .= www_displayLogin();
|
||||
} else {
|
||||
$output .= ' <h1>Create Account</h1> <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= '<h1>'.WebGUI::International::get(54).'</h1>';
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","saveAccount");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Username</td><td>'.WebGUI::Form::text("username",20,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(50).'</td><td>'.WebGUI::Form::text("username",20,30).'</td></tr>';
|
||||
if ($session{setting}{authMethod} eq "LDAP") {
|
||||
$output .= WebGUI::Form::hidden("identifier1","ldap-password");
|
||||
$output .= WebGUI::Form::hidden("identifier2","ldap-password");
|
||||
$output .= '<tr><td class="formDescription">'.$session{setting}{ldapIdName}.'</td><td>'.WebGUI::Form::text("ldapId",20,100).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.$session{setting}{ldapPasswordName}.'</td><td>'.WebGUI::Form::password("ldapPassword",20,100).'</td></tr>';
|
||||
} else {
|
||||
$output .= '<tr><td class="formDescription">Password</td><td>'.WebGUI::Form::password("identifier1",20,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Password (confirm)</td><td>'.WebGUI::Form::password("identifier2",20,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(51).'</td><td>'.WebGUI::Form::password("identifier1",20,30).'</td></tr>';
|
||||
$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">Email Address</td><td>'.WebGUI::Form::text("email",20,255).'<span class="formSubtext"><br>This is only necessary if you wish to use features that require Email.</span></td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top"><a href="http://www.icq.com">ICQ</a> UIN</td><td>'.WebGUI::Form::text("icq",20,30).'<span class="formSubtext"><br>This is only necessary if you wish to use features that require ICQ.</span></td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("create").'</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});
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(304).'</td><td>'.WebGUI::Form::selectList("language",\%language).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table>';
|
||||
$output .= '</form> ';
|
||||
$output .= '<div class="accountOptions"><ul>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=displayLogin">I already have an account.</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=displayLogin">'.WebGUI::International::get(58).'</a>';
|
||||
if ($session{setting}{authMethod} eq "WebGUI") {
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=recoverPassword">I forgot my password.</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=recoverPassword">'.WebGUI::International::get(59).'</a>';
|
||||
}
|
||||
$output .= '</ul></div>';
|
||||
}
|
||||
|
|
@ -102,10 +107,10 @@ sub www_deactivateAccount {
|
|||
if ($session{user}{userId} == 1) {
|
||||
$output .= www_displayLogin();
|
||||
} else {
|
||||
$output .= '<h1>Please Confirm</h1>';
|
||||
$output .= 'Are you certain you want to deactivate your account. If you proceed your account information will be lost permanently.<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deactivateAccountConfirm">Yes, I\'m sure.</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'">No, I made a mistake.</a></div>';
|
||||
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(60).'<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deactivateAccountConfirm">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -123,34 +128,37 @@ sub www_deactivateAccountConfirm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_displayAccount {
|
||||
my ($output);
|
||||
my ($output, %hash, @array);
|
||||
if ($session{user}{userId} != 1) {
|
||||
$output .= ' <h1>Update Account Information</h1> <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= '<h1>'.WebGUI::International::get(61).'</h1>';
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","updateAccount");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">username</td><td>'.WebGUI::Form::text("username",20,30,$session{user}{username}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(50).'</td><td>'.WebGUI::Form::text("username",20,30,$session{user}{username}).'</td></tr>';
|
||||
if ($session{user}{authMethod} eq "LDAP") {
|
||||
$output .= WebGUI::Form::hidden("identifier","password");
|
||||
} else {
|
||||
$output .= '<tr><td class="formDescription">password</td><td>'.WebGUI::Form::password("identifier1",20,30,"password").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">password (confirm)</td><td>'.WebGUI::Form::password("identifier2",20,30,"password").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(51).'</td><td>'.WebGUI::Form::password("identifier1",20,30,"password").'</td></tr>';
|
||||
$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">email address</td><td>'.WebGUI::Form::text("email",20,255,$session{user}{email}).'<span class="formSubtext"><br>This is only necessary if you wish to use features that require Email.</span></td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top"><a href="http://www.icq.com">ICQ</a> UIN</td><td>'.WebGUI::Form::text("icq",20,30,$session{user}{icq}).'<span class="formSubtext"><br>This is only necessary if you wish to use features that require ICQ.</span></td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("update").'</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});
|
||||
$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>';
|
||||
$output .= '</table>';
|
||||
$output .= '</form> ';
|
||||
$output .= '<div class="accountOptions"><ul>';
|
||||
if (WebGUI::Privilege::isInGroup(3) || WebGUI::Privilege::isInGroup(4)) {
|
||||
if ($session{var}{adminOn}) {
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=switchOffAdmin">Turn admin off.</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=switchOffAdmin">'.WebGUI::International::get(12).'</a>';
|
||||
} else {
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=switchOnAdmin">Turn admin on.</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=switchOnAdmin">'.WebGUI::International::get(63).'</a>';
|
||||
}
|
||||
}
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=logout">Logout.</a><li><a href="'.$session{page}{url}.'?op=deactivateAccount">Please deactivate my account permanently.</a></ul></div>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=logout">'.WebGUI::International::get(64).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=deactivateAccount">'.WebGUI::International::get(65).'</a></ul></div>';
|
||||
} else {
|
||||
$output .= 'You need to be logged in to view your account information.<p>';
|
||||
$output .= www_displayLogin();
|
||||
}
|
||||
return $output;
|
||||
|
|
@ -162,20 +170,21 @@ sub www_displayLogin {
|
|||
if ($session{var}{sessionId}) {
|
||||
$output .= www_displayAccount();
|
||||
} else {
|
||||
$output .= ' <h1>Login</h1> <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= '<h1>'.WebGUI::International::get(66).'</h1>';
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","login");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">username</td><td>'.WebGUI::Form::text("username",20,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">password</td><td>'.WebGUI::Form::password("identifier",20,30).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("login").'</td></tr>';
|
||||
$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 .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(52)).'</td></tr>';
|
||||
$output .= '</table>';
|
||||
$output .= '</form>';
|
||||
$output .= '<div class="accountOptions"><ul>';
|
||||
if ($session{setting}{anonymousRegistration} eq "yes") {
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=createAccount">Create a new account.</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=createAccount">'.WebGUI::International::get(67).'</a>';
|
||||
}
|
||||
if ($session{setting}{authMethod} eq "WebGUI") {
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=recoverPassword">I forgot my password.</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=recoverPassword">'.WebGUI::International::get(59).'</a>';
|
||||
}
|
||||
$output .= '</ul></div>';
|
||||
}
|
||||
|
|
@ -194,14 +203,15 @@ sub www_login {
|
|||
$port = $uri->port;
|
||||
}
|
||||
%args = (port => $port);
|
||||
$ldap = Net::LDAP->new($uri->host, %args) or $error = "Cannot connect to LDAP server.";
|
||||
$ldap = Net::LDAP->new($uri->host, %args) or $error = WebGUI::International::get(79);
|
||||
$auth = $ldap->bind($connectDN, $session{form}{identifier});
|
||||
$ldap->unbind;
|
||||
if ($auth->code == 48 || $auth->code == 49) {
|
||||
$error = "The account information you supplied is invalid. Either the account does not exist or the username/password combination was incorrect.";
|
||||
$error = WebGUI::International::get(68);
|
||||
WebGUI::ErrorHandler::warn("Invalid login for user account: ".$session{form}{username});
|
||||
} elsif ($auth->code > 0) {
|
||||
$error .= 'LDAP error "'.$ldapStatusCode{$auth->code}.'" occured. Please contact your system administrator for assistance. ';
|
||||
$error .= 'LDAP error "'.$ldapStatusCode{$auth->code}.'" occured.';
|
||||
$error .= WebGUI::International::get(69);
|
||||
WebGUI::ErrorHandler::warn("LDAP error: ".$ldapStatusCode{$auth->code});
|
||||
} else {
|
||||
$success = 1;
|
||||
|
|
@ -210,7 +220,7 @@ sub www_login {
|
|||
if (Digest::MD5::md5_base64($session{form}{identifier}) eq $pass && $session{form}{identifier} ne "") {
|
||||
$success = 1;
|
||||
} else {
|
||||
$error = "The account information you supplied is invalid. Either the account does not exist or the username/password combination was incorrect.";
|
||||
$error = WebGUI::International::get(68);
|
||||
WebGUI::ErrorHandler::warn("Invalid login for user account: ".$session{form}{username});
|
||||
}
|
||||
}
|
||||
|
|
@ -218,7 +228,7 @@ sub www_login {
|
|||
_login($uid,$pass);
|
||||
return "";
|
||||
} else {
|
||||
return "<h1>Error</h1>".$error.www_displayLogin();
|
||||
return "<h1>".WebGUI::International::get(70)."</h1>".$error.www_displayLogin();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -235,18 +245,19 @@ sub www_recoverPassword {
|
|||
if ($session{var}{sessionId}) {
|
||||
$output .= www_displayAccount();
|
||||
} else {
|
||||
$output .= ' <h1>Recover Password</h1> <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= '<h1>'.WebGUI::International::get(71).'</h1>';
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","recoverPasswordFinish");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Email Address</td><td>'.WebGUI::Form::text("email",20,255).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("recover").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(56).'</td><td>'.WebGUI::Form::text("email",20,255).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(72)).'</td></tr>';
|
||||
$output .= '</table>';
|
||||
$output .= '</form>';
|
||||
$output .= '<div class="accountOptions"><ul>';
|
||||
if ($session{setting}{anonymousRegistration} eq "yes") {
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=createAccount">Create a new account.</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=createAccount">'.WebGUI::International::get(67).'</a>';
|
||||
}
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=displayLogin">Login.</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=displayLogin">'.WebGUI::International::get(73).'</a>';
|
||||
$output .= '</ul></div>';
|
||||
}
|
||||
return $output;
|
||||
|
|
@ -263,15 +274,17 @@ sub www_recoverPasswordFinish {
|
|||
$encryptedPassword = Digest::MD5::md5_base64($password);
|
||||
WebGUI::SQL->write("update users set identifier='$encryptedPassword' where userId='$userId'",$session{dbh});
|
||||
$flag = 1;
|
||||
$message = "Someone (probably you) requested your account information be sent. Your password has been reset. The following represents your new account information:\nUser: ".$username."\nPass: ".$password."\n";
|
||||
WebGUI::Mail::send($session{form}{email},"Account Information",$message);
|
||||
$message = $session{setting}{recoverPasswordEmail};
|
||||
$message .= "\n".WebGUI::International::get(50).": ".$username."\n";
|
||||
$message .= WebGUI::International::get(51).": ".$password."\n";
|
||||
WebGUI::Mail::send($session{form}{email},WebGUI::International::get(74),$message);
|
||||
}
|
||||
$sth->finish();
|
||||
if ($flag) {
|
||||
$output = '<ul><li>Your account information has been sent to your email address.</ul>';
|
||||
$output = '<ul><li>'.WebGUI::International::get(75).'</ul>';
|
||||
$output .= www_displayLogin();
|
||||
} else {
|
||||
$output = '<ul><li>That email address is not in our databases.</ul>';
|
||||
$output = '<ul><li>'.WebGUI::International::get(76).'</ul>';
|
||||
$output .= www_recoverPassword();
|
||||
}
|
||||
return $output;
|
||||
|
|
@ -281,10 +294,14 @@ sub www_recoverPasswordFinish {
|
|||
sub www_saveAccount {
|
||||
my ($uri, $ldap, $port, %args, $search, $connectDN, $auth, $output, $error, $uid, $encryptedPassword);
|
||||
if (_hasBadUsername($session{form}{username})) {
|
||||
$error = 'The account name "'.$session{form}{username}.'" is in use by another member of this site. Please try a different username, perhaps "'.$session{form}{username}.'too" or "'.$session{form}{username}.'01" ';
|
||||
$error = WebGUI::International::get(77);
|
||||
$error .= ' "'.$session{form}{username}.'too", ';
|
||||
$error .= '"'.$session{form}{username}.'2", ';
|
||||
$error .= '"'.$session{form}{username}.'_'.WebGUI::DateTime::epochToHuman(time(),"%y").'"';
|
||||
$error .= '<p>';
|
||||
}
|
||||
if (_hasBadPassword($session{form}{identifier1},$session{form}{identifier2})) {
|
||||
$error .= 'Your passwords did not match. Please try again. ';
|
||||
$error .= WebGUI::International::get(78);
|
||||
}
|
||||
if ($session{setting}{authMethod} eq "LDAP") {
|
||||
$uri = URI->new($session{setting}{ldapURL});
|
||||
|
|
@ -294,18 +311,18 @@ sub www_saveAccount {
|
|||
$port = $uri->port;
|
||||
}
|
||||
%args = (port => $port);
|
||||
$ldap = Net::LDAP->new($uri->host, %args) or $error .= "Cannot connect to LDAP server. ";
|
||||
$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});
|
||||
$connectDN = "cn=".$search->entry(0)->get_value("cn");
|
||||
$ldap->unbind;
|
||||
$ldap = Net::LDAP->new($uri->host, %args) or $error .= "Cannot connect to LDAP server. ";
|
||||
$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 .= "Either your ".$session{setting}{ldapIdName}." or ".$session{setting}{ldapPasswordName}." were invalid. ";
|
||||
$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. Please contact your system administrator for assistance. ';
|
||||
$error .= 'LDAP error "'.$ldapStatusCode{$auth->code}.'" occured. '.WebGUI::International::get(69);
|
||||
WebGUI::ErrorHandler::warn("LDAP error: ".$ldapStatusCode{$auth->code});
|
||||
}
|
||||
$ldap->unbind;
|
||||
|
|
@ -313,13 +330,13 @@ sub www_saveAccount {
|
|||
if ($error eq "") {
|
||||
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier1});
|
||||
$uid = getNextId("userId");
|
||||
WebGUI::SQL->write("insert into users values ($uid, ".quote($session{form}{username}).", ".quote($encryptedPassword).", ".quote($session{form}{email}).", ".quote($session{form}{icq}).", ".quote($session{setting}{authMethod}).", ".quote($session{setting}{ldapURL}).", ".quote($connectDN).")",$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{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 .= 'Account created successfully!<p>';
|
||||
$output .= WebGUI::International::get(80).'<p>';
|
||||
$output .= www_displayAccount();
|
||||
} else {
|
||||
$output = "<h1>Error</h1>".$error.www_createAccount();
|
||||
$output = "<h1>".WebGUI::International::get(70)."</h1>".$error.www_createAccount();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -329,21 +346,25 @@ sub www_updateAccount {
|
|||
my ($output, $error, $encryptedPassword, $passwordStatement);
|
||||
if ($session{var}{sessionId}) {
|
||||
if (_hasBadUsername($session{form}{username})) {
|
||||
$error = '<b>Error:</b> The account name <b>'.$session{form}{username}.'</b> is in use by another member of this site. Please try a different username, perhaps "'.$session{form}{username}.'too" or "'.$session{form}{username}.'01"<p>';
|
||||
$error = WebGUI::International::get(77);
|
||||
$error .= ' "'.$session{form}{username}.'too", ';
|
||||
$error .= '"'.$session{form}{username}.'2", ';
|
||||
$error .= '"'.$session{form}{username}.'_'.WebGUI::DateTime::epochToHuman(time(),"%y").'"';
|
||||
$error .= '<p>';
|
||||
}
|
||||
if ($session{form}{identifier1} ne "password" && _hasBadPassword($session{form}{identifier1},$session{form}{identifier2})) {
|
||||
$error .= '<b>Error:</b> Your passwords did not match. Please try again.<p>';
|
||||
$error .= WebGUI::International::get(78).'<p>';
|
||||
} else {
|
||||
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier1});
|
||||
$passwordStatement = ', identifier='.quote($encryptedPassword);
|
||||
}
|
||||
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}).", icq=".quote($session{form}{icq})." 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},$session{dbh});
|
||||
if ($passwordStatement ne "") {
|
||||
_login($session{user}{userId},$encryptedPassword);
|
||||
}
|
||||
$output .= 'Account updated successfully!<p>';
|
||||
$output .= WebGUI::International::get(81).'<p>';
|
||||
$output .= www_displayAccount();
|
||||
} else {
|
||||
$output = $error;
|
||||
|
|
@ -356,3 +377,4 @@ sub www_updateAccount {
|
|||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ use Exporter;
|
|||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::Form;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -26,12 +27,14 @@ 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"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Group</h1> <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=17"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(83).'</h1>';
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","addGroupSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Group Name</td><td>'.WebGUI::Form::text("groupName",20,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Description</td><td>'.WebGUI::Form::textArea("description",'').'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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 .= '</table>';
|
||||
$output .= '</form> ';
|
||||
} else {
|
||||
|
|
@ -58,10 +61,11 @@ 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"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Please Confirm</h1>';
|
||||
$output .= '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.<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deleteGroupConfirm&gid='.$session{form}{gid}.'">Yes, I\'m sure.</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=listGroups">No, I made a mistake. </a></div>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=15"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$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>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=listGroups">'.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
|
|
@ -87,14 +91,16 @@ sub www_editGroup {
|
|||
tie %group, '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=13"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Group</h1> <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=13"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(87).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editGroupSave");
|
||||
$output .= WebGUI::Form::hidden("gid",$session{form}{gid});
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Group Name</td><td>'.WebGUI::Form::text("groupName",20,30,$group{groupName}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Description</td><td>'.WebGUI::Form::textArea("description",$group{description}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Users In Group</td><td valign="top">';
|
||||
$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 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 .= $user."<br>";
|
||||
|
|
@ -124,8 +130,9 @@ sub www_listGroups {
|
|||
my ($output, $pn, $sth, @data, @row, $i, $itemsPerPage);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$itemsPerPage = 50;
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=10"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Groups</h1>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=addGroup">Add a new group.</a></div>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=10"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$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});
|
||||
while (@data = $sth->array) {
|
||||
|
|
@ -145,15 +152,15 @@ sub www_listGroups {
|
|||
$output .= '</table>';
|
||||
$output .= '<div class="pagination">';
|
||||
if ($pn > 0) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn-1).'&op=listGroups">«Previous Page</a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn-1).'&op=listGroups">«'.WebGUI::International::get(91).'</a>';
|
||||
} else {
|
||||
$output .= '«Previous Page';
|
||||
$output .= '«'.WebGUI::International::get(91);
|
||||
}
|
||||
$output .= ' · ';
|
||||
if ($pn < round($#row/$itemsPerPage)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn+1).'&op=listGroups">Next Page»</a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn+1).'&op=listGroups">'.WebGUI::International::get(92).'»</a>';
|
||||
} else {
|
||||
$output .= 'Next Page»';
|
||||
$output .= WebGUI::International::get(92).'»';
|
||||
}
|
||||
$output .= '</div>';
|
||||
return $output;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ package WebGUI::Operation::Help;
|
|||
use Exporter;
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Utility;
|
||||
|
|
@ -25,29 +26,29 @@ sub www_viewHelp {
|
|||
my ($output, %help, @data, $sth);
|
||||
tie %help, 'Tie::CPHash';
|
||||
%help = WebGUI::SQL->quickHash("select * from help where helpId=$session{form}{hid}",$session{dbh});
|
||||
$output = '<h1>Help: '.$help{action}.' '.$help{object}.'</h1>';
|
||||
$output = '<h1>'.WebGUI::International::get(93).': '.$help{action}.' '.$help{object}.'</h1>';
|
||||
$help{body} =~ s/\n/\<br\>/g;
|
||||
$output .= $help{body};
|
||||
$output .= '<p><b>See Also:';
|
||||
$output .= '<p><b>'.WebGUI::International::get(94).':';
|
||||
$sth = WebGUI::SQL->read("select helpId, action, object from help where object='$help{object}' and action<>'$help{action}' order by action",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'">'.$data[1].' '.$data[2].'</a> ·';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'">'.$data[1].' '.$data[2].'</a>,';
|
||||
}
|
||||
$sth->finish;
|
||||
$sth = WebGUI::SQL->read("select helpId, action, object from help where helpId in ($help{seeAlso}) order by action",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'">'.$data[1].' '.$data[2].'</a> ·';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'">'.$data[1].' '.$data[2].'</a>,';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelpIndex">Help Index</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelpIndex">'.WebGUI::International::get(95).'</a>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewHelpIndex {
|
||||
my ($sth, @data, $output, $previous);
|
||||
$output = '<h1>Help Index</h1>';
|
||||
$output .= '<table width="100%"><tr><td valign="top"><b>Sorted By Action</b><p>';
|
||||
$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 from help order by action,object",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
if ($data[1] ne $previous) {
|
||||
|
|
@ -57,7 +58,7 @@ sub www_viewHelpIndex {
|
|||
$output .= '<li><a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'">'.$data[2].'</a><br>';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '</td><td valign="top"><b>Sorted By Object</b><p>';
|
||||
$output .= '</td><td valign="top"><b>'.WebGUI::International::get(97).'</b><p>';
|
||||
$sth = WebGUI::SQL->read("select helpId, object, action from help order by object,action",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
if ($data[1] ne $previous) {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ package WebGUI::Operation::Page;
|
|||
use Exporter;
|
||||
use strict;
|
||||
use WebGUI::Form;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -58,12 +59,14 @@ sub _reorderPages {
|
|||
sub www_addPage {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Page</h1><form method="post" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(98).'</h1>';
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("op","addPageSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,$session{form}{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Meta Tags</td><td>'.WebGUI::Form::textArea("metaTags",$session{form}{metaTags}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("create").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,$session{form}{title}).'</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></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -107,10 +110,11 @@ 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"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Please Confirm</h1>';
|
||||
$output .= 'Are you certain that you wish to delete this page, its content, and all items under it?<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deletePageConfirm">Yes, I\'m sure.</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'">No, I made a mistake.</a></div>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=3"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$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>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -137,39 +141,41 @@ 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=2"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Page</h1><form method="post" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=2"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(102).'</h1>';
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("op","editPageSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td colspan=2><b>Page Specifics</b></td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,$session{page}{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Page URL</td><td>'.WebGUI::Form::text("urlizedTitle",20,30,$session{page}{urlizedTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Meta Tags</td><td>'.WebGUI::Form::textArea("metaTags",$session{page}{metaTags}).'</td></tr>';
|
||||
$output .= '<tr><td colspan=2><hr size=1><b>Style</b></td></tr>';
|
||||
$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,30,$session{page}{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(104).'</td><td>'.WebGUI::Form::text("urlizedTitle",20,30,$session{page}{urlizedTitle}).'</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 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});
|
||||
$array[0] = $session{page}{styleId};
|
||||
$output .= '<tr><td class="formDescription">Style</td><td>'.WebGUI::Form::selectList("styleId",\%hash,\@array).' <span class="formSubtext"><a href="'.$session{page}{url}.'?op=listStyles">Manage Styles</a></span></td></tr>';
|
||||
$output .= '<tr><td class="formDescription"></td><td>'.WebGUI::Form::checkbox("recurseStyle","yes").' <span class="formSubtext">Check to give this style to all sub-pages.</span></td></tr>';
|
||||
$output .= '<tr><td colspan=2><hr size=1><b>Privileges</b></td></tr>';
|
||||
$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 .= '<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});
|
||||
$array[0] = $session{page}{ownerId};
|
||||
$output .= '<tr><td class="formDescription">Owner</td><td>'.WebGUI::Form::selectList("ownerId",\%hash,\@array).' <span class="formSubtext"><a href="'.$session{page}{url}.'?op=listUsers">Manage Users</a></span></td></tr>';
|
||||
$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>';
|
||||
$array[0] = $session{page}{ownerView};
|
||||
$output .= '<tr><td class="formDescription">Owner can view?</td><td>'.WebGUI::Form::selectList("ownerView",\%yesNo,\@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(109).'</td><td>'.WebGUI::Form::selectList("ownerView",\%yesNo,\@array).'</td></tr>';
|
||||
$array[0] = $session{page}{ownerEdit};
|
||||
$output .= '<tr><td class="formDescription">Owner can edit?</td><td>'.WebGUI::Form::selectList("ownerEdit",\%yesNo,\@array).'</td></tr>';
|
||||
$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});
|
||||
$array[0] = $session{page}{groupId};
|
||||
$output .= '<tr><td class="formDescription">Group</td><td>'.WebGUI::Form::selectList("groupId",\%hash,\@array).' <span class="formSubtext"><a href="'.$session{page}{url}.'?op=listGroups">Manage Groups</a></span></td></tr>';
|
||||
$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>';
|
||||
$array[0] = $session{page}{groupView};
|
||||
$output .= '<tr><td class="formDescription">Group can view?</td><td>'.WebGUI::Form::selectList("groupView",\%yesNo,\@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(112).'</td><td>'.WebGUI::Form::selectList("groupView",\%yesNo,\@array).'</td></tr>';
|
||||
$array[0] = $session{page}{groupEdit};
|
||||
$output .= '<tr><td class="formDescription">Group can edit?</td><td>'.WebGUI::Form::selectList("groupEdit",\%yesNo,\@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(113).'</td><td>'.WebGUI::Form::selectList("groupEdit",\%yesNo,\@array).'</td></tr>';
|
||||
$array[0] = $session{page}{worldView};
|
||||
$output .= '<tr><td class="formDescription">Anybody can view?</td><td>'.WebGUI::Form::selectList("worldView",\%yesNo,\@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(114).'</td><td>'.WebGUI::Form::selectList("worldView",\%yesNo,\@array).'</td></tr>';
|
||||
$array[0] = $session{page}{worldEdit};
|
||||
$output .= '<tr><td class="formDescription">Anybody can Edit?</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">Check to give these privileges to all sub-pages.</span></td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -13,51 +13,37 @@ package WebGUI::Operation::Settings;
|
|||
use Exporter;
|
||||
use strict;
|
||||
use WebGUI::Form;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Utility;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&www_editSettings &www_editSettingsSave);
|
||||
our @EXPORT = qw(&www_editAuthenticationSettings &www_editAuthenticationSettingsSave &www_editCompanyInformation &www_editCompanyInformationSave &www_editFileSettings &www_editFileSettingsSave &www_editMailSettings &www_editMailSettingsSave &www_editMiscSettings &www_editMiscSettingsSave &www_manageSettings &www_viewStatistics);
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editSettings {
|
||||
my ($output, %authMethod, @array, %yesNo, %notFoundPage);
|
||||
%authMethod = ('WebGUI'=>'WebGUI', 'LDAP'=>'LDAP');
|
||||
%yesNo = ('yes'=>'Yes', 'no'=>'No');
|
||||
%notFoundPage = (1=>'Home Page', 4=>'Page Not Found Page');
|
||||
sub www_editAuthenticationSettings {
|
||||
my ($output, %authMethod, @array, %yesNo);
|
||||
%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=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Settings</h1> <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editSettingsSave");
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(117).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editAuthenticationSettingsSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td colspan=2><b>Files</b></td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Path to WebGUI Extras</td><td>'.WebGUI::Form::text("lib",30,255,$session{setting}{lib}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Maximum Attachment Size</td><td>'.WebGUI::Form::text("maxAttachmentSize",30,11,$session{setting}{maxAttachmentSize}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Web Attachment Path</td><td>'.WebGUI::Form::text("attachmentDirectoryWeb",30,255,$session{setting}{attachmentDirectoryWeb}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Server Attachment Path</td><td>'.WebGUI::Form::text("attachmentDirectoryLocal",30,255,$session{setting}{attachmentDirectoryLocal}).'</td></tr>';
|
||||
$output .= '<tr><td colspan=2><hr size=1><b>Company Information</b></td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Company Name</td><td>'.WebGUI::Form::text("companyName",30,255,$session{setting}{companyName}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Company Email Address</td><td>'.WebGUI::Form::text("companyEmail",30,255,$session{setting}{companyEmail}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Company URL</td><td>'.WebGUI::Form::text("companyURL",30,2048,$session{setting}{companyURL}).'</td></tr>';
|
||||
$output .= '<tr><td colspan=2><hr size=1><b>Authentication</b></td></tr>';
|
||||
$array[0] = $session{setting}{anonymousRegistration};
|
||||
$output .= '<tr><td class="formDescription" valign="top">Anonymous Registration</td><td>'.WebGUI::Form::selectList("anonymousRegistration",\%yesNo, \@array).'</td></tr>';
|
||||
$array[0] = $session{setting}{authMethod};
|
||||
$output .= '<tr><td class="formDescription" valign="top">Authentication Method (default)</td><td>'.WebGUI::Form::selectList("authMethod",\%authMethod, \@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">LDAP URL (default)</td><td>'.WebGUI::Form::text("ldapURL",30,2048,$session{setting}{ldapURL}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">LDAP Identity (default)</td><td>'.WebGUI::Form::text("ldapId",30,100,$session{setting}{ldapId}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">LDAP Identity Name</td><td>'.WebGUI::Form::text("ldapIdName",30,100,$session{setting}{ldapIdName}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">LDAP Password Name</td><td>'.WebGUI::Form::text("ldapPasswordName",30,100,$session{setting}{ldapPasswordName}).'</td></tr>';
|
||||
$output .= '<tr><td colspan=2><hr size=1><b>Miscellaneous</b></td></tr>';
|
||||
$array[0] = $session{setting}{notFoundPage};
|
||||
$output .= '<tr><td class="formDescription" valign="top">Not Found Page</td><td>'.WebGUI::Form::selectList("notFoundPage",\%notFoundPage,\@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Session Timeout</td><td>'.WebGUI::Form::text("sessionTimeout",30,11,$session{setting}{sessionTimeout}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">SMTP Server</td><td>'.WebGUI::Form::text("smtpServer",30,255,$session{setting}{smtpServer}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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>';
|
||||
$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 .= '<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 .= '</table>';
|
||||
$output .= '</form> ';
|
||||
$output .= '<hr size=1>Build Version: '.$WebGUI::VERSION;
|
||||
} else {
|
||||
$output = WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
|
|
@ -65,23 +51,145 @@ sub www_editSettings {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editSettingsSave {
|
||||
sub www_editAuthenticationSettingsSave {
|
||||
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}{sessionTimeout})." where name='sessionTimeout'",$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}{smtpServer})." where name='smtpServer'",$session{dbh});
|
||||
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}{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});
|
||||
return www_manageSettings();
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editCompanyInformation {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(124).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$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 .= '</table>';
|
||||
$output .= '</form> ';
|
||||
} else {
|
||||
$output = WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
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});
|
||||
return www_manageSettings();
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editFileSettings {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(128).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$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 .= '</table>';
|
||||
$output .= '</form> ';
|
||||
} else {
|
||||
$output = WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
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})." wherename='attachmentDirectoryLocal'",$session{dbh});
|
||||
return www_manageSettings();
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editMailSettings {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(133).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$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 .= '</table>';
|
||||
$output .= '</form> ';
|
||||
} else {
|
||||
$output = WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
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});
|
||||
return www_manageSettings();
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
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=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(140).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$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 .= '</table>';
|
||||
$output .= '</form> ';
|
||||
} else {
|
||||
$output = WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
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});
|
||||
return "";
|
||||
} else {
|
||||
|
|
@ -89,4 +197,52 @@ sub www_editSettingsSave {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_manageSettings {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(143).'</h1>';
|
||||
$output .= '<ul>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=editAuthenticationSettings">'.WebGUI::International::get(117).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=editCompanyInformation">'.WebGUI::International::get(124).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=editFileSettings">'.WebGUI::International::get(128).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=editMailSettings">'.WebGUI::International::get(133).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=editMiscSettings">'.WebGUI::International::get(140).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=viewStatistics">'.WebGUI::International::get(144).'</a>';
|
||||
$output .= '</ul>';
|
||||
} else {
|
||||
$output = WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewStatistics {
|
||||
my ($output, $data);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(144).'</h1>';
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(145).'</td><td class="tableData">'.$WebGUI::VERSION.'</td></tr>';
|
||||
($data) = WebGUI::SQL->quickArray("select count(*) from session",$session{dbh});
|
||||
$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});
|
||||
$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});
|
||||
$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});
|
||||
$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});
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(89).'</td><td class="tableData">'.$data.'</td></tr>';
|
||||
$output .= '</table>';
|
||||
} else {
|
||||
$output = WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ use Exporter;
|
|||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::Form;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -26,14 +27,16 @@ our @EXPORT = qw(&www_addStyle &www_addStyleSave &www_deleteStyle &www_deleteSty
|
|||
sub www_addStyle {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=16"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Style</h1> <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=16"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(150).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","addStyleSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Style Name</td><td>'.WebGUI::Form::text("name",20,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Header</td><td>'.WebGUI::Form::textArea("header",'',50,10,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Footer</td><td>'.WebGUI::Form::textArea("footer",'',50,10,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Style Sheet</td><td>'.WebGUI::Form::textArea("styleSheet",'<style> </style>',50,10).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(153).'</td><td>'.WebGUI::Form::textArea("footer",'',50,10,1).'</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 .= '</table>';
|
||||
$output .= '</form> ';
|
||||
} else {
|
||||
|
|
@ -60,10 +63,10 @@ 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"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Please Confirm</h1>';
|
||||
$output .= 'Are you certain you wish to delete this style and migrate all pages using this style to the "Fail Safe" style?<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deleteStyleConfirm&sid='.$session{form}{sid}.'">Yes, I\'m sure.</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=listStyles">No, I made a mistake.</a></div>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=4"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><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 .= ' <a href="'.$session{page}{url}.'?op=listStyles">'.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
|
|
@ -89,15 +92,17 @@ sub www_editStyle {
|
|||
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=11"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Style</h1> <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=11"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(156).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editStyleSave");
|
||||
$output .= WebGUI::Form::hidden("sid",$session{form}{sid});
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Style Name</td><td>'.WebGUI::Form::text("name",20,30,$style{name}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Header</td><td>'.WebGUI::Form::textArea("header",$style{header},50,10,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Footer</td><td>'.WebGUI::Form::textArea("footer",$style{footer},50,10,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Style Sheet</td><td>'.WebGUI::Form::textArea("styleSheet",$style{styleSheet},50,10).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(153).'</td><td>'.WebGUI::Form::textArea("footer",$style{footer},50,10,1).'</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 .= '</table>';
|
||||
$output .= '</form> ';
|
||||
} else {
|
||||
|
|
@ -121,8 +126,9 @@ sub www_listStyles {
|
|||
my ($output, $pn, $sth, @data, @row, $i, $itemsPerPage);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$itemsPerPage = 50;
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=9"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Styles</h1>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=addStyle">Add a new style.</a></div>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=9"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(157).'</h1>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=addStyle">'.WebGUI::International::get(158).'</a></div>';
|
||||
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
|
||||
$sth = WebGUI::SQL->read("select styleId,name from style where name<>'Reserved' order by name",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ package WebGUI::Operation::Submission;
|
|||
use Exporter;
|
||||
use strict;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -46,7 +47,7 @@ sub www_denySubmission {
|
|||
sub www_viewPendingSubmissions {
|
||||
my (@submission, $output, $sth, @row, $i, $pn);
|
||||
if (WebGUI::Privilege::isInGroup(4,$session{user}{userId}) || WebGUI::Privilege::isInGroup(3,$session{user}{userId})) {
|
||||
$output = '<h1>Pending Sumissions</h1>';
|
||||
$output = '<h1>'.WebGUI::International::get(159).'</h1>';
|
||||
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,username,userId,widgetId from submission where status='Pending' order by dateSubmitted",$session{dbh});
|
||||
while (@submission = $sth->array) {
|
||||
$row[$i] = '<tr><td class="tableData"><a href="'.$session{page}{url}.'?wid='.$submission[5].'&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>';
|
||||
|
|
@ -54,7 +55,7 @@ sub www_viewPendingSubmissions {
|
|||
}
|
||||
$sth->finish;
|
||||
$output .= '<table width="100%" cellspacing=1 cellpadding=2 border=0>';
|
||||
$output .= '<tr><td class="tableHeader">Title</td><td class="tableHeader">Date Submitted</td><td class="tableHeader">Submitted By</td></tr>';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(99).'</td><td class="tableHeader">'.WebGUI::International::get(160).'</td><td class="tableHeader">'.WebGUI::International::get(161).'</td></tr>';
|
||||
if ($session{form}{pn} < 1) {
|
||||
$pn = 0;
|
||||
} else {
|
||||
|
|
@ -66,15 +67,15 @@ sub www_viewPendingSubmissions {
|
|||
$output .= '</table>';
|
||||
$output .= '<div class="pagination">';
|
||||
if ($pn > 0) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn-1).'&op=viewPendingSubmissions">«Previous Page</a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn-1).'&op=viewPendingSubmissions">«'.WebGUI::International::get(91).'</a>';
|
||||
} else {
|
||||
$output .= '«Previous Page';
|
||||
$output .= '«'.WebGUI::International::get(91);
|
||||
}
|
||||
$output .= ' · ';
|
||||
if ($pn < round($#row/50)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn+1).'&op=viewPendingSubmissions">Next Page»</a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn+1).'&op=viewPendingSubmissions">'.WebGUI::International::get(92).'»</a>';
|
||||
} else {
|
||||
$output .= 'Next Page»';
|
||||
$output .= WebGUI::International::get(92).'»';
|
||||
}
|
||||
$output .= '</div>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -47,10 +47,10 @@ sub _recursePageTree {
|
|||
sub www_purgeTrash {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=46"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Please Confirm</h1>';
|
||||
$output .= 'Are you certain that you wish to purge all the pages and widgets in the trash?<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=purgeTrashConfirm">Yes, I\'m sure.</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'">No, I made a mistake.</a></div>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=46"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><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 .= ' <a href="'.$session{page}{url}.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ use Exporter;
|
|||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::Form;
|
||||
use WebGUI::Operation::Help;
|
||||
use WebGUI::Operation::Page;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -29,21 +28,25 @@ our @EXPORT = qw(&www_addUser &www_addUserSave &www_deleteUser &www_deleteUserCo
|
|||
sub www_addUser {
|
||||
my ($output, %hash, @array);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=5"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add User</h1> <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=5"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(163).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","addUserSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Username</td><td>'.WebGUI::Form::text("username",20,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Password</td><td>'.WebGUI::Form::password("identifier",20,30).'</td></tr>';
|
||||
$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>';
|
||||
%hash = ('WebGUI'=>'WebGUI', 'LDAP'=>'LDAP');
|
||||
$array[0] = $session{setting}{authMethod};
|
||||
$output .= '<tr><td class="formDescription">Authentication Method</td><td>'.WebGUI::Form::selectList("authMethod",\%hash, \@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">LDAP URL</td><td>'.WebGUI::Form::text("ldapURL",20,2048,$session{setting}{ldapURL}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Connect DN</td><td>'.WebGUI::Form::text("connectDN",20,255).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Email address</td><td>'.WebGUI::Form::text("email",20,255).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top"><a href="http://www.icq.com">ICQ</a> UIN</td><td>'.WebGUI::Form::text("icq",20,30).'</td></tr>';
|
||||
$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 .= '<tr><td class="formDescription" valign="top">Groups</td><td>'.WebGUI::Form::selectList("groups",\%hash,'',5,1).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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 .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(304).'</td><td>'.WebGUI::Form::selectList("language",\%hash).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table>';
|
||||
$output .= '</form> ';
|
||||
} else {
|
||||
|
|
@ -58,7 +61,7 @@ sub www_addUserSave {
|
|||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier});
|
||||
$uid = getNextId("userId");
|
||||
WebGUI::SQL->write("insert into users values ($uid, ".quote($session{form}{username}).", ".quote($encryptedPassword).", ".quote($session{form}{email}).", ".quote($session{form}{icq}).", ".quote($session{form}{authMethod}).", ".quote($session{form}{ldapURL}).", ".quote($session{form}{connectDN}).")",$session{dbh});
|
||||
WebGUI::SQL->write("insert into users 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});
|
||||
@groups = $session{cgi}->param('groups');
|
||||
foreach $gid (@groups) {
|
||||
WebGUI::SQL->write("insert into groupings values ($gid, $uid)",$session{dbh});
|
||||
|
|
@ -76,10 +79,11 @@ sub www_deleteUser {
|
|||
if ($session{form}{uid} < 26) {
|
||||
return WebGUI::Privilege::vitalComponent();
|
||||
} elsif (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=7"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Please Confirm</h1>';
|
||||
$output .= '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.<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deleteUserConfirm&uid='.$session{form}{uid}.'">Yes, I\'m sure.</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=listUsers">No, I made a mistake.</a></div>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=7"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$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>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=listUsers">'.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
|
|
@ -105,23 +109,28 @@ sub www_editUser {
|
|||
tie %hash, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
%user = WebGUI::SQL->quickHash("select * from users where userId=$session{form}{uid}",$session{dbh});
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=6"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit User</h1> <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=6"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(168).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editUserSave");
|
||||
$output .= WebGUI::Form::hidden("uid",$session{form}{uid});
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Username</td><td>'.WebGUI::Form::text("username",20,30,$user{username}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Password</td><td>'.WebGUI::Form::password("identifier",20,30,"password").'</td></tr>';
|
||||
$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>';
|
||||
%hash = ('WebGUI'=>'WebGUI', 'LDAP'=>'LDAP');
|
||||
$array[0] = $user{authMethod};
|
||||
$output .= '<tr><td class="formDescription" valign="top">Authentication Method</td><td>'.WebGUI::Form::selectList("authMethod",\%hash,\@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">LDAP URL</td><td>'.WebGUI::Form::text("ldapURL",20,2048,$user{ldapURL}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Connect DN</td><td>'.WebGUI::Form::text("connectDN",20,255,$user{connectDN}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">Email Address</td><td>'.WebGUI::Form::text("email",20,255,$user{email}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top"><a href="http://www.icq.com">ICQ</a> UIN</td><td>'.WebGUI::Form::text("icq",20,30,$user{icq}).'</td></tr>';
|
||||
$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">Groups</td><td>'.WebGUI::Form::selectList("groups",\%hash,\@array,5,1).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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});
|
||||
@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></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table>';
|
||||
$output .= '</form> ';
|
||||
} else {
|
||||
|
|
@ -139,7 +148,7 @@ sub www_editUserSave {
|
|||
$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}).", icq=".quote($session{form}{icq})." where userId=".$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})." 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) {
|
||||
|
|
@ -153,15 +162,25 @@ sub www_editUserSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_listUsers {
|
||||
my ($output, $sth, @data, @row, $pn, $i, $itemsPerPage);
|
||||
my ($output, $sth, @data, @row, $pn, $i, $itemsPerPage, $search);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$itemsPerPage = 50;
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=8"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Users</h1>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=addUser">Add a new user.</a></div>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=8"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$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 .= WebGUI::Form::hidden("op","listUsers");
|
||||
$output .= WebGUI::Form::text("keyword",20,50);
|
||||
$output .= WebGUI::Form::submit(WebGUI::International::get(170));
|
||||
$output .= '</td></form></tr></table><p>';
|
||||
if ($session{form}{keyword} ne "") {
|
||||
$search = " and (username like '%".$session{form}{keyword}."%' or email like '%".$session{form}{keyword}."%') ";
|
||||
}
|
||||
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
|
||||
$sth = WebGUI::SQL->read("select userId,username,email from users where username<>'Reserved' order by username",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select userId,username,email from users where username<>'Reserved' $search order by username",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
$row[$i] = '<tr><td><a href="'.$session{page}{url}.'?op=deleteUser&uid='.$data[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?op=editUser&uid='.$data[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a></td>';
|
||||
$row[$i] = '<tr class="tableData"><td><a href="'.$session{page}{url}.'?op=deleteUser&uid='.$data[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?op=editUser&uid='.$data[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a></td>';
|
||||
#$row[$i] .= '<td><a href="'.$session{page}{url}.'?op=viewUserProfile&uid='.$data[0].'">'.$data[1].'</a></td>';
|
||||
$row[$i] .= '<td>'.$data[1].'</td>';
|
||||
$row[$i] .= '<td><a href="mailto:'.$data[2].'">'.$data[2].'</a></td></tr>';
|
||||
|
|
@ -178,15 +197,15 @@ sub www_listUsers {
|
|||
$output .= '</table>';
|
||||
$output .= '<div class="pagination">';
|
||||
if ($pn > 0) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn-1).'&op=listUsers">«Previous Page</a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn-1).'&op=listUsers">«'.WebGUI::International::get(91).'</a>';
|
||||
} else {
|
||||
$output .= '«Previous Page';
|
||||
$output .= '«'.WebGUI::International::get(91);
|
||||
}
|
||||
$output .= ' · ';
|
||||
if ($pn < round($#row/$itemsPerPage)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn+1).'&op=listUsers">Next Page»</a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn+1).'&op=listUsers">'.WebGUI::International::get(92).'»</a>';
|
||||
} else {
|
||||
$output .= 'Next Page»';
|
||||
$output .= WebGUI::International::get(92).'»';
|
||||
}
|
||||
$output .= '</div>';
|
||||
return $output;
|
||||
|
|
@ -197,3 +216,4 @@ sub www_listUsers {
|
|||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ package WebGUI::Privilege;
|
|||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Utility;
|
||||
|
|
@ -19,7 +20,9 @@ use WebGUI::Utility;
|
|||
#-------------------------------------------------------------------
|
||||
sub adminOnly {
|
||||
my ($output, $sth, @data);
|
||||
$output = '<h1>Administrative Function</h1>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:<ul>';
|
||||
$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});
|
||||
while (@data = $sth->array) {
|
||||
$output .= '<li>'.$data[0].' (<a href="mailto:'.$data[1].'">'.$data[1].'</a>)';
|
||||
|
|
@ -68,7 +71,12 @@ sub canViewPage {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub insufficient {
|
||||
return '<h1>Permission Denied!</h1>You do not have sufficient privileges to perform this operation. Please <a href="'.$session{page}{url}.'?op=displayLogin">log in with an account</a> that has sufficient privileges before attempting this operation.<p>';
|
||||
my ($output);
|
||||
$output = '<h1>'.WebGUI::International::get(37).'</h1>';
|
||||
$output .= WebGUI::International::get(37);
|
||||
$output .= '<p>';
|
||||
$output = WebGUI::Macro::process($output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -85,9 +93,22 @@ sub isInGroup {
|
|||
return $result;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub noAccess {
|
||||
my ($output);
|
||||
$output = '<h1>'.WebGUI::International::get(37).'</h1>';
|
||||
$output .= WebGUI::International::get(39);
|
||||
$output .= '<p>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub vitalComponent {
|
||||
return '<h1>Vital Component</h1>You\'re attempting to remove a vital component of the WebGUI system. If you were allowed to continue WebGUI may cease to function.<p>';
|
||||
my ($output);
|
||||
$output = '<h1>'.WebGUI::International::get(40).'</h1>';
|
||||
$output .= WebGUI::International::get(41);
|
||||
$output .= '<p>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ use WebGUI::ErrorHandler;
|
|||
|
||||
# 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.
|
||||
# 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.
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub array {
|
||||
|
|
@ -44,7 +45,11 @@ sub buildHash {
|
|||
tie %hash, "Tie::IxHash";
|
||||
$sth = WebGUI::SQL->read($_[1],$_[2]);
|
||||
while (@data = $sth->array) {
|
||||
$hash{$data[0]} = $data[1];
|
||||
if ($data[1] eq "") {
|
||||
$hash{$data[0]} = $data[0];
|
||||
} else {
|
||||
$hash{$data[0]} = $data[1];
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
return %hash;
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@ sub getStyle {
|
|||
<head>
|
||||
<title>'.$session{page}{title}.'</title>
|
||||
'.$style{styleSheet}.'
|
||||
'.$session{page}{metaTags}.'
|
||||
<script language="JavaScript" src="'.$session{setting}{lib}.'/WebGUI.js"></script>
|
||||
</head>
|
||||
'.$session{page}{metaTags}
|
||||
# .'<script language="JavaScript" src="'.$session{setting}{lib}.'/WebGUI.js"></script>'
|
||||
.'</head>
|
||||
'.$style{header};
|
||||
$footer = $style{footer}.'
|
||||
</html>';
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ use CGI::Carp qw(fatalsToBrowser);
|
|||
use DBI;
|
||||
use Exporter;
|
||||
use strict;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Utility;
|
||||
|
|
@ -66,10 +67,16 @@ sub www_cut {
|
|||
sub www_delete {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=14"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Please Confirm</h1>';
|
||||
$output .= 'Are you certain that you wish to delete this content?<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?func=deleteConfirm&wid='.$session{form}{wid}.'">Yes, I\'m sure.</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'">No, I made a mistake.</a></div>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=14"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(43);
|
||||
$output .= '<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?func=deleteConfirm&wid='.$session{form}{wid}.'">';
|
||||
$output .= WebGUI::International::get(44);
|
||||
$output .= '</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::International::get(45);
|
||||
$output .= '</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ package WebGUI::Widget::Article;
|
|||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
|
|
@ -28,7 +29,7 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub widgetName {
|
||||
return "Article";
|
||||
return WebGUI::International::get(172);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -36,23 +37,23 @@ sub www_add {
|
|||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=23"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>Add '.widgetName().'</h1>';
|
||||
$output .= '<h1>'.WebGUI::International::get(173).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","Article");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,'Article').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Process macros?</td><td>'.WebGUI::Form::checkbox("processMacros",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Start Date</td><td>'.WebGUI::Form::text("startDate",20,30,epochToSet(time()),1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">End Date</td><td>'.WebGUI::Form::text("endDate",20,30,'01/01/2037',1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Body</td><td>'.WebGUI::Form::textArea("body",'',50,10,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Image</td><td>'.WebGUI::Form::file("image").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Link Title</td><td>'.WebGUI::Form::text("linkTitle",20,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Link URL</td><td>'.WebGUI::Form::text("linkURL",20,2048).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Attachment</td><td>'.WebGUI::Form::file("attachment").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Convert Carriage Returns</td><td>'.WebGUI::Form::checkbox("convertCarriageReturns",1).' <span style="font-size: 8pt;">(check if you\'re not adding <br> manually)</span></td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'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 .= '<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,30).'</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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -63,7 +64,7 @@ sub www_add {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_addSave {
|
||||
my ($widgetId, $displayTitle, $image, $attachment);
|
||||
my ($widgetId, $image, $attachment);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$widgetId = create();
|
||||
$image = saveAttachment("image",$widgetId);
|
||||
|
|
@ -102,31 +103,31 @@ sub www_edit {
|
|||
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=24"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>Edit '.widgetName().'</h1>';
|
||||
$output .= '<h1>'.WebGUI::International::get(185).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,$article{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$article{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Process macros?</td><td>'.WebGUI::Form::checkbox("processMacros","1",$article{processMacros}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Start Date</td><td>'.WebGUI::Form::text("startDate",20,30,epochToSet($article{startDate}),1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">End Date</td><td>'.WebGUI::Form::text("endDate",20,30,epochToSet($article{endDate}),1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Body</td><td>'.WebGUI::Form::textArea("body",$article{body},50,10,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,$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 .= '<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">Image</td><td><a href="'.$session{page}{url}.'?func=deleteImage&wid='.$session{form}{wid}.'">Delete Image</a></td></tr>';
|
||||
$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>';
|
||||
} else {
|
||||
$output .= '<tr><td class="formDescription">Image</td><td>'.WebGUI::Form::file("image").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(179).'</td><td>'.WebGUI::Form::file("image").'</td></tr>';
|
||||
}
|
||||
$output .= '<tr><td class="formDescription">Link Title</td><td>'.WebGUI::Form::text("linkTitle",20,30,$article{linkTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Link URL</td><td>'.WebGUI::Form::text("linkURL",20,2048,$article{linkURL}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(180).'</td><td>'.WebGUI::Form::text("linkTitle",20,30,$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">Attachment</td><td><a href="'.$session{page}{url}.'?func=deleteAttachment&wid='.$session{form}{wid}.'">Delete Attachment</a></td></tr>';
|
||||
$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>';
|
||||
} else {
|
||||
$output .= '<tr><td class="formDescription">Attachment</td><td>'.WebGUI::Form::file("attachment").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(182).'</td><td>'.WebGUI::Form::file("attachment").'</td></tr>';
|
||||
}
|
||||
$output .= '<tr><td class="formDescription">Convert Carriage Returns</td><td>'.WebGUI::Form::checkbox("convertCarriageReturns",1,$article{convertCarriageReturns}).' <span style="font-size: 8pt;">(check if you\'re not adding <br> manually)</span></td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -136,7 +137,7 @@ sub www_edit {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editSave {
|
||||
my ($widgetId, $displayTitle, $image, $attachment);
|
||||
my ($image, $attachment);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
update();
|
||||
$image = saveAttachment("image",$session{form}{wid});
|
||||
|
|
@ -187,7 +188,5 @@ sub www_view {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ package WebGUI::Widget::EventsCalendar;
|
|||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
|
|
@ -28,22 +29,24 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub widgetName {
|
||||
return "Events Calendar";
|
||||
return WebGUI::International::get(187);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=38"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Events Calendar</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=38"><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 .= WebGUI::Form::hidden("widget","EventsCalendar");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,'Events Calendar').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Process macros?</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description").'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'Events Calendar').'</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 .= '<tr><td class="formDescription">'.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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -67,19 +70,23 @@ sub www_addSave {
|
|||
sub www_addEvent {
|
||||
my ($output, $today, %recursEvery);
|
||||
tie %recursEvery, 'Tie::IxHash';
|
||||
%recursEvery = ('never'=>'Happens Only Once','day'=>'Day','week'=>'Week');
|
||||
%recursEvery = ('never'=>WebGUI::International::get(189),
|
||||
'day'=>WebGUI::International::get(190),
|
||||
'week'=>WebGUI::International::get(191)
|
||||
);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
($today) = epochToSet(time());
|
||||
$output = '<h1>Add Event</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<h1>'.WebGUI::International::get(192).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","addEventSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Name</td><td>'.WebGUI::Form::text("name",20,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",'',50,10,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Start Date</td><td>'.WebGUI::Form::text("startDate",20,30,$today,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">End Date</td><td>'.WebGUI::Form::text("endDate",20,30,$today,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Recurs every</td><td>'.WebGUI::Form::selectList("recursEvery",\%recursEvery).' until '.WebGUI::Form::text("until",20,30,$today,1).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("name",20,30).'</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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -130,12 +137,12 @@ sub www_addEventSave {
|
|||
sub www_deleteEvent {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<h1>Please Confirm</h1>';
|
||||
$output .= 'Are you certain that you want to delete this event';
|
||||
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(195);
|
||||
if ($session{form}{rid} > 0) {
|
||||
$output .= ' <b>and</b> all of its recurring events';
|
||||
$output .= ' '.WebGUI::International::get(196);
|
||||
}
|
||||
$output .= '?<p><div align="center"><a href="'.$session{page}{url}.'?func=deleteEventConfirm&wid='.$session{form}{wid}.'&eid='.$session{form}{eid}.'&rid='.$session{form}{rid}.'">Yes, I\'m sure.</a> <a href="'.$session{page}{url}.'?func=edit&wid='.$session{form}{wid}.'">No, I made a mistake.</a></div>';
|
||||
$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> <a href="'.$session{page}{url}.'?func=edit&wid='.$session{form}{wid}.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -163,15 +170,17 @@ sub www_edit {
|
|||
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=39"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Events Calendar</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=39"><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}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,$data{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Process macros?</td><td>'.WebGUI::Form::checkbox("processMacros",1,$data{processMacros}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",$data{description}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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(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}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$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>';
|
||||
|
|
@ -203,17 +212,18 @@ sub www_editEvent {
|
|||
tie %event, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%event = WebGUI::SQL->quickHash("select * from event where eventId='$session{form}{eid}'",$session{dbh});
|
||||
$output = '<h1>Edit Event</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<h1>'.WebGUI::International::get(198).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$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">Name</td><td>'.WebGUI::Form::text("name",20,30,$event{name}).'</td></tr>'
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("name",20,30,$event{name}).'</td></tr>'
|
||||
;
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",$event{description},50,10,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Start Date</td><td>'.WebGUI::Form::text("startDate",20,30,epochToSet($event{startDate}),1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">End Date</td><td>'.WebGUI::Form::text("endDate",20,30,epochToSet($event{endDate}),1).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ package WebGUI::Widget::ExtraColumn;
|
|||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -26,22 +27,24 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub widgetName {
|
||||
return "Extra Column";
|
||||
return WebGUI::International::get(199);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=25"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Column</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=25"><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 .= WebGUI::Form::hidden("widget","ExtraColumn");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= WebGUI::Form::hidden("title","column");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Spacer</td><td>'.WebGUI::Form::text("spacer",20,3,10).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Width</td><td>'.WebGUI::Form::text("width",20,3,200).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">StyleSheet Class</td><td>'.WebGUI::Form::text("class",20,50,"content").'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -68,15 +71,17 @@ sub www_edit {
|
|||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%data = WebGUI::SQL->quickHash("select * from ExtraColumn where widgetId=$session{form}{wid}",$session{dbh});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=26"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Column</h1><form method="post" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=26"><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}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= WebGUI::Form::hidden("title","column");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Spacer</td><td>'.WebGUI::Form::text("spacer",20,3,$data{spacer}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Width</td><td>'.WebGUI::Form::text("width",20,3,$data{width}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">StyleSheet Class</td><td>'.WebGUI::Form::text("class",20,30,$data{class}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</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,30,$data{class}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(204)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ package WebGUI::Widget::FAQ;
|
|||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
|
|
@ -38,22 +39,24 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub widgetName {
|
||||
return "F.A.Q.";
|
||||
return WebGUI::International::get(205);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<h1>Add F.A.Q.</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=40"><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 .= WebGUI::Form::hidden("widget","FAQ");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,'F.A.Q.').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Process Macros?</td><td>'.WebGUI::Form::checkbox("processMacros",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description").'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'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,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -77,13 +80,14 @@ sub www_addSave {
|
|||
sub www_addQuestion {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<h1>Add Question</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<h1>'.WebGUI::International::get(207).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","addQuestionSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Question</td><td>'.WebGUI::Form::textArea("question",'',50,3).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Answer</td><td>'.WebGUI::Form::textArea("answer").'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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").'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -109,8 +113,10 @@ sub www_addQuestionSave {
|
|||
sub www_deleteQuestion {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<h1>Please Confirm</h1>';
|
||||
$output .= 'Are you certain that you want to delete this question?<p><div align="center"><a href="'.$session{page}{url}.'?func=deleteQuestionConfirm&wid='.$session{form}{wid}.'&qid='.$session{form}{qid}.'">Yes, I\'m sure.</a> <a href="'.$session{page}{url}.'?func=edit&wid='.$session{form}{wid}.'">No, I made a mistake.</a></div>';
|
||||
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(210).'<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 .= ' <a href="'.$session{page}{url}.'?func=edit&wid='.$session{form}{wid}.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -135,17 +141,19 @@ sub www_edit {
|
|||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%data = WebGUI::SQL->quickHash("select * from widget where widget.widgetId=$session{form}{wid}",$session{dbh});
|
||||
$output = '<h1>Edit Link List</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=41"><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}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,$data{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Process macros?</td><td>'.WebGUI::Form::checkbox("processMacros","1",$data{processMacros}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",$data{description}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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(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}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
$output .= '<p><a href="'.$session{page}{url}.'?func=addQuestion&wid='.$session{form}{wid}.'">Add New Question</a><p>';
|
||||
$output .= '<p><a href="'.$session{page}{url}.'?func=addQuestion&wid='.$session{form}{wid}.'">'.WebGUI::International::get(212).'</a><p>';
|
||||
$output .= '<table border=1 cellpadding=3 cellspacing=0>';
|
||||
$sth = WebGUI::SQL->read("select questionId,question from faqQuestion where widgetId='$session{form}{wid}' order by sequenceNumber",$session{dbh});
|
||||
while (@question = $sth->array) {
|
||||
|
|
@ -175,14 +183,15 @@ sub www_editQuestion {
|
|||
tie %question, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%question = WebGUI::SQL->quickHash("select * from faqQuestion where questionId='$session{form}{qid}'",$session{dbh});
|
||||
$output = '<h1>Edit Question</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<h1>'.WebGUI::International::get(213).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$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">Question</td><td>'.WebGUI::Form::textArea("question",$question{question},50,3).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Answer</td><td>'.WebGUI::Form::textArea("answer",$question{answer}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ package WebGUI::Widget::LinkList;
|
|||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
|
|
@ -38,22 +39,24 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub widgetName {
|
||||
return "Link List";
|
||||
return WebGUI::International::get(214);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=34"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Link List</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=34"><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 .= WebGUI::Form::hidden("widget","LinkList");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,'Link List').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Process macros?</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description").'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'Link List').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -77,14 +80,15 @@ sub www_addSave {
|
|||
sub www_addLink {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<h1>Add Link</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<h1>'.WebGUI::International::get(215).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","addLinkSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Name</td><td>'.WebGUI::Form::text("name",20,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">URL</td><td>'.WebGUI::Form::text("url",20,1024).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",'',50,10).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("name",20,30).'</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(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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -110,8 +114,10 @@ sub www_addLinkSave {
|
|||
sub www_deleteLink {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<h1>Please Confirm</h1>';
|
||||
$output .= 'Are you certain that you want to delete this link?<p><div align="center"><a href="'.$session{page}{url}.'?func=deleteLinkConfirm&wid='.$session{form}{wid}.'&lid='.$session{form}{lid}.'">Yes, I\'m sure.</a> <a href="'.$session{page}{url}.'?func=edit&wid='.$session{form}{wid}.'">No, I made a mistake.</a></div>';
|
||||
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(217).'<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 .= ' <a href="'.$session{page}{url}.'?func=edit&wid='.$session{form}{wid}.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -136,17 +142,19 @@ sub www_edit {
|
|||
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=35"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Link List</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=35"><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}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,$data{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Process macros?</td><td>'.WebGUI::Form::checkbox("processMacros",1,$data{processMacros}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",$data{description}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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("displayTitle",1,$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</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}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
$output .= '<p><a href="'.$session{page}{url}.'?func=addLink&wid='.$session{form}{wid}.'">Add New Link</a><p>';
|
||||
$output .= '<p><a href="'.$session{page}{url}.'?func=addLink&wid='.$session{form}{wid}.'">'.WebGUI::International::get(221).'</a><p>';
|
||||
$output .= '<table border=1 cellpadding=3 cellspacing=0>';
|
||||
$sth = WebGUI::SQL->read("select linkId, name from link where widgetId='$session{form}{wid}' order by sequenceNumber",$session{dbh});
|
||||
while (@link = $sth->array) {
|
||||
|
|
@ -176,15 +184,16 @@ sub www_editLink {
|
|||
tie %link, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%link = WebGUI::SQL->quickHash("select name, url, description from link where linkId='$session{form}{lid}'",$session{dbh});
|
||||
$output = '<h1>Edit Link</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<h1>'.WebGUI::International::get(220).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$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">Name</td><td>'.WebGUI::Form::text("name",20,30,$link{name}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">URL</td><td>'.WebGUI::Form::text("url",20,2048,$link{url}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",$link{description},50,10).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("name",20,30,$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(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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ package WebGUI::Widget::MessageBoard;
|
|||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -23,7 +25,7 @@ use WebGUI::Widget;
|
|||
sub _getBoardProperties {
|
||||
my (%board);
|
||||
tie %board, 'Tie::CPHash';
|
||||
%board = WebGUI::SQL->quickHash("select widget.title, widget.displayTitle, widget.description, MessageBoard.groupToPost, MessageBoard.messagesPerPage, MessageBoard.editTimeout from widget, MessageBoard where widget.widgetId=MessageBoard.widgetId and widget.widgetId=$_[0]",$session{dbh});
|
||||
%board = WebGUI::SQL->quickHash("select * from widget, MessageBoard where widget.widgetId=MessageBoard.widgetId and widget.widgetId=$_[0]",$session{dbh});
|
||||
return %board;
|
||||
}
|
||||
|
||||
|
|
@ -55,7 +57,7 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub widgetName {
|
||||
return "Message Board";
|
||||
return WebGUI::International::get(223);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -63,18 +65,21 @@ sub www_add {
|
|||
my ($output, %hash);
|
||||
tie %hash, "Tie::IxHash";
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=32"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Message Board</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=32"><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 .= WebGUI::Form::hidden("widget","MessageBoard");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,'Message Board').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",'').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'Message Board').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'').'</td></tr>';
|
||||
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName",$session{dbh});
|
||||
$output .= '<tr><td class="formDescription" valign="top">Who can post?</td><td>'.WebGUI::Form::selectList("groupToPost",\%hash,'',1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Messages Per Page</td><td>'.WebGUI::Form::text("messagesPerPage",20,2,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Edit Timeout</td><td>'.WebGUI::Form::text("editTimeout",20,3,1).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(224).'</td><td>'.WebGUI::Form::selectList("groupToPost",\%hash,'',1).'</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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -102,19 +107,22 @@ sub www_edit {
|
|||
if (WebGUI::Privilege::canEditPage()) {
|
||||
tie %board, 'Tie::CPHash';
|
||||
%board = _getBoardProperties($session{form}{wid});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=33"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Message Board</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=33"><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}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,$board{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$board{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",$board{description}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,$board{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$board{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</td><td>'.WebGUI::Form::checkbox("processMacros","1",$board{processMacros}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$board{description}).'</td></tr>';
|
||||
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName",$session{dbh});
|
||||
$array[0] = $board{groupToPost};
|
||||
$output .= '<tr><td class="formDescription" valign="top">Who can post?</td><td>'.WebGUI::Form::selectList("groupToPost",\%hash,\@array,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Messages Per Page</td><td>'.WebGUI::Form::text("messagesPerPage",20,2,$board{messagesPerPage}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Edit Timeout</td><td>'.WebGUI::Form::text("editTimeout",20,2,$board{editTimeout}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -146,14 +154,14 @@ sub www_editMessage {
|
|||
if ($board{displayTitle}) {
|
||||
$html .= $board{title};
|
||||
}
|
||||
$html .= '<td align="right" valign="bottom" class="boardMenu">Editing Message...</td></tr></table>';
|
||||
$html .= '<td align="right" valign="bottom" class="boardMenu">'.WebGUI::International::get(228).'</td></tr></table>';
|
||||
$html .= '<form action="'.$session{page}{url}.'" method="post"><table>';
|
||||
$html .= WebGUI::Form::hidden("func","editMessageSave");
|
||||
$html .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$html .= WebGUI::Form::hidden("mid",$session{form}{mid});
|
||||
$html .= '<tr><td class="formDescription">Subject</td><td>'.WebGUI::Form::text("subject",30,255,$message{subject}).'</td></tr>';
|
||||
$html .= '<tr><td class="formDescription" valign="top">Message</td><td>'.WebGUI::Form::textArea("message",$message{message},50,6,1).'</td></tr>';
|
||||
$html .= '<tr><td></td><td>'.WebGUI::Form::submit("Save This Edit").'</td></tr>';
|
||||
$html .= '<tr><td class="formDescription">'.WebGUI::International::get(229).'</td><td>'.WebGUI::Form::text("subject",30,255,$message{subject}).'</td></tr>';
|
||||
$html .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(230).'</td><td>'.WebGUI::Form::textArea("message",$message{message},50,6,1).'</td></tr>';
|
||||
$html .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$html .= '</table></form>';
|
||||
$html .= www_showMessage();
|
||||
} else {
|
||||
|
|
@ -169,10 +177,10 @@ sub www_editMessageSave {
|
|||
%board = _getBoardProperties($session{form}{wid});
|
||||
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
|
||||
if ($session{form}{subject} eq "") {
|
||||
$session{form}{subject} = 'no subject';
|
||||
$session{form}{subject} = WebGUI::International::get(232);
|
||||
}
|
||||
if ($session{form}{message} eq "") {
|
||||
$session{form}{subject} .= ' (eom)';
|
||||
$session{form}{subject} .= ' '.WebGUI::International::get(233);
|
||||
}
|
||||
WebGUI::SQL->write("update message set subject=".quote($session{form}{subject}).", message=".quote("\n --- (Edited at ".localtime(time).") --- \n\n".$session{form}{message})." where messageId=$session{form}{mid}",$session{dbh});
|
||||
return www_showMessage();
|
||||
|
|
@ -191,13 +199,13 @@ sub www_postNewMessage {
|
|||
if ($board{displayTitle}) {
|
||||
$html .= $board{title};
|
||||
}
|
||||
$html .= '<td align="right" valign="bottom" class="boardMenu">Posting New Message...</td></tr></table>';
|
||||
$html .= '<td align="right" valign="bottom" class="boardMenu">'.WebGUI::International::get(231).'</td></tr></table>';
|
||||
$html .= '<form action="'.$session{page}{url}.'" method="post"><table>';
|
||||
$html .= WebGUI::Form::hidden("func","postNewMessageSave");
|
||||
$html .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$html .= '<tr><td class="formDescription">Subject</td><td>'.WebGUI::Form::text("subject",30,255).'</td></tr>';
|
||||
$html .= '<tr><td class="formDescription" valign="top">Message</td><td>'.WebGUI::Form::textArea("message",'',50,6,1).'</td></tr>';
|
||||
$html .= '<tr><td></td><td>'.WebGUI::Form::submit("Post This Message").'</td></tr>';
|
||||
$html .= '<tr><td class="formDescription">'.WebGUI::International::get(229).'</td><td>'.WebGUI::Form::text("subject",30,255).'</td></tr>';
|
||||
$html .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(230).'</td><td>'.WebGUI::Form::textArea("message",'',50,6,1).'</td></tr>';
|
||||
$html .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$html .= '</table></form>';
|
||||
} else {
|
||||
$html = WebGUI::Privilege::insufficient();
|
||||
|
|
@ -212,10 +220,10 @@ sub www_postNewMessageSave {
|
|||
%board = _getBoardProperties($session{form}{wid});
|
||||
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
|
||||
if ($session{form}{subject} eq "") {
|
||||
$session{form}{subject} = 'no subject';
|
||||
$session{form}{subject} = WebGUI::International::get(232);
|
||||
}
|
||||
if ($session{form}{message} eq "") {
|
||||
$session{form}{subject} .= ' (eom)';
|
||||
$session{form}{subject} .= ' '.WebGUI::International::get(233);
|
||||
}
|
||||
$mid = getNextId("messageId");
|
||||
WebGUI::SQL->write("insert into message values ($mid, $mid, $session{form}{wid}, 0, $session{user}{userId}, ".quote($session{user}{username}).", ".quote($session{form}{subject}).", ".quote($session{form}{message}).", ".time().")",$session{dbh});
|
||||
|
|
@ -237,14 +245,14 @@ sub www_postReply {
|
|||
if ($board{displayTitle}) {
|
||||
$html .= $board{title};
|
||||
}
|
||||
$html .= '<td align="right" valign="bottom" class="boardMenu">Posting Reply...</td></tr></table>';
|
||||
$html .= '<td align="right" valign="bottom" class="boardMenu">'.WebGUI::International::get(234).'</td></tr></table>';
|
||||
$html .= '<form action="'.$session{page}{url}.'" method="post"><table>';
|
||||
$html .= WebGUI::Form::hidden("func","postReplySave");
|
||||
$html .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$html .= WebGUI::Form::hidden("mid",$session{form}{mid});
|
||||
$html .= '<tr><td class="formDescription">Subject</td><td>'.WebGUI::Form::text("subject",30,255,$subject).'</td></tr>';
|
||||
$html .= '<tr><td class="formDescription" valign="top">Message</td><td>'.WebGUI::Form::textArea("message",'',50,6,1).'</td></tr>';
|
||||
$html .= '<tr><td></td><td>'.WebGUI::Form::submit("Post This Reply").'</td></tr>';
|
||||
$html .= '<tr><td class="formDescription">'.WebGUI::International::get(229).'</td><td>'.WebGUI::Form::text("subject",30,255,$subject).'</td></tr>';
|
||||
$html .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(230).'</td><td>'.WebGUI::Form::textArea("message",'',50,6,1).'</td></tr>';
|
||||
$html .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$html .= '</table></form>';
|
||||
$html .= www_showMessage();
|
||||
} else {
|
||||
|
|
@ -260,10 +268,10 @@ sub www_postReplySave {
|
|||
%board = _getBoardProperties($session{form}{wid});
|
||||
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
|
||||
if ($session{form}{subject} eq "") {
|
||||
$session{form}{subject} = 'no subject';
|
||||
$session{form}{subject} = WebGUI::International::get(232);
|
||||
}
|
||||
if ($session{form}{message} eq "") {
|
||||
$session{form}{subject} .= ' (eom)';
|
||||
$session{form}{subject} .= ' '.WebGUI::International::get(233);
|
||||
}
|
||||
$mid = getNextId("messageId");
|
||||
($rid) = WebGUI::SQL->quickArray("select rid from message where messageId=$session{form}{mid}",$session{dbh});
|
||||
|
|
@ -287,14 +295,14 @@ sub www_showMessage {
|
|||
}
|
||||
$html .= '</td><td align="right" valign="bottom" class="boardMenu">';
|
||||
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}.'">Edit Message</a> · ';
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=editMessage&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(235).'</a> · ';
|
||||
}
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=postReply&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">Post Reply</a></td></tr></table>';
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=postReply&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(236).'</a></td></tr></table>';
|
||||
$html .= '<table width="100%"><tr><td class="tableHeader">';
|
||||
$html .= "<b>Subject:</b> ".$message{subject}."<br>";
|
||||
$html .= "<b>Author:</b> ".$message{username}."<br>";
|
||||
$html .= "<b>Date:</b> ".epochToHuman($message{dateOfPost},"%w, %c %D, %y at %H:%n%p")."<br>";
|
||||
$html .= "<b>Message ID:</b> ".$message{widgetId}."-".$message{rid}."-".$message{pid}."-".$message{messageId}."<br>";
|
||||
$html .= "<b>".WebGUI::International::get(237)."</b> ".$message{subject}."<br>";
|
||||
$html .= "<b>".WebGUI::International::get(238)."</b> ".$message{username}."<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 .= '</td>';
|
||||
$html .= '</tr><tr><td colspan=2 class="boardMessage">';
|
||||
$message{message} =~ s/\n/\<br\>/g;
|
||||
|
|
@ -302,19 +310,19 @@ sub www_showMessage {
|
|||
$html .= '</td></tr></table><p><div align="center" class="boardMenu">';
|
||||
@data = WebGUI::SQL->quickArray("select max(messageId) from message where widgetId=$message{widgetId} and pid=0 and messageId<$message{rid}",$session{dbh});
|
||||
if ($data[0] ne "") {
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">« Previous Thread</a>';
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">« '.WebGUI::International::get(241).'</a>';
|
||||
} else {
|
||||
$html .= '« Previous Thread</a>';
|
||||
$html .= '« '.WebGUI::International::get(241).'</a>';
|
||||
}
|
||||
$html .= ' · <a href="'.$session{page}{url}.'">Back To Message List</a> · ';
|
||||
$html .= ' · <a href="'.$session{page}{url}.'">'.WebGUI::International::get(242).'</a> · ';
|
||||
@data = WebGUI::SQL->quickArray("select min(messageId) from message where widgetId=$message{widgetId} and pid=0 and messageId>$message{rid}",$session{dbh});
|
||||
if ($data[0] ne "") {
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">Next Thread »</a>';
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(243).' »</a>';
|
||||
} else {
|
||||
$html .= 'Next Thread »';
|
||||
$html .= WebGUI::International::get(243).' »';
|
||||
}
|
||||
$html .= '</div><table border=0 cellpadding=2 cellspacing=1 width="100%">';
|
||||
$html .= '<tr><td class="tableHeader">Subject</td><td class="tableHeader">Author</td><td class="tableHeader">Date</td></tr>';
|
||||
$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 from message where messageId=$message{rid}",$session{dbh});
|
||||
$html .= '<tr';
|
||||
if ($session{form}{mid} eq $message{rid}) {
|
||||
|
|
@ -340,13 +348,16 @@ sub www_view {
|
|||
if ($board{description} ne "") {
|
||||
$html = $board{description}.'<p>';
|
||||
}
|
||||
if ($board{processMacros}) {
|
||||
$html = WebGUI::Macro::process($html);
|
||||
}
|
||||
$html .= '<table width="100%"><tr><td class="boardTitle">';
|
||||
if ($board{displayTitle}) {
|
||||
$html .= $board{title};
|
||||
}
|
||||
$html .= '</td><td align="right" valign="bottom" class="boardMenu"><a href="'.$session{page}{url}.'?func=postNewMessage&wid='.$_[0].'">Post New Message</a></td></tr></table>';
|
||||
$html .= '</td><td align="right" valign="bottom" class="boardMenu"><a href="'.$session{page}{url}.'?func=postNewMessage&wid='.$_[0].'">'.WebGUI::International::get(246).'</a></td></tr></table>';
|
||||
$html .= '<table border=0 cellpadding=2 cellspacing=1 width="100%">';
|
||||
$html .= '<tr><td class="tableHeader">Subject</td><td class="tableHeader">Author</td><td class="tableHeader">Thread Started</td><td class="tableHeader">Replies</td><td class="tableHeader">Last Reply</td></tr>';
|
||||
$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 message where widgetId=$_[0] group by rid order by messageId desc", $session{dbh});
|
||||
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost from message where widgetId=$_[0] and pid=0 order by messageId desc", $session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
|
|
@ -360,15 +371,15 @@ sub www_view {
|
|||
$html .= '</table>';
|
||||
$html .= '<div class="pagination">';
|
||||
if ($pn > 0) {
|
||||
$html .= '<a href="'.$session{page}{url}.'?pn='.($pn-1).'">«Previous Page</a>';
|
||||
$html .= '<a href="'.$session{page}{url}.'?pn='.($pn-1).'">«'.WebGUI::International::get(91).'</a>';
|
||||
} else {
|
||||
$html .= '«Previous Page';
|
||||
$html .= '«'.WebGUI::International::get(91);
|
||||
}
|
||||
$html .= ' · ';
|
||||
if (($pn+1) < round(($i/$itemsPerPage))) {
|
||||
$html .= '<a href="'.$session{page}{url}.'?pn='.($pn+1).'">Next Page»</a>';
|
||||
$html .= '<a href="'.$session{page}{url}.'?pn='.($pn+1).'">'.WebGUI::International::get(92).'»</a>';
|
||||
} else {
|
||||
$html .= 'Next Page»';
|
||||
$html .= WebGUI::International::get(92).'»';
|
||||
}
|
||||
$html .= '</div>';
|
||||
return $html;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ package WebGUI::Widget::Poll;
|
|||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -86,7 +87,7 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub widgetName {
|
||||
return "Poll";
|
||||
return WebGUI::International::get(250);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -94,20 +95,23 @@ sub www_add {
|
|||
my ($output, %hash);
|
||||
tie %hash, "Tie::IxHash";
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=28"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Poll</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=28"><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 .= WebGUI::Form::hidden("widget","Poll");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,'Poll').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",'').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Active</td><td>'.WebGUI::Form::checkbox("active",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'Poll').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</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(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 .= '<tr><td class="formDescription" valign="top">Who can vote?</td><td>'.WebGUI::Form::selectList("voteGroup",\%hash,).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Graph Width</td><td>'.WebGUI::Form::text("graphWidth",20,3,150).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Question</td><td>'.WebGUI::Form::text("question",50,255).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Answers<span><br>(Enter one answer per line. No more than 20.)</span></td><td>'.WebGUI::Form::textArea("answers",'',50,8,0,'on').'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(253).'</td><td>'.WebGUI::Form::selectList("voteGroup",\%hash,).'</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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -136,21 +140,24 @@ sub www_edit {
|
|||
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=29"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Poll</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=29"><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}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,$data{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",$data{description}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Active</td><td>'.WebGUI::Form::checkbox("active",1,$data{active}).'</td></tr>';
|
||||
$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("displayTitle",1,$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</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}).'</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});
|
||||
$array[0] = $data{voteGroup};
|
||||
$output .= '<tr><td class="formDescription" valign="top">Who can vote?</td><td>'.WebGUI::Form::selectList("voteGroup",\%hash,\@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Graph Width</td><td>'.WebGUI::Form::text("graphWidth",20,3,$data{graphWidth}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Question</td><td>'.WebGUI::Form::text("question",50,255,$data{question}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Answers<span><br>(Enter one answer per line. No more than 20.)</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("save").'</td></tr>';
|
||||
$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)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ package WebGUI::Widget::SQLReport;
|
|||
|
||||
use strict;
|
||||
use WebGUI::ErrorHandler;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
|
|
@ -27,7 +28,7 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub widgetName {
|
||||
return "SQL Report";
|
||||
return WebGUI::International::get(259);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -35,22 +36,22 @@ sub www_add {
|
|||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=20"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>Add '.widgetName().'</h1>';
|
||||
$output .= '<h1>'.WebGUI::International::get(260).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","SQLReport");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,'SQL Report').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Process macros?</td><td>'.WebGUI::Form::checkbox("processMacros",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",'','','',1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Template</td><td>'.WebGUI::Form::textArea("template",'','','',1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Query</td><td>'.WebGUI::Form::textArea("dbQuery",'').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">DSN</td><td>'.WebGUI::Form::text("DSN",20,255,$session{config}{dsn}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Database User</td><td>'.WebGUI::Form::text("username",20,255,$session{config}{dbuser}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Database Password</td><td>'.WebGUI::Form::password("identifier",20,255).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Convert carriage returns?</td><td>'.WebGUI::Form::checkbox("convertCarriageReturns",1).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'SQL Report').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</td><td>'.WebGUI::Form::checkbox("processMacros",1,1).'</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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -78,22 +79,22 @@ sub www_edit {
|
|||
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=22"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>Edit '.widgetName().'</h1>';
|
||||
$output .= '<h1>'.WebGUI::International::get(266).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,$data{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Process macros?</td><td>'.WebGUI::Form::checkbox("processMacros","1",$data{processMacros}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",$data{description},50,10,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Template</td><td>'.WebGUI::Form::textArea("template",$data{template},50,10,1).'</td></tr>';
|
||||
$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("displayTitle","1",$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</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,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">DSN</td><td>'.WebGUI::Form::text("DSN",20,255,$data{DSN}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Database User</td><td>'.WebGUI::Form::text("username",20,255,$data{username}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Database Password</td><td>'.WebGUI::Form::password("identifier",20,255,$data{identifier}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Convert carriage returns?</td><td>'.WebGUI::Form::checkbox("convertCarriageReturns",1,$data{convertCarriageReturns}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -131,14 +132,14 @@ sub www_view {
|
|||
if ($data{DSN} =~ /\DBI\:\w+\:\w+/) {
|
||||
$dbh = DBI->connect($data{DSN},$data{username},$data{identifier});
|
||||
} else {
|
||||
$output .= '<b>Error</b>: The DSN specified is of an improper format.<p>';
|
||||
$output .= WebGUI::International::get(267).'<p>';
|
||||
WebGUI::ErrorHandler::warn("SQLReport [$widgetId] The DSN specified is of an improper format.");
|
||||
}
|
||||
if (defined $dbh) {
|
||||
if ($data{dbQuery} =~ /select/i) {
|
||||
$sth = WebGUI::SQL->read($data{dbQuery},$dbh);
|
||||
} else {
|
||||
$output .= '<b>Error</b>: The SQL query is improperly formatted.<p>';
|
||||
$output .= WebGUI::International::get(268).'<p>';
|
||||
WebGUI::ErrorHandler::warn("SQLReport [$widgetId] The SQL query is improperly formatted.");
|
||||
}
|
||||
if (defined $sth) {
|
||||
|
|
@ -152,12 +153,12 @@ sub www_view {
|
|||
}
|
||||
$sth->finish;
|
||||
} else {
|
||||
$output .= '<b>Error</b>: There was a problem with the query.<p>';
|
||||
$output .= WebGUI::International::get(269).'<p>';
|
||||
WebGUI::ErrorHandler::warn("SQLReport [$widgetId] There was a problem with the query.");
|
||||
}
|
||||
$dbh->disconnect();
|
||||
} else {
|
||||
$output .= '<b>Error</b>: Could not connect to remote database.<p>';
|
||||
$output .= WebGUI::International::get(270).'<p>';
|
||||
WebGUI::ErrorHandler::warn("SQLReport [$widgetId] Could not connect to remote database.");
|
||||
}
|
||||
$output .= $template[2];
|
||||
|
|
|
|||
|
|
@ -1,168 +0,0 @@
|
|||
package WebGUI::Widget::SearchMnoGo;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# 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 DBI;
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Widget;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _mnogoSearch {
|
||||
my ($i, %match, $key, $sth, $dbh, $urlId, %data, $output, @keyword, $word, %result);
|
||||
tie %match, 'Tie::CPHash';
|
||||
%data = @_;
|
||||
@keyword = split(/ /,$session{form}{query});
|
||||
if ($data{DSN} =~ /\DBI\:\w+\:\w+/) {
|
||||
$dbh = DBI->connect($data{DSN},$data{username},$data{identifier});
|
||||
} else {
|
||||
$output .= '<b>Error</b>: The DSN specified is of an improper format.<p>';
|
||||
WebGUI::ErrorHandler::warn("Search (MnoGo) The DSN specified is of an improper format.");
|
||||
}
|
||||
if (defined $dbh) {
|
||||
foreach $word (@keyword) {
|
||||
$sth = WebGUI::SQL->read("select url_id from dict where soundex(word)=soundex(lcase('$word'))",$dbh);
|
||||
if (defined $sth) {
|
||||
while (($urlId) = $sth->array) {
|
||||
$result{$urlId}++;
|
||||
}
|
||||
$sth->finish;
|
||||
} else {
|
||||
$output .= '<b>Error</b>: There was a problem with the query.<p>';
|
||||
WebGUI::ErrorHandler::warn("Search (MnoGo) There was a problem with the query.");
|
||||
}
|
||||
}
|
||||
foreach $key (sort {$result{$b} <=> $result{$a}} keys %result) {
|
||||
if ($i < 50) {
|
||||
%match = WebGUI::SQL->quickHash("select url,title,txt from url where rec_id=$key",$dbh);
|
||||
$output .= '<a href="'.$match{url}.'">'.$match{title}.'</a> ('.$result{$key}.')<br>'.$match{txt}.'<br><a href="'.$match{url}.'">'.$match{url}.'</a><p>';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$dbh->disconnect();
|
||||
} else {
|
||||
$output .= '<b>Error</b>: Could not connect to remote database.<p>';
|
||||
WebGUI::ErrorHandler::warn("Search (MnoGo) Could not connect to remote database.");
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub purge {
|
||||
WebGUI::SQL->write("delete from SearchMnoGo where widgetId=$_[0]",$_[1]);
|
||||
purgeWidget($_[0],$_[1]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub widgetName {
|
||||
return "Search (MnoGo)";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=42"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Search (MnoGo)</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","SearchMnoGo");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,'Search (MnoGo)').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",'',50,5,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">DSN</td><td>'.WebGUI::Form::text("DSN",20,255,$session{config}{dsn}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Database User</td><td>'.WebGUI::Form::text("username",20,255,$session{config}{dbuser}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Database Password</td><td>'.WebGUI::Form::password("identifier",20,255).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_addSave {
|
||||
my ($widgetId);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$widgetId = create();
|
||||
WebGUI::SQL->write("insert into SearchMnoGo values ($widgetId, ".quote($session{form}{DSN}).", ".quote($session{form}{username}).", ".quote($session{form}{identifier}).")",$session{dbh});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my ($output, %data);
|
||||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%data = WebGUI::SQL->quickHash("select * from widget,SearchMnoGo where widget.widgetId=SearchMnoGo.widgetId and widget.widgetId=$session{form}{wid}",$session{dbh});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=43"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Search (MnoGo)</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,$data{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",$data{description},50,10,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">DSN</td><td>'.WebGUI::Form::text("DSN",20,255,$data{DSN}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Database Username</td><td>'.WebGUI::Form::text("username",20,255,$data{username}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Database Password</td><td>'.WebGUI::Form::password("identifier",20,255,$data{identifier}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editSave {
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
update();
|
||||
WebGUI::SQL->write("update SearchMnoGo set DSN=".quote($session{form}{DSN}).", username=".quote($session{form}{username}).", identifier=".quote($session{form}{identifier})." where widgetId=$session{form}{wid}",$session{dbh});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my (%data, @test, $output, $widgetId);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$widgetId = shift;
|
||||
%data = WebGUI::SQL->quickHash("select * from widget,SearchMnoGo where widget.widgetId='$widgetId' and widget.WidgetId=SearchMnoGo.widgetId",$session{dbh});
|
||||
if (%data) {
|
||||
if ($data{displayTitle} == 1) {
|
||||
$output = "<h1>".$data{title}."</h1>";
|
||||
}
|
||||
if ($data{description} ne "") {
|
||||
$output .= $data{description}.'<p>';
|
||||
}
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::text("query",20,255,$session{form}{query});
|
||||
$output .= WebGUI::Form::submit("search");
|
||||
$output .= '</form>';
|
||||
$output .= _mnogoSearch(%data);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
|
@ -12,6 +12,7 @@ package WebGUI::Widget::SiteMap;
|
|||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ package WebGUI::Widget::SyndicatedContent;
|
|||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
|
|
@ -28,22 +29,25 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub widgetName {
|
||||
return "Syndicated Content";
|
||||
return WebGUI::International::get(271);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=36"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Syndicated Content</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=36"><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 .= WebGUI::Form::hidden("widget","SyndicatedContent");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,'Syndicated Content').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",'','','',1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">URL to RSS File</td><td>'.WebGUI::Form::text("rssUrl",20,2048).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'Syndicated Content').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -70,18 +74,21 @@ sub www_edit {
|
|||
tie %data, 'Tie::CPHash';
|
||||
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=37"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Syndicated Content</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=37"><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}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,$data{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",$data{description},50,10,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">URL to RSS File</td><td>'.WebGUI::Form::text("rssUrl",20,2048,$data{rssUrl}).'</td></tr>';
|
||||
$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("displayTitle","1",$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</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,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 .= '<tr><td><br></td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Last Fetched</td><td>'.WebGUI::DateTime::epochToHuman($data{lastFetched},"%m/%d/%y %h:%n%p").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Current Content</td><td>'.$data{content}.'</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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -115,6 +122,9 @@ sub www_view {
|
|||
}
|
||||
$output .= $data{content};
|
||||
}
|
||||
if ($data{processMacros}) {
|
||||
$output = WebGUI::Macro::process($output);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ package WebGUI::Widget::UserSubmission;
|
|||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -28,7 +30,7 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub widgetName {
|
||||
return "User Submission System";
|
||||
return WebGUI::International::get(277);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -36,19 +38,22 @@ sub www_add {
|
|||
my ($output, %hash);
|
||||
tie %hash, "Tie::IxHash";
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=44"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add User Submission System</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=44"><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 .= WebGUI::Form::hidden("widget","UserSubmission");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,'User Submission System').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle","1").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",'',50,5,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'User Submission System').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</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 .= '<tr><td class="formDescription" valign="top">Who can contribute?</td><td>'.WebGUI::Form::selectList("groupToContribute",\%hash,'',1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Submissions Per Page</td><td>'.WebGUI::Form::text("submissionsPerPage",20,2,50).'</td></tr>';
|
||||
%hash = ("Approved"=>"Approved","Denied"=>"Denied","Pending"=>"Pending");
|
||||
$output .= '<tr><td class="formDescription" valign="top">Default Status</td><td>'.WebGUI::Form::selectList("defaultStatus",\%hash,'',1).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(279).'</td><td>'.WebGUI::Form::selectList("groupToContribute",\%hash,'',1).'</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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -74,19 +79,20 @@ sub www_addSubmission {
|
|||
my ($output, $groupToContribute, @submission, $sth);
|
||||
($groupToContribute) = WebGUI::SQL->quickArray("select groupToContribute from UserSubmission where widgetId=$session{form}{wid}",$session{dbh});
|
||||
if (WebGUI::Privilege::isInGroup($groupToContribute,$session{user}{userId})) {
|
||||
$output = '<h1>Add Submission</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<h1>'.WebGUI::International::get(285).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","addSubmissionSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Content</td><td>'.WebGUI::Form::textArea("content",'',50,10,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Image</td><td>'.WebGUI::Form::file("image").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Attachment</td><td>'.WebGUI::Form::file("attachment").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Convert Carriage Returns</td><td>'.WebGUI::Form::checkbox("convertCarriageReturns",1,1).' <span style="font-size: 8pt;">(uncheck if you\'re writing an HTML submission)</span></td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30).'</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 .= '</table></form>';
|
||||
$output .= '<table width="100%" cellspacing=1 cellpadding=2 border=0>';
|
||||
$output .= '<tr><td class="tableHeader">Edit/Delete</td><td class="tableHeader">Title</td><td class="tableHeader">Date Submitted</td><td class="tableHeader">Status</td></tr>';
|
||||
$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 submission where widgetId='$session{form}{wid}' and userId=$session{user}{userId} order by dateSubmitted desc",$session{dbh});
|
||||
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>';
|
||||
|
|
@ -110,7 +116,7 @@ sub www_addSubmissionSave {
|
|||
if ($session{form}{title} ne "") {
|
||||
$title = $session{form}{title};
|
||||
} else {
|
||||
$title = "Untitled";
|
||||
$title = WebGUI::International::get(290);
|
||||
}
|
||||
WebGUI::SQL->write("insert into submission values ($session{form}{wid}, $submissionId, ".quote($title).", ".time().", ".quote($session{user}{username}).", '$session{user}{userId}', ".quote($session{form}{content}).", ".quote($image).", ".quote($attachment).", '$status', '$session{form}{convertCarriageReturns}')",$session{dbh});
|
||||
return "";
|
||||
|
|
@ -148,8 +154,10 @@ sub www_deleteSubmission {
|
|||
my ($output, $owner);
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
if ($owner == $session{user}{userId}) {
|
||||
$output = '<h1>Please Confirm</h1>';
|
||||
$output .= 'Are you certain that you want to delete this submission?<p><div align="center"><a href="'.$session{page}{url}.'?func=deleteSubmissionConfirm&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">Yes, I\'m sure.</a> <a href="'.$session{page}{url}.'">No, I made a mistake.</a></div>';
|
||||
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(291).'<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 .= ' <a href="'.$session{page}{url}.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -174,21 +182,24 @@ sub www_edit {
|
|||
tie %data, 'Tie::CPHash';
|
||||
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=45"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit User Submission System</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=45"><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}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,$data{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Display the title?</td><td>'.WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Description</td><td>'.WebGUI::Form::textArea("description",$data{description}).'</td></tr>';
|
||||
$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("displayTitle","1",$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(176).'</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}).'</td></tr>';
|
||||
$array[0] = $data{groupToContribute};
|
||||
%hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName",$session{dbh});
|
||||
$output .= '<tr><td class="formDescription" valign="top">Who can contribute?</td><td>'.WebGUI::Form::selectList("groupToContribute",\%hash,\@array,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Submissions Per Page</td><td>'.WebGUI::Form::text("submissionsPerPage",20,2,$data{submissionsPerPage}).'</td></tr>';
|
||||
%hash = ("Approved"=>"Approved","Denied"=>"Denied","Pending"=>"Pending");
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(279).'</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));
|
||||
$array[0] = $data{defaultStatus};
|
||||
$output .= '<tr><td class="formDescription" valign="top">Default Status</td><td>'.WebGUI::Form::selectList("defaultStatus",\%hash,\@array,1).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -214,25 +225,26 @@ sub www_editSubmission {
|
|||
($owner) = WebGUI::SQL->quickArray("select userId from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
if ($owner == $session{user}{userId}) {
|
||||
%submission = WebGUI::SQL->quickHash("select * from submission where submissionId='$session{form}{sid}'",$session{dbh});
|
||||
$output = '<h1>Edit Submission</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<h1>'.WebGUI::International::get(293).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$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">Title</td><td>'.WebGUI::Form::text("title",20,30,$submission{title}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Content</td><td>'.WebGUI::Form::textArea("content",$submission{content},50,10).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,$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>';
|
||||
if ($submission{image} ne "") {
|
||||
$output .= '<tr><td class="formDescription">Image</td><td><a href="'.$session{page}{url}.'?func=deleteImage&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">Delete Image</a></td></tr>';
|
||||
$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>';
|
||||
} else {
|
||||
$output .= '<tr><td class="formDescription">Image</td><td>'.WebGUI::Form::file("image").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(179).'</td><td>'.WebGUI::Form::file("image").'</td></tr>';
|
||||
}
|
||||
if ($submission{attachment} ne "") {
|
||||
$output .= '<tr><td class="formDescription">Attachment</td><td><a href="'.$session{page}{url}.'?func=deleteAttachment&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">Delete Attachment</a></td></tr>';
|
||||
$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>';
|
||||
} else {
|
||||
$output .= '<tr><td class="formDescription">Attachment</td><td>'.WebGUI::Form::file("attachment").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(182).'</td><td>'.WebGUI::Form::file("attachment").'</td></tr>';
|
||||
}
|
||||
$output .= '<tr><td class="formDescription">Convert Carriage Returns</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("save").'</td></tr>';
|
||||
$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 .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -258,9 +270,9 @@ sub www_editSubmissionSave {
|
|||
if ($session{form}{title} ne "") {
|
||||
$title = $session{form}{title};
|
||||
} else {
|
||||
$title = "Untitled";
|
||||
$title = WebGUI::International::get(290);
|
||||
}
|
||||
WebGUI::SQL->write("update submission set convertCarriageReturns='$session{form}{convertCarriageReturns}', title=".quote($title).", content=".quote($session{form}{content}).", ".$image.$attachment." status='$status' where submissionId=$session{form}{sid}",$session{dbh});
|
||||
WebGUI::SQL->write("update submission set dateSubmitted=".time().", convertCarriageReturns='$session{form}{convertCarriageReturns}', title=".quote($title).", content=".quote($session{form}{content}).", ".$image.$attachment." status='$status' where submissionId=$session{form}{sid}",$session{dbh});
|
||||
return www_viewSubmission();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -280,15 +292,18 @@ sub www_view {
|
|||
if ($data{description} ne "") {
|
||||
$output .= $data{description}.'<p>';
|
||||
}
|
||||
if ($data{processMacros}) {
|
||||
$output = WebGUI::Macro::process($output);
|
||||
}
|
||||
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,username,userId from submission where widgetId='$widgetId' and status='Approved' order by dateSubmitted desc",$session{dbh});
|
||||
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">'.$submission[3].'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '<table width="100%"><tr><td align="right"><a href="'.$session{page}{url}.'?func=addSubmission&wid='.$widgetId.'">Post New Submission</a></td></tr></table>';
|
||||
$output .= '<table width="100%"><tr><td align="right"><a href="'.$session{page}{url}.'?func=addSubmission&wid='.$widgetId.'">'.WebGUI::International::get(294).'</a></td></tr></table>';
|
||||
$output .= '<table width="100%" cellspacing=1 cellpadding=2 border=0>';
|
||||
$output .= '<tr><td class="tableHeader">Title</td><td class="tableHeader">Date Submitted</td><td class="tableHeader">Submitted By</td></tr>';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(99).'</td><td class="tableHeader">'.WebGUI::International::get(287).'</td><td class="tableHeader">'.WebGUI::International::get(295).'</td></tr>';
|
||||
if ($session{form}{pn} < 1) {
|
||||
$pn = 0;
|
||||
} else {
|
||||
|
|
@ -300,15 +315,15 @@ sub www_view {
|
|||
$output .= '</table>';
|
||||
$output .= '<div class="pagination">';
|
||||
if ($pn > 0) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn-1).'&wid='.$widgetId.'">«Previous Page</a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn-1).'&wid='.$widgetId.'">«'.WebGUI::International::get(91).'</a>';
|
||||
} else {
|
||||
$output .= '«Previous Page';
|
||||
$output .= '«'.WebGUI::International::get(91);
|
||||
}
|
||||
$output .= ' · ';
|
||||
if ($pn < round($#row/$data{submissionsPerPage})) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn+1).'&wid='.$widgetId.'">Next Page»</a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?pn='.($pn+1).'&wid='.$widgetId.'">'.WebGUI::International::get(91).'»</a>';
|
||||
} else {
|
||||
$output .= 'Next Page»';
|
||||
$output .= WebGUI::International::get(92).'»';
|
||||
}
|
||||
$output .= '</div>';
|
||||
}
|
||||
|
|
@ -321,16 +336,16 @@ sub www_viewSubmission {
|
|||
tie %submission, 'Tie::CPHash';
|
||||
%submission = WebGUI::SQL->quickHash("select * from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
$output = "<h1>".$submission{title}."</h1>";
|
||||
$output .= '<b>Submitted By:</b> '.$submission{username}.'<br>';
|
||||
$output .= '<b>Date Submitted:</b> '.$submission{dateSubmitted}.'<p>';
|
||||
$output .= '<b>'.WebGUI::International::get(297).'</b> '.$submission{username}.'<br>';
|
||||
$output .= '<b>'.WebGUI::International::get(298).'</b> '.epochToHuman($submission{dateSubmitted},"%w, %c %D, %y at %H:%n%p").'<p>';
|
||||
if ($submission{image} ne "") {
|
||||
$output .= '<img src="'.$session{setting}{attachmentDirectoryWeb}.'/'.$session{form}{wid}.'/'.$session{form}{sid}.'/'.$submission{image}.'" hspace=3 align="right">';
|
||||
}
|
||||
if ($submission{status} eq "Pending" && (WebGUI::Privilege::isInGroup(3,$session{user}{userId}) || WebGUI::Privilege::isInGroup(4,$session{user}{userId}))) {
|
||||
$output .= '<div align="center">';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=approveSubmission&sid='.$session{form}{sid}.'">Approve</a> · ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewPendingSubmissions">Leave Pending</a> · ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=denySubmission&sid='.$session{form}{sid}.'">Deny</a> ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=approveSubmission&sid='.$session{form}{sid}.'">'.WebGUI::International::get(299).'</a> · ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewPendingSubmissions">'.WebGUI::International::get(300).'</a> · ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=denySubmission&sid='.$session{form}{sid}.'">'.WebGUI::International::get(301).'</a> ';
|
||||
$output .= '</div>';
|
||||
}
|
||||
if ($submission{convertCarriageReturns}) {
|
||||
|
|
@ -342,18 +357,15 @@ sub www_viewSubmission {
|
|||
}
|
||||
$output .= '<div align="center">';
|
||||
if ($submission{userId} == $session{user}{userId}) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?func=deleteSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">Delete</a> · ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?func=editSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">Edit</a> · ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?func=deleteSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(186).'</a> · ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?func=editSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(302).'</a> · ';
|
||||
}
|
||||
$output .= '<a href="'.$session{page}{url}.'">Return To Submissions List</a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'">'.WebGUI::International::get(303).'</a>';
|
||||
$output .= '</div>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,13 @@ if (eval { require Tie::IxHash }) {
|
|||
print "Please install.\n";
|
||||
}
|
||||
|
||||
print "Tie::CPHash module:\t";
|
||||
if (eval { require Tie::CPHash }) {
|
||||
print "OK\n";
|
||||
} else {
|
||||
print "Please install.\n";
|
||||
}
|
||||
|
||||
print "XML::RSS module:\t";
|
||||
if (eval { require XML::RSS }) {
|
||||
print "OK\n";
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# 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
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
my $webguiRoot = "../..";
|
||||
|
||||
BEGIN {
|
||||
unshift (@INC, "../../lib");
|
||||
}
|
||||
|
||||
#-----------------DO NOT MODIFY BELOW THIS LINE--------------------
|
||||
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
use strict;
|
||||
use WebGUI;
|
||||
|
||||
print WebGUI::page($webguiRoot);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue