Fixed POD syntax.

This commit is contained in:
JT Smith 2002-12-16 01:13:06 +00:00
parent 4481cbec49
commit 3e89b31e13
28 changed files with 2003 additions and 1657 deletions

View file

@ -34,7 +34,7 @@ use WebGUI::Utility;
=head1 NAME
Package WebGUI::Attachment
Package WebGUI::Attachment
=head1 SYNOPSIS
@ -59,12 +59,12 @@ use WebGUI::Utility;
$filename = $attachment->saveFromFilesystem($pathToFile);
=head1 DESCRIPTION
Package to manipulate WebGUI Attachments.
Package to manipulate WebGUI Attachments.
=head1 METHODS
These methods are available from this class:
These methods are available from this class:
=cut
@ -73,7 +73,7 @@ use WebGUI::Utility;
=head2 box ( )
Displays the attachment in WebGUI's standard "Attachment Box".
Displays the attachment in WebGUI's standard "Attachment Box".
=cut
@ -93,15 +93,19 @@ sub box {
=head2 copy ( newNode [, newNodeSub ] )
Copies an attachment from one node to another.
Copies an attachment from one node to another.
=over
=item newNode
Define the node to copy the attachment to.
Define the node to copy the attachment to.
=item newNodeSub
If there is a subordinate element on this node define it here.
If there is a subordinate element on this node define it here.
=back
=cut
@ -142,12 +146,15 @@ sub copy {
=head2 createThumbnail ( [ thumbnailSize ] )
Generates a thumbnail for this attachment.
Generates a thumbnail for this attachment.
=over
=item thumbnailSize
Defaults to the global setting for thumbnail size. However, it
can be overriden with this value. Specified in pixels.
Defaults to the global setting for thumbnail size. However, it can be overriden with this value. Specified in pixels.
=back
=cut
@ -177,7 +184,7 @@ sub createThumbnail {
=head2 delete ( )
Deletes an attachment from its node.
Deletes an attachment from its node.
=cut
@ -190,7 +197,7 @@ sub delete {
=head2 deleteNode ( )
Deletes deletes this attachment's node (and everything in it).
Deletes deletes this attachment's node (and everything in it).
=cut
@ -203,7 +210,7 @@ sub deleteNode {
=head2 getFilename ( )
Returns the attachment's filename.
Returns the attachment's filename.
=cut
@ -216,7 +223,7 @@ sub getFilename {
=head2 getIcon ( )
Returns the full URL to the file icon for this attachment.
Returns the full URL to the file icon for this attachment.
=cut
@ -299,7 +306,7 @@ sub getIcon {
=head2 getPath ( )
Returns a full path to an attachment.
Returns a full path to an attachment.
=cut
@ -312,7 +319,7 @@ sub getPath {
=head2 getSize ( )
Returns the size of this file.
Returns the size of this file.
=cut
@ -336,10 +343,7 @@ sub getSize {
=head2 getThumbnail ( )
Returns a full URL to the thumbnail for this attachment. Thumbnails
are only created for jpg, gif, png, tif, and bmp with Image::Magick
installed so getThumbnail only returns a thumbnail if the file is
one of those types and Image::Magick is installed.
Returns a full URL to the thumbnail for this attachment. Thumbnails are only created for jpg, gif, png, tif, and bmp with Image::Magick installed so getThumbnail only returns a thumbnail if the file is one of those types and Image::Magick is installed.
=cut
@ -358,7 +362,7 @@ sub getThumbnail {
=head2 getType ( )
Returns the extension or type of this attachment.
Returns the extension or type of this attachment.
=cut
@ -374,7 +378,7 @@ sub getType {
=head2 getURL ( )
Returns a full URL to an attachment.
Returns a full URL to an attachment.
=cut
@ -387,7 +391,7 @@ sub getURL {
=head2 isImage ( )
Returns a 1 or 0 depending on whether the file is an image or not.
Returns a 1 or 0 depending on whether the file is an image or not.
=cut
@ -399,22 +403,23 @@ sub isImage {
=head2 new ( filename, node [, nodeSubordinate ] )
Constructor.
Constructor.
=over
=item filename
What is the filename for this attachment. If you'll be uploading
the attachment using the "save" method then you may leave this
field blank.
What is the filename for this attachment. If you'll be uploading the attachment using the "save" method then you may leave this field blank.
=item node
The node where this attachment is (or will be placed).
The node where this attachment is (or will be placed).
=item nodeSubordinate
The subordinate element of the node where this attachment is (or
will be placed).
The subordinate element of the node where this attachment is (or will be placed).
=back
=cut
@ -429,11 +434,15 @@ sub new {
=head2 rename ( newFilename )
Renames an attachment's filename.
Renames an attachment's filename.
=over
=item newFilename
Define the new filename for this attachment.
Define the new filename for this attachment.
=back
=cut
@ -447,13 +456,15 @@ sub rename {
=head2 resizeImage ( [ imageSize ] )
Resizes this attachment to the specified size. Use this method only
if the attachment is an image.
Resizes this attachment to the specified size. Use this method only if the attachment is an image.
=over
=item imageSize
Defaults to the max image size setting. Specify a value in pixels
to resize this image to.
Defaults to the max image size setting. Specify a value in pixels to resize this image to.
=back
=cut
@ -479,28 +490,23 @@ sub resizeImage {
=head2 save ( formVariableName [, thumbnailSize, imageSize ] )
Grabs an attachment from a form POST and saves it to a node. It
then returns the filename of the attachment.
Grabs an attachment from a form POST and saves it to a node. It then returns the filename of the attachment.
=over
=item formVariableName
Provide the form variable name to which the file being uploaded
is assigned.
Provide the form variable name to which the file being uploaded is assigned.
=item thumbnailSize
If an image is being uploaded a thumbnail will be generated
automatically. By default, WebGUI will create a thumbnail of the
size specified in the file settings. You can override that
size by specifying one here. Size is measured in pixels of the
longest side.
If an image is being uploaded a thumbnail will be generated automatically. By default, WebGUI will create a thumbnail of the size specified in the file settings. You can override that size by specifying one here. Size is measured in pixels of the longest side.
=item imageSize
If a web image (gif, png, jpg, jpeg) is being uploaded it will be
resized if it is larger than this value. By default images are
resized to stay within the contraints of the Max Image Size
setting in the file settings.
If a web image (gif, png, jpg, jpeg) is being uploaded it will be resized if it is larger than this value. By default images are resized to stay within the contraints of the Max Image Size setting in the file settings.
=back
=cut
@ -544,27 +550,23 @@ sub save {
=head2 saveFromFilesystem ( pathToFile [, thumbnailSize, imageSize ] )
Grabs an attachment from the server's file system and saves it to a node. It
then returns the filename of the attachment.
Grabs an attachment from the server's file system and saves it to a node. It then returns the filename of the attachment.
=over
=item pathToFile
Provide the local path to this file.
Provide the local path to this file.
=item thumbnailSize
If an image is being grabbed a thumbnail will be generated
automatically. By default, WebGUI will create a thumbnail of the
size specified in the file settings. You can override that
size by specifying one here. Size is measured in pixels of the
longest side.
If an image is being grabbed a thumbnail will be generated automatically. By default, WebGUI will create a thumbnail of the size specified in the file settings. You can override that size by specifying one here. Size is measured in pixels of the longest side.
=item imageSize
If a web image (gif, png, jpg, jpeg) is being grabbed it will be
resized if it is larger than this value. By default images are
resized to stay within the contraints of the Max Image Size
setting in the file settings.
If a web image (gif, png, jpg, jpeg) is being grabbed it will be resized if it is larger than this value. By default images are resized to stay within the contraints of the Max Image Size setting in the file settings.
=back
=cut

View file

@ -1,14 +1,20 @@
package WebGUI::Authentication;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2002 Plain Black LLC.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2002 Plain Black LLC.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=cut
use strict qw(vars subs);
use WebGUI::ErrorHandler;
@ -16,6 +22,49 @@ use WebGUI::Session;
use WebGUI::SQL;
=head1 NAME
Package WebGUI::Authentication
=head1 SYNOPSIS
use WebGUI::Authentication;
$html = WebGUI::Authentication::adminForm($userId,$authMethod);
WebGUI::Authentication::adminFormSave($userId,$authMethod);
$error = WebGUI::Authentication::adminFormValidate($authMethod);
$result = WebGUI::Authentication::authenticate($userId,$identifier,$authMethod);
WebGUI::Authentication::deleteParams($userId);
$params = WebGUI::Authentication::getParams($userId,$authMethod);
WebGUI::Authentication::saveParams($userId,$authMethod,\%data);
$label = WebGUI::Authentication::optionsLabel($authMethod);
$html = WebGUI::Authentication::settingsForm($authMethod);
$html = WebGUI::Authentication::registrationForm();
WebGUI::Authentication::registrationFormSave($userId);
$error = WebGUI::Authentication::registrationFormValidate();
$html = WebGUI::Authentication::userForm();
WebGUI::Authentication::userFormSave();
$error = WebGUI::Authentication::userFormValidate();
=head1 DESCRIPTION
This package is used to access WebGUI's pluggable authentication system.
=head1 METHODS
These functions are available from this package:
=cut
#-------------------------------------------------------------------
sub _execute {
my ($authMethod, $function, $params) = @_;
@ -27,17 +76,21 @@ sub _execute {
#-------------------------------------------------------------------
=head adminForm ( userId, authMethod )
=head2 adminForm ( userId, authMethod )
Returns the admin form for the specified authentication method.
Returns the admin form for the specified authentication method.
=over
=item userId
This user's id.
This user's id.
=item authMethod
Specify the authentication method.
Specify the authentication method.
=back
=cut
@ -49,17 +102,21 @@ sub adminForm {
#-------------------------------------------------------------------
=head adminFormSave ( userId, authMethod )
=head2 adminFormSave ( userId, authMethod )
Saves the specified user's authentication information to the database.
Saves the specified user's authentication information to the database.
=over
=item userId
The user id to save the information for.
The user id to save the information for.
=item authMethod
Specify the authentication method.
Specify the authentication method.
=back
=cut
@ -71,13 +128,17 @@ sub adminFormSave {
#-------------------------------------------------------------------
=head adminFormValidate ( authMethod )
=head2 adminFormValidate ( authMethod )
Returns an error string if there are any problems with the form data.
Returns an error string if there are any problems with the form data.
=over
=item authMethod
Specify the authentication method.
Specify the authentication method.
=back
=cut
@ -88,23 +149,25 @@ sub adminFormValidate {
#-------------------------------------------------------------------
=head authenticate ( userId, identifier, authMethod )
=head2 authenticate ( userId, identifier, authMethod )
Check to see that the user supplied information is correct. Returns
"1" if successful otherwise it returns an error message.
Check to see that the user supplied information is correct. Returns "1" if successful otherwise it returns an error message.
=over
=item userId
The user to authenticate.
The user to authenticate.
=item identifier
The password, pass phrase, PIN, or other unique identifier to
verify this user.
The password, pass phrase, PIN, or other unique identifier to verify this user.
=item authMethod
The type of authentication to use to authenticate this user.
The type of authentication to use to authenticate this user.
=back
=cut
@ -115,15 +178,17 @@ sub authenticate {
#-------------------------------------------------------------------
=head deleteParams ( userId )
=head2 deleteParams ( userId )
Removes the specified user's authentication parameters from the
database for all authentication methods. This is primarily useful
when deleting the user's account.
Removes the specified user's authentication parameters from the database for all authentication methods. This is primarily useful when deleting the user's account.
=over
=item userId
The user id for the user to have the parameters deleted.
The user id for the user to have the parameters deleted.
=back
=cut
@ -137,18 +202,21 @@ sub deleteParams {
#-------------------------------------------------------------------
=head getParams ( userId [ , authMethod ] )
=head2 getParams ( userId [ , authMethod ] )
Returns an error string if there are any problems with the form data.
Returns a hash reference with the user's authentication information.
=over
=item userId
Specify a user id.
Specify a user id.
=item authMethod
Optionally specify the authentication method. Defaults to the system-wide
authentication method.
Optionally specify the authentication method. Defaults to the system-wide authentication method.
=back
=cut
@ -163,14 +231,17 @@ sub getParams {
#-------------------------------------------------------------------
=head optionsLabel ( authMethod )
=head2 optionsLabel ( authMethod )
Returns a label that can be displayed to describe the settings for
this auth method.
Returns a label that can be displayed to describe the settings for this auth method.
=over
=item authMethod
The authentication method.
The authentication method.
=back
=cut
@ -182,9 +253,9 @@ sub optionsLabel {
#-------------------------------------------------------------------
=head registrationForm ( )
=head2 registrationForm ( )
Returns the user registration form for the default auth method.
Returns the user registration form for the default auth method.
=cut
@ -195,14 +266,17 @@ sub registrationForm {
#-------------------------------------------------------------------
=head registrationFormSave ( userId )
=head2 registrationFormSave ( userId )
Creates the appropriate values in the database for this user based
upon their registration information.
Creates the appropriate values in the database for this user based upon their registration information.
=over
=item userId
The user id to store with the registration data.
The user id to store with the registration data.
=back
=cut
@ -213,9 +287,9 @@ sub registrationFormSave {
#-------------------------------------------------------------------
=head registrationFormValidate ( )
=head2 registrationFormValidate ( )
Returns an error string if there are any problems with the form data.
Returns an error string if there are any problems with the form data.
=cut
@ -227,13 +301,17 @@ sub registrationFormValidate {
#-------------------------------------------------------------------
=head settingsForm ( authMethod )
=head2 settingsForm ( authMethod )
Returns a form for the WebGUI settings area.
Returns a form for the WebGUI settings area.
=over
=item authMethod
The authentication method to display the form for.
The authentication method to display the form for.
=back
=cut
@ -245,21 +323,25 @@ sub settingsForm {
#-------------------------------------------------------------------
=head saveParams ( userId, authMethod, data )
=head2 saveParams ( userId, authMethod, data )
Saves the user's authentication parameters to the database.
Saves the user's authentication parameters to the database.
=over
=item userId
Specify a user id.
Specify a user id.
=item authMethod
Specify the authentication method to save these paramaters under.
Specify the authentication method to save these paramaters under.
=item data
A hash reference containing parameter names and values to be saved.
A hash reference containing parameter names and values to be saved.
=back
=cut
@ -276,9 +358,9 @@ sub saveParams {
#-------------------------------------------------------------------
=head userForm ( )
=head2 userForm ( )
Returns the user authentication data form.
Returns the user authentication data form.
=cut
@ -290,9 +372,9 @@ sub userForm {
#-------------------------------------------------------------------
=head userFormSave ( )
=head2 userFormSave ( )
Saves user form data to the database.
Saves user form data to the database.
=cut
@ -303,9 +385,9 @@ sub userFormSave {
#-------------------------------------------------------------------
=head userFormValidate ( )
=head2 userFormValidate ( )
Returns an error string if there are any problems with the form data.
Returns an error string if there are any problems with the form data.
=cut

View file

@ -28,7 +28,7 @@ our @EXPORT = qw(&localtime &time &addToTime &addToDate &epochToHuman &epochToSe
=head1 NAME
Package WebGUI::DateTime
Package WebGUI::DateTime
=head1 SYNOPSIS
@ -50,12 +50,11 @@ our @EXPORT = qw(&localtime &time &addToTime &addToDate &epochToHuman &epochToSe
=head1 DESCRIPTION
This package provides easy to use date math functions, which are
normally a complete pain.
This package provides easy to use date math functions, which are normally a complete pain.
=head1 METHODS
These functions are available from this package:
These functions are available from this package:
=cut
@ -66,23 +65,27 @@ our @EXPORT = qw(&localtime &time &addToTime &addToDate &epochToHuman &epochToSe
=head2 addToDate ( epoch [ , years, months, days ] )
Returns an epoch date with the amount of time added.
Returns an epoch date with the amount of time added.
=over
=item epoch
The number of seconds since January 1, 1970.
The number of seconds since January 1, 1970.
=item years
The number of years to add to the epoch.
The number of years to add to the epoch.
=item months
The number of months to add to the epoch.
The number of months to add to the epoch.
=item days
The number of days to add to the epoch.
The number of days to add to the epoch.
=back
=cut
@ -98,23 +101,27 @@ sub addToDate {
=head2 addToTime ( epoch [ , hours, minutes, seconds ] )
Returns an epoch date with the amount of time added.
Returns an epoch date with the amount of time added.
=over
=item epoch
The number of seconds since January 1, 1970.
The number of seconds since January 1, 1970.
=item hours
The number of hours to add to the epoch.
The number of hours to add to the epoch.
=item minutes
The number of minutes to add to the epoch.
The number of minutes to add to the epoch.
=item seconds
The number of seconds to add to the epoch.
The number of seconds to add to the epoch.
=back
=cut
@ -130,11 +137,15 @@ sub addToTime {
=head2 dayStartEnd ( epoch )
Returns the epoch dates for the start and end of the day.
Returns the epoch dates for the start and end of the day.
=over
=item epoch
The number of seconds since January 1, 1970.
The number of seconds since January 1, 1970.
=back
=cut
@ -150,16 +161,17 @@ sub dayStartEnd {
=head2 epochToHuman ( [ epoch, format ] )
Returns a formated date string.
Returns a formated date string.
=over
=item epoch
The number of seconds since January 1, 1970. Defaults to NOW!
The number of seconds since January 1, 1970. Defaults to NOW!
=item format
A string representing the output format for the date. Defaults to
'%z %Z'. You can use the following to format your date string:
A string representing the output format for the date. Defaults to '%z %Z'. You can use the following to format your date string:
%% = % (percent) symbol.
%c = The calendar month name.
@ -181,6 +193,8 @@ sub dayStartEnd {
%z = The current user's date format preference.
%Z = The current user's time format preference.
=back
=cut
sub epochToHuman {
@ -253,12 +267,15 @@ sub epochToHuman {
=head2 epochToSet ( epoch )
Returns a set date (used by WebGUI::HTMLForm->date) in the format
of MM/DD/YYYY.
Returns a set date (used by WebGUI::HTMLForm->date) in the format of MM/DD/YYYY.
=over
=item epoch
The number of seconds since January 1, 1970.
The number of seconds since January 1, 1970.
=back
=cut
@ -270,12 +287,15 @@ sub epochToSet {
=head2 getMonthName ( month )
Returns a string containing the calendar month name in the language
of the current user.
Returns a string containing the calendar month name in the language of the current user.
=over
=item month
An integer ranging from 1-12 representing the month.
An integer ranging from 1-12 representing the month.
=back
=cut
@ -311,13 +331,15 @@ sub getMonthName {
=head2 getDayName ( day )
Returns a string containing the weekday name in the language of the
current user.
Returns a string containing the weekday name in the language of the current user.
=over
=item day
An integer ranging from 1-7 representing the day of the week (Sunday
is 1 and Saturday is 7).
An integer ranging from 1-7 representing the day of the week (Sunday is 1 and Saturday is 7).
=back
=cut
@ -344,11 +366,15 @@ sub getDayName {
=head2 humanToEpoch ( date )
Returns an epoch date derived from the human date.
Returns an epoch date derived from the human date.
=over
=item date
The human date string. YYYY-MM-DD HH:MM:SS
The human date string. YYYY-MM-DD HH:MM:SS
=back
=cut
@ -371,16 +397,19 @@ sub humanToEpoch {
=head2 intervalToSeconds ( interval, units )
Returns the number of seconds derived from the interval.
Returns the number of seconds derived from the interval.
=over
=item interval
An integer which represents the amount of time for the interval.
An integer which represents the amount of time for the interval.
=item units
A string which represents the units of the interval. The string
must be 'years', 'months', 'days', 'hours', 'minutes', or 'seconds'.
A string which represents the units of the interval. The string must be 'years', 'months', 'days', 'hours', 'minutes', or 'seconds'.
=back
=cut
@ -406,13 +435,15 @@ sub intervalToSeconds {
=head2 localtime ( epoch )
Returns an array of time elements. The elements are: years, months,
days, hours, minutes, seconds, day of year, day of week, daylight
savings time.
Returns an array of time elements. The elements are: years, months, days, hours, minutes, seconds, day of year, day of week, daylight savings time.
=over
=item epoch
The number of seconds since January 1, 1970.
The number of seconds since January 1, 1970.
=back
=cut
@ -423,16 +454,19 @@ sub localtime {
#-------------------------------------------------------------------
=head2 monthCount ( startEpoch, endEpoch )
Returns the number of months between the start and end dates
(inclusive).
Returns the number of months between the start and end dates (inclusive).
=over
=item startEpoch
An epoch datestamp corresponding to the first month.
An epoch datestamp corresponding to the first month.
=item endEpoch
An epoch datestamp corresponding to the last month.
An epoch datestamp corresponding to the last month.
=back
=cut
@ -448,11 +482,15 @@ sub monthCount {
=head2 monthStartEnd ( epoch )
Returns the epoch dates for the start and end of the month.
Returns the epoch dates for the start and end of the month.
=over
=item epoch
The number of seconds since January 1, 1970.
The number of seconds since January 1, 1970.
=back
=cut
@ -469,12 +507,15 @@ sub monthStartEnd {
=head2 secondsToInterval ( seconds )
Returns an interval and units derived the number of seconds.
Returns an interval and units derived the number of seconds.
=over
=item seconds
The number of seconds in the interval.
The number of seconds in the interval.
=back
=cut
@ -509,11 +550,15 @@ sub secondsToInterval {
=head2 setToEpoch ( set )
Returns an epoch date.
Returns an epoch date.
=over
=item set
A string in the format of MM/DD/YYYY.
A string in the format of MM/DD/YYYY.
=back
=cut
@ -542,7 +587,7 @@ sub setToEpoch {
=head2 time ( )
Returns an epoch date.
Returns an epoch date for now.
=cut

View file

@ -28,10 +28,7 @@ use WebGUI::User;
=head1 WebGUI Discussions
This package implements WebGUI's discussion system. However it is
outdated and cludgy. We recommend not coding any new systems against
this package, but instead wait for the new package that will be
created in 6.0.0.
This package implements WebGUI's discussion system. However it is outdated and cludgy. We recommend not coding any new systems against this package, but instead wait for the new package that will be created in 6.0.0.
=cut

View file

@ -18,9 +18,9 @@ use FileHandle;
use WebGUI::Session;
=head1 NAME
=head1 NAME
Package WebGUI::ErrorHandler
WebGUI::ErrorHandler
=head1 SYNOPSIS
@ -32,11 +32,11 @@ use WebGUI::Session;
=head1 DESCRIPTION
This package provides simple but effective error handling and logging for WebGUI.
This package provides simple but effective error handling and logging for WebGUI.
=head1 METHODS
These functions are available from this package:
These functions are available from this package:
=cut
@ -46,11 +46,15 @@ use WebGUI::Session;
=head2 audit ( message )
Inserts an AUDIT type message into the WebGUI log.
Inserts an AUDIT type message into the WebGUI log.
=over
=item message
Whatever message you wish to insert into the log.
Whatever message you wish to insert into the log.
=back
=cut
@ -67,10 +71,7 @@ sub audit {
=head2 fatalError ( )
Outputs an error message to the user and logs an error. Should only
be called if the system cannot recover from an error, or if it would
be unsafe to attempt to recover from an error (like compile errors
or database errors).
Outputs an error message to the user and logs an error. Should only be called if the system cannot recover from an error, or if it would be unsafe to attempt to recover from an error (like compile errors or database errors).
=cut
@ -159,11 +160,15 @@ sub fatalError {
=head2 security ( message )
Adds a SECURITY type message to the log.
Adds a SECURITY type message to the log.
=over
=item message
The message you wish to add to the log.
The message you wish to add to the log.
=back
=cut
@ -181,11 +186,15 @@ sub security {
=head2 warn ( message )
Adds a WARNING type message to the log.
Adds a WARNING type message to the log.
=over
=item message
The message you wish to add to the log.
The message you wish to add to the log.
=back
=cut

File diff suppressed because it is too large Load diff

View file

@ -20,7 +20,7 @@ use WebGUI::Session;
=head1 NAME
Package WebGUI::HTML
Package WebGUI::HTML
=head1 SYNOPSIS
@ -30,11 +30,11 @@ use WebGUI::Session;
=head1 DESCRIPTION
A package for manipulating and massaging HTML.
A package for manipulating and massaging HTML.
=head1 METHODS
These methods are available from this package:
These methods are available from this package:
=cut
@ -43,16 +43,17 @@ use WebGUI::Session;
=head2 cleanSegment ( html )
Returns an HTML segment that has been stripped of the <BODY> tag
and anything before it, as well as the </BODY> tag and anything
after it.
Returns an HTML segment that has been stripped of the <BODY> tag and anything before it, as well as the </BODY> tag and anything after it.
NOTE: This filter does have one exception, it leaves anything before
the <BODY> tag that is enclosed in <STYLE></STYLE> tags.
NOTE: This filter does have one exception, it leaves anything before the <BODY> tag that is enclosed in <STYLE></STYLE> tags.
=over
=item html
The HTML segment you want cleaned.
The HTML segment you want cleaned.
=back
=cut
@ -73,18 +74,19 @@ sub cleanSegment {
=head2 filter ( html [, filter ] )
Returns HTML with unwanted tags filtered out.
Returns HTML with unwanted tags filtered out.
=over
=item html
The HTML content you want filtered.
The HTML content you want filtered.
=item filter
Choose from all, none, javascript, or most. Defaults to most.
All removes all HTML tags; none removes no HTML tags; javascript
removes all references to javacript; and most removes all but
simple formatting tags like bold and italics.
Choose from all, none, javascript, or most. Defaults to most. All removes all HTML tags; none removes no HTML tags; javascript removes all references to javacript; and most removes all but simple formatting tags like bold and italics.
=back
=cut

File diff suppressed because it is too large Load diff

View file

@ -25,7 +25,7 @@ our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon &copyIcon &deleteIcon &editIcon
=head1 NAME
Package WebGUI::Icon
Package WebGUI::Icon
=head1 SYNOPSIS
@ -46,14 +46,11 @@ our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon &copyIcon &deleteIcon &editIcon
=head1 DESCRIPTION
A package for generating user interface buttons. The subroutines
found herein do nothing other than to create a short way of doing
much longer repetitive tasks. They simply make the programmer's life
easier through fewer keystrokes and less cluttered code.
A package for generating user interface buttons. The subroutines found herein do nothing other than to create a short way of doing much longer repetitive tasks. They simply make the programmer's life easier through fewer keystrokes and less cluttered code.
=head1 METHODS
These subroutines are available from this package:
These subroutines are available from this package:
=cut
@ -61,16 +58,19 @@ our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon &copyIcon &deleteIcon &editIcon
=head2 becomeIcon ( urlParameters [, pageURL ] )
Generates a button with the word "Become" printed on it.
Generates a button with the word "Become" printed on it.
=over
=item urlParameters
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
=item pageURL
The URL to any page. Defaults to the current page.
The URL to any page. Defaults to the current page.
=back
=cut
@ -86,16 +86,19 @@ sub becomeIcon {
=head2 copyIcon ( urlParameters [, pageURL ] )
Generates a button with the word "Copy" printed on it.
Generates a button with the word "Copy" printed on it.
=over
=item urlParameters
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
=item pageURL
The URL to any page. Defaults to the current page.
The URL to any page. Defaults to the current page.
=back
=cut
@ -111,16 +114,19 @@ sub copyIcon {
=head2 cutIcon ( urlParameters [, pageURL ] )
Generates a button with the word "Cut" printed on it.
Generates a button with the word "Cut" printed on it.
=over
=item urlParameters
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
=item pageURL
The URL to any page. Defaults to the current page.
The URL to any page. Defaults to the current page.
=back
=cut
@ -136,16 +142,19 @@ sub cutIcon {
=head2 deleteIcon ( urlParameters [, pageURL ] )
Generates a button with an "X" printed on it.
Generates a button with an "X" printed on it.
=over
=item urlParameters
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
=item pageURL
The URL to any page. Defaults to the current page.
The URL to any page. Defaults to the current page.
=back
=cut
@ -161,16 +170,19 @@ sub deleteIcon {
=head2 editIcon ( urlParameters [, pageURL ] )
Generates a button with the word "Edit" printed on it.
Generates a button with the word "Edit" printed on it.
=over
=item urlParameters
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
=item pageURL
The URL to any page. Defaults to the current page.
The URL to any page. Defaults to the current page.
=back
=cut
@ -186,17 +198,19 @@ sub editIcon {
=head2 helpIcon ( helpId [, namespace ] )
Generates a button with the word "Help" printed on it.
Generates a button with the word "Help" printed on it.
=over
=item helpId
The id in the help table that relates to the help documentation
for your function.
The id in the help table that relates to the help documentation for your function.
=item namespace
If your help documentation is not in the WebGUI namespace, then
you must specify the namespace for this help.
If your help documentation is not in the WebGUI namespace, then you must specify the namespace for this help.
=back
=cut
@ -212,16 +226,19 @@ sub helpIcon {
=head2 moveBottomIcon ( urlParameters [, pageURL ] )
Generates a button with a double down arrow printed on it.
Generates a button with a double down arrow printed on it.
=over
=item urlParameters
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
=item pageURL
The URL to any page. Defaults to the current page.
The URL to any page. Defaults to the current page.
=back
=cut
@ -237,16 +254,19 @@ sub moveBottomIcon {
=head2 moveDownIcon ( urlParameters [, pageURL ] )
Generates a button with a down arrow printed on it.
Generates a button with a down arrow printed on it.
=over
=item urlParameters
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
=item pageURL
The URL to any page. Defaults to the current page.
The URL to any page. Defaults to the current page.
=back
=cut
@ -262,16 +282,19 @@ sub moveDownIcon {
=head2 moveTopIcon ( urlParameters [, pageURL ] )
Generates a button with a double up arrow printed on it.
Generates a button with a double up arrow printed on it.
=over
=item urlParameters
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
=item pageURL
The URL to any page. Defaults to the current page.
The URL to any page. Defaults to the current page.
=back
=cut
@ -287,16 +310,19 @@ sub moveTopIcon {
=head2 moveUpIcon ( urlParameters [, pageURL ] )
Generates a button with an up arrow printed on it.
Generates a button with an up arrow printed on it.
=over
=item urlParameters
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
=item pageURL
The URL to any page. Defaults to the current page.
The URL to any page. Defaults to the current page.
=back
=cut
@ -312,9 +338,7 @@ sub moveUpIcon {
=head2 pageIcon ( )
Generates an icon that looks like a page. It's purpose is to
represent whether you're looking at page properties or Wobject
properties.
Generates an icon that looks like a page. It's purpose is to represent whether you're looking at page properties or Wobject properties.
=cut
@ -326,16 +350,19 @@ sub pageIcon {
=head2 viewIcon ( urlParameters [, pageURL ] )
Generates a button with the word "View" printed on it.
Generates a button with the word "View" printed on it.
=over
=item urlParameters
Any URL parameters that need to be tacked on to the current URL
to accomplish whatever function this button represents.
Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
=item pageURL
The URL to any page. Defaults to the current page.
The URL to any page. Defaults to the current page.
=back
=cut
@ -351,9 +378,7 @@ sub viewIcon {
=head2 wobjectIcon ( )
Generates an icon that looks like a wobject. It's purpose is to
represent whether you're looking at page properties or Wobject
properties.
Generates an icon that looks like a wobject. It's purpose is to represent whether you're looking at page properties or Wobject properties.
=cut

View file

@ -22,7 +22,7 @@ my %international;
=head1 NAME
Package WebGUI::International
Package WebGUI::International
=head1 SYNOPSIS
@ -32,11 +32,11 @@ my %international;
=head1 DESCRIPTION
This package provides an interface to the internationalization system.
This package provides an interface to the internationalization system.
=head1 FUNCTIONS
These functions are available from this package:
These functions are available from this package:
=cut
@ -45,25 +45,23 @@ my %international;
=head2 get ( internationalId [ , namespace, languageId ] )
Returns the internationalized message string for the user's language.
If there is no internationalized message, this method will
return the English string.
Returns the internationalized message string for the user's language. If there is no internationalized message, this method will return the English string.
=over
=item internationalId
An integer that relates to a message in the international table
in the WebGUI database.
An integer that relates to a message in the international table in the WebGUI database.
=item namespace
A string that relates to the namespace field in the international
table in the WebGUI database. Defaults to 'WebGUI'.
A string that relates to the namespace field in the international table in the WebGUI database. Defaults to 'WebGUI'.
=item languageId
An integer that specifies the language that the user should see.
Defaults to the user's defined language. If the user hasn't specified
a default language it defaults to '1' (English).
An integer that specifies the language that the user should see. Defaults to the user's defined language. If the user hasn't specified a default language it defaults to '1' (English).
=back
=cut
@ -97,8 +95,7 @@ sub get {
=head2 getLanguages ( )
Returns a hash reference to the languages (languageId/lanugage)
installed on this WebGUI system.
Returns a hash reference to the languages (languageId/lanugage) installed on this WebGUI system.
=cut

View file

@ -22,7 +22,7 @@ use WebGUI::Session;
=head1 NAME
Package WebGUI::Macro
Package WebGUI::Macro
=head1 SYNOPSIS
@ -32,15 +32,13 @@ use WebGUI::Session;
=head1 DESCRIPTION
This package is the interface to the WebGUI macro system.
This package is the interface to the WebGUI macro system.
NOTE: This entire system is likely to be replaced in the near future.
It has served WebGUI well since the very beginning but lacks the
speed and flexibility that WebGUI users will require in the future.
NOTE: This entire system is likely to be replaced in the near future. It has served WebGUI well since the very beginning but lacks the speed and flexibility that WebGUI users will require in the future.
=head1 METHODS
These functions are available from this package:
These functions are available from this package:
=cut
@ -50,11 +48,15 @@ use WebGUI::Session;
=head2 getParams ( parameterString )
A simple, but error prone mechanism for getting a prameter list from a string. Returns an array of parameters.
A simple, but error prone mechanism for getting a prameter list from a string. Returns an array of parameters.
=over
=item parameterString
A string containing a comma separated list of paramenters.
A string containing a comma separated list of paramenters.
=back
=cut
@ -74,11 +76,15 @@ sub getParams {
=head2 process ( html )
Runs all the WebGUI macros to and replaces them in the HTML with their output.
Runs all the WebGUI macros to and replaces them in the HTML with their output.
=over
=item html
A string of HTML to be processed.
A string of HTML to be processed.
=back
=cut

View file

@ -22,7 +22,7 @@ use WebGUI::Session;
=head1 NAME
Package WebGUI::Mail
Package WebGUI::Mail
=head1 SYNOPSIS
@ -31,11 +31,11 @@ use WebGUI::Session;
=head1 DESCRIPTION
This package provides access to use SMTP based email services.
This package provides access to use SMTP based email services.
=head1 METHODS
These methods are available from this class:
These methods are available from this class:
=cut
@ -45,32 +45,35 @@ use WebGUI::Session;
=head2 send ( to, subject, message [ , cc, from, bcc ] )
Sends an SMTP email message to the specified user.
Sends an SMTP email message to the specified user.
=over
=item to
An email address for the TO line.
An email address for the TO line.
=item subject
The subject line for the email.
The subject line for the email.
=item message
The message body for the email.
The message body for the email.
=item cc
The email address for the CC line.
The email address for the CC line.
=item from
The email address for the FROM line. Defaults to the email address
specified in the Company Settings.
The email address for the FROM line. Defaults to the email address specified in the Company Settings.
=item bcc
The email address for the BCC line.
The email address for the BCC line.
=back
=cut

View file

@ -29,7 +29,7 @@ use WebGUI::Utility;
=head1 NAME
Package WebGUI::MessageLog
Package WebGUI::MessageLog
=head1 SYNOPSIS
@ -40,11 +40,11 @@ use WebGUI::Utility;
=head1 DESCRIPTION
This package is WebGUI's notification system.
This package is WebGUI's notification system.
=head1 METHODS
These functions are available from this package:
These functions are available from this package:
=cut
@ -74,36 +74,39 @@ sub _notify {
=head2 addEntry ( userId, groupId, subject, message [ , url, status ] )
Adds an entry to the message log and sends out notification to users.
Adds an entry to the message log and sends out notification to users.
=over
=item userId
The id of the user that should receive this notification.
The id of the user that should receive this notification.
NOTE: This can be left blank if you're specifying a groupId.
NOTE: This can be left blank if you're specifying a groupId.
=item groupId
The id of the group that should receive this notification.
The id of the group that should receive this notification.
NOTE: This can be left blank if you're specifying a userId.
NOTE: This can be left blank if you're specifying a userId.
=item subject
The subject of the notification.
The subject of the notification.
=item message
The content of the notification.
The content of the notification.
=item url
The URL of any action that should be taken based upon this
notification (if any).
The URL of any action that should be taken based upon this notification (if any).
=item status
Defaults to 'notice'. Can be 'pending', 'notice', or 'completed'.
Defaults to 'notice'. Can be 'pending', 'notice', or 'completed'.
=back
=cut
@ -137,37 +140,39 @@ sub addEntry {
=head2 addInternationalizedEntry ( userId, groupId, url, internationalId [ , namespace, status ] )
Adds an entry to the message log using a translated message from
the internationalization system and sends out notifications to users.
Adds an entry to the message log using a translated message from the internationalization system and sends out notifications to users.
=over
=item userId
The id of the user that should receive this notification.
The id of the user that should receive this notification.
NOTE: This can be left blank if you're specifying a groupId.
NOTE: This can be left blank if you're specifying a groupId.
=item groupId
The id of the group that should receive this notification.
The id of the group that should receive this notification.
NOTE: This can be left blank if you're specifying a userId.
NOTE: This can be left blank if you're specifying a userId.
=item url
The URL of any action that should be taken based upon this
notification (if any).
The URL of any action that should be taken based upon this notification (if any).
=item internationalId
The unique identifier from the internationalization system of the message to send.
The unique identifier from the internationalization system of the message to send.
=item namespace
The namespace from the internationalization system of the message to send. Defaults to "WebGUI";
The namespace from the internationalization system of the message to send. Defaults to "WebGUI";
=item status
Defaults to 'notice'. Can be 'pending', 'notice', or 'completed'.
Defaults to 'notice'. Can be 'pending', 'notice', or 'completed'.
=back
=cut
@ -207,11 +212,15 @@ sub addInternationalizedEntry {
=head2 completeEntry ( messageLogId )
Set a message log entry to complete.
Set a message log entry to complete.
=over
=item messageLogId
The id of the message to complete.
The id of the message to complete.
=back
=cut

View file

@ -25,7 +25,7 @@ use WebGUI::URL;
=head1 NAME
Package WebGUI::Navigation
Package WebGUI::Navigation
=head1 SYNOPSIS
@ -37,11 +37,11 @@ use WebGUI::URL;
=head1 DESCRIPTION
A package used to generate navigation.
A package used to generate navigation.
=head1 METHODS
These methods are available from this package:
These methods are available from this package:
=cut
@ -49,21 +49,23 @@ use WebGUI::URL;
=head2 drawHorizontal ( tree [ , seperator, class ] )
Draws a vertical navigation system. Returns HTML.
Draws a vertical navigation system. Returns HTML.
=over
=item tree
The hash reference created by the tree method in this package.
The hash reference created by the tree method in this package.
=item seperator
A string containing HTML to seperate each navigation item. Defaults
to "&middot;".
A string containing HTML to seperate each navigation item. Defaults to "&middot;".
=item class
A stylesheet class for each link in the navigation. Defaults to
"horizontalMenu".
A stylesheet class for each link in the navigation. Defaults to "horizontalMenu".
=back
=cut
@ -94,29 +96,31 @@ sub drawHorizontal {
=head2 drawVertical ( tree [, bullet, class, spacing, indent ] )
Draws a vertical navigation system. Returns HTML.
Draws a vertical navigation system. Returns HTML.
=over
=item tree
The hash reference created by the tree method in this package.
The hash reference created by the tree method in this package.
=item bullet
A string containing HTML to generate a bullet that will be placed
in front of each tree item. Defaults to none.
A string containing HTML to generate a bullet that will be placed in front of each tree item. Defaults to none.
=item class
A stylesheet class for each link in the navigation. Defaults to
"verticalMenu".
A stylesheet class for each link in the navigation. Defaults to "verticalMenu".
=item spacing
An integer with the linespacing for the navigation. Defaults to 1.
An integer with the linespacing for the navigation. Defaults to 1.
=item indent
An integer with the about of indenting to start with. Defaults to 0.
An integer with the about of indenting to start with. Defaults to 0.
=back
=cut
@ -148,9 +152,7 @@ sub drawVertical {
=head2 tree ( parentId [, toLevel ] )
Generates and returns a hash reference containing a page tree with
keys of "url", "title", and "sub" with orignating keys of page ids.
The tree looks like this:
Generates and returns a hash reference containing a page tree with keys of "url", "title", and "sub" with orignating keys of page ids. The tree looks like this:
root
|-pageId
@ -166,14 +168,17 @@ sub drawVertical {
`-pageId
`-etc
=over
=item parentId
The page id of where you'd like to start the tree.
The page id of where you'd like to start the tree.
=item toLevel
The depth the tree should be traversed. Defaults to "0". If set to
"0" the entire tree will be traversed.
The depth the tree should be traversed. Defaults to "0". If set to "0" the entire tree will be traversed.
=back
=cut

View file

@ -22,7 +22,7 @@ use WebGUI::Session;
=head1 NAME
Package WebGUI::Node
Package WebGUI::Node
=head1 SYNOPSIS
@ -35,15 +35,12 @@ use WebGUI::Session;
$node->getURL;
=head1 DESCRIPTION
Package to manipulate WebGUI storage nodes. The nodes system is a
two-tiered filesystem hash that WebGUI uses to keep attachment
data separated. There should be no need for anyone other than
Plain Black Software to use this package.
Package to manipulate WebGUI storage nodes. The nodes system is a two-tiered filesystem hash that WebGUI uses to keep attachment data separated. There should be no need for anyone other than Plain Black Software to use this package.
=head1 METHODS
These methods are available from this package:
These methods are available from this package:
=cut
@ -52,7 +49,7 @@ use WebGUI::Session;
=head2 create ( )
Creates this node on the file system.
Creates this node on the file system.
=cut
@ -76,7 +73,7 @@ sub create {
=head2 delete ( )
Deletes this node and its contents (if any) from the filesystem.
Deletes this node and its contents (if any) from the filesystem.
=cut
@ -89,7 +86,7 @@ sub delete {
=head2 getPath ( )
Returns a full path to this node.
Returns a full path to this node.
=cut
@ -107,7 +104,7 @@ sub getPath {
=head2 getURL ( )
Returns a full URL to this node.
Returns a full URL to this node.
=cut
@ -125,7 +122,19 @@ sub getURL {
=head2 new ( node1 [, node2 ] )
Constructor.
Constructor.
=over
=item node1
The first level of the hash heirarchy.
=item node2
The second level of the hash heirarchy.
=back
=cut

View file

@ -28,7 +28,7 @@ use WebGUI::Template;
=head1 NAME
Package WebGUI::Page
Package WebGUI::Page
=head1 SYNOPSIS
@ -42,11 +42,11 @@ use WebGUI::Template;
=head1 DESCRIPTION
This package provides utility functions for WebGUI's page system.
This package provides utility functions for WebGUI's page system.
=head1 METHODS
These functions are available from this package:
These functions are available from this package:
=cut
@ -60,11 +60,15 @@ sub _newPositionFormat {
=head2 countTemplatePositions ( templateId )
Returns the number of template positions in the specified page template.
Returns the number of template positions in the specified page template.
=over
=item templateId
The id of the page template you wish to count.
The id of the page template you wish to count.
=back
=cut
@ -82,11 +86,15 @@ sub countTemplatePositions {
=head2 drawTemplate ( templateId )
Returns an HTML string containing a small representation of the page template.
Returns an HTML string containing a small representation of the page template.
=over
=item templateId
The id of the page template you wish to draw.
The id of the page template you wish to draw.
=back
=cut
@ -104,8 +112,7 @@ sub drawTemplate {
=head2 getTemplateList
Returns a hash reference containing template ids and template titles
for all the page templates available in the system.
Returns a hash reference containing template ids and template titles for all the page templates available in the system.
=cut
@ -117,11 +124,15 @@ sub getTemplateList {
=head2 getTemplate ( templateId )
Returns an HTML template.
Returns an HTML template.
=over
=item templateId
The id of the page template you wish to retrieve.
The id of the page template you wish to retrieve.
=back
=cut
@ -135,12 +146,15 @@ sub getTemplate {
=head2 getTemplatePositions ( templateId )
Returns a hash reference containing the positions available in
the specified page template.
Returns a hash reference containing the positions available in the specified page template.
=over
=item templateId
The id of the page template you wish to retrieve the positions from.
The id of the page template you wish to retrieve the positions from.
=back
=cut
@ -157,15 +171,19 @@ sub getTemplatePositions {
=head2 makeUnique ( pageURL, pageId )
Returns a unique page URL.
Returns a unique page URL.
=over
=item url
The URL you're hoping for.
The URL you're hoping for.
=item pageId
The page id of the page you're creating a URL for.
The page id of the page you're creating a URL for.
=back
=cut

View file

@ -21,7 +21,7 @@ use WebGUI::URL;
=head1 NAME
Package WebGUI::Paginator
Package WebGUI::Paginator
=head1 SYNOPSIS
@ -45,11 +45,11 @@ use WebGUI::URL;
=head1 DESCRIPTION
Package that paginates rows of arbitrary data for display on the web.
Package that paginates rows of arbitrary data for display on the web.
=head1 METHODS
These methods are available from this class:
These methods are available from this class:
=cut
@ -58,13 +58,15 @@ use WebGUI::URL;
=head2 getBar ( [ pageNumber ] )
Returns the pagination bar including First, Previous, Next, and
last links. If there's only one page, nothing is returned.
Returns the pagination bar including First, Previous, Next, and last links. If there's only one page, nothing is returned.
=over
=item pageNumber
Defaults to the page you're currently viewing. This is mostly here
as an override and probably has no real use.
Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
=back
=cut
@ -91,14 +93,15 @@ sub getBar {
=head2 getBarAdvanced ( [ pageNumber ] )
Returns the pagination bar including First, Previous, Page Numbers,
Next, and Last links. If there's only one page, nothing is
returned.
Returns the pagination bar including First, Previous, Page Numbers, Next, and Last links. If there's only one page, nothing is returned.
=over
=item pageNumber
Defaults to the page you're currently viewing. This is mostly here
as an override and probably has no real use.
Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
=back
=cut
@ -127,13 +130,15 @@ sub getBarAdvanced {
=head2 getBarSimple ( [ pageNumber ] )
Returns the pagination bar including only Previous and Next links.
If there's only one page, nothing is returned.
Returns the pagination bar including only Previous and Next links. If there's only one page, nothing is returned.
=over
=item pageNumber
Defaults to the page you're currently viewing. This is mostly here
as an override and probably has no real use.
Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
=back
=cut
@ -156,14 +161,15 @@ sub getBarSimple {
=head2 getBarTraditional ( [ pageNumber ] )
Returns the pagination bar including Previous, Page Numbers,
and Next links. If there's only one page, nothing is
returned.
Returns the pagination bar including Previous, Page Numbers, and Next links. If there's only one page, nothing is returned.
=over
=item pageNumber
Defaults to the page you're currently viewing. This is mostly here
as an override and probably has no real use.
Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
=back
=cut
@ -188,12 +194,15 @@ sub getBarTraditional {
=head2 getFirstPageLink ( [ pageNumber ] )
Returns a link to the first page's data.
Returns a link to the first page's data.
=over
=item pageNumber
Defaults to the page you're currently viewing. This is mostly here
as an override and probably has no real use.
Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
=back
=cut
@ -215,12 +224,15 @@ sub getFirstPageLink {
=head2 getLastPageLink ( [ pageNumber ] )
Returns a link to the last page's data.
Returns a link to the last page's data.
=over
=item pageNumber
Defaults to the page you're currently viewing. This is mostly here
as an override and probably has no real use.
Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
=back
=cut
@ -242,12 +254,15 @@ sub getLastPageLink {
=head2 getNextPageLink ( [ pageNumber ] )
Returns a link to the next page's data.
Returns a link to the next page's data.
=over
=item pageNumber
Defaults to the page you're currently viewing. This is mostly here
as an override and probably has no real use.
Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
=back
=cut
@ -267,7 +282,7 @@ sub getNextPageLink {
=head2 getNumberOfPages ( )
Returns the number of pages in this paginator.
Returns the number of pages in this paginator.
=cut
@ -282,15 +297,17 @@ sub getNumberOfPages {
=head2 getPage ( [ pageNumber ] )
Returns the data from the page specified as a string.
Returns the data from the page specified as a string.
NOTE: This is really only useful if you passed in an array reference
of strings when you created this object.
NOTE: This is really only useful if you passed in an array reference of strings when you created this object.
=over
=item pageNumber
Defaults to the page you're currently viewing. This is mostly here
as an override and probably has no real use.
Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
=back
=cut
@ -303,12 +320,15 @@ sub getPage {
=head2 getPageData ( [ pageNumber ] )
Returns the data from the page specified as an array reference.
Returns the data from the page specified as an array reference.
=over
=item pageNumber
Defaults to the page you're currently viewing. This is mostly here
as an override and probably has no real use.
Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
=back
=cut
@ -331,8 +351,7 @@ sub getPageData {
=head2 getPageNumber ( )
Returns the current page number. If no page number can be found
then it returns 1.
Returns the current page number. If no page number can be found then it returns 1.
=cut
@ -344,12 +363,15 @@ sub getPageNumber {
=head2 getPageLinks ( [ pageNumber ] )
Returns links to all pages in this paginator.
Returns links to all pages in this paginator.
=over
=item pageNumber
Defaults to the page you're currently viewing. This is mostly here
as an override and probably has no real use.
Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
=back
=cut
@ -373,12 +395,15 @@ sub getPageLinks {
=head2 getPreviousPageLink ( [ pageNumber ] )
Returns a link to the previous page's data.
Returns a link to the previous page's data.
=over
=item pageNumber
Defaults to the page you're currently viewing. This is mostly here
as an override and probably has no real use.
Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
=back
=cut
@ -398,32 +423,31 @@ sub getPreviousPageLink {
=head2 new ( currentURL, rowArrayRef [, paginateAfter, pageNumber, formVar ] )
Constructor.
Constructor.
=over
=item currentURL
The URL of the current page including attributes. The page number
will be appended to this in all links generated by the paginator.
The URL of the current page including attributes. The page number will be appended to this in all links generated by the paginator.
=item rowArrayRef
An array reference to all the rows of data for this page.
An array reference to all the rows of data for this page.
=item paginateAfter
The number of rows to display per page. If left blank it defaults
to 50.
The number of rows to display per page. If left blank it defaults to 50.
=item pageNumber
By default the paginator uses a form variable of "pn" to determine the
page number. If you wish it to use some other variable, then specify
the page number here.
By default the paginator uses a form variable of "pn" to determine the page number. If you wish it to use some other variable, then specify the page number here.
=item formVar
Specify the form variable the paginator should use in it's links.
Defaults to "pn".
Specify the form variable the paginator should use in it's links. Defaults to "pn".
=back
=cut
@ -442,18 +466,21 @@ sub new {
=head2 setDataByQuery ( query [, dbh ] )
Retrieves a data set from a database and replaces whatever data
set was passed in through the constructor.
Retrieves a data set from a database and replaces whatever data set was passed in through the constructor.
NOTE: This retrieves only the current page's data for efficiency.
NOTE: This retrieves only the current page's data for efficiency.
=over
=item query
An SQL query that will retrieve a data set.
An SQL query that will retrieve a data set.
=item dbh
A DBI-style database handler. Defaults to the WebGUI site handler.
A DBI-style database handler. Defaults to the WebGUI site handler.
=back
=cut

View file

@ -24,7 +24,7 @@ use WebGUI::URL;
=head1 NAME
Package WebGUI::Privilege
Package WebGUI::Privilege
=head1 SYNOPSIS
@ -41,12 +41,11 @@ use WebGUI::URL;
=head1 DESCRIPTION
This package provides access to the WebGUI security system
and security messages.
This package provides access to the WebGUI security system and security messages.
=head1 FUNCTIONS
These functions are available from this package:
These functions are available from this package:
=cut
@ -54,9 +53,7 @@ use WebGUI::URL;
=head2 adminOnly ( )
Returns a message stating that this functionality can only be used
by administrators. This method also sets the HTTP header status to
401.
Returns a message stating that this functionality can only be used by administrators. This method also sets the HTTP header status to 401.
=cut
@ -87,13 +84,15 @@ sub adminOnly {
=head2 canEditPage ( [ pageId ] )
Returns a boolean (0|1) value signifying that the user has the
required privileges.
Returns a boolean (0|1) value signifying that the user has the required privileges.
=over
=item pageId
The unique identifier for the page that you wish to check the
privileges on. Defaults to the current page id.
The unique identifier for the page that you wish to check the privileges on. Defaults to the current page id.
=back
=cut
@ -123,14 +122,15 @@ sub canEditPage {
=head2 canViewPage ( [ pageId ] )
Returns a boolean (0|1) value signifying that the user has the
required privileges. Always returns true for Admins and users that
have the rights to edit this page.
Returns a boolean (0|1) value signifying that the user has the required privileges. Always returns true for Admins and users that have the rights to edit this page.
=over
=item pageId
The unique identifier for the page that you wish to check the
privileges on. Defaults to the current page id.
The unique identifier for the page that you wish to check the privileges on. Defaults to the current page id.
=back
=cut
@ -165,9 +165,7 @@ sub canViewPage {
=head2 insufficient ( )
Returns a message stating that the user does not have the required
privileges to perform the operation they requested. This method
also sets the HTTP header status to 401.
Returns a message stating that the user does not have the required privileges to perform the operation they requested. This method also sets the HTTP header status to 401.
=cut
@ -193,17 +191,19 @@ sub insufficient {
=head2 isInGroup ( groupId [ , userId ] )
Returns a boolean (0|1) value signifying that the user has the
required privileges. Always returns true for Admins.
Returns a boolean (0|1) value signifying that the user has the required privileges. Always returns true for Admins.
=over
=item groupId
The group that you wish to verify against the user.
The group that you wish to verify against the user.
=item userId
The user that you wish to verify against the group. Defaults to the
currently logged in user.
The user that you wish to verify against the group. Defaults to the currently logged in user.
=back
=cut
@ -277,9 +277,7 @@ sub isInGroup {
=head2 noAccess ( )
Returns a message stating that the user does not have the privileges
necessary to access this page. This method also sets the HTTP header
status to 401.
Returns a message stating that the user does not have the privileges necessary to access this page. This method also sets the HTTP header status to 401.
=cut
@ -308,9 +306,7 @@ sub noAccess {
=head2 notMember ( )
Returns a message stating that the user they requested information
about is no longer active on this server. This method also sets the
HTTP header status to 400.
Returns a message stating that the user they requested information about is no longer active on this server. This method also sets the HTTP header status to 400.
=cut
@ -335,9 +331,7 @@ sub notMember {
=head2 vitalComponent ( )
Returns a message stating that the user made a request to delete
something that should never delete. This method also sets the HTTP
header status to 403.
Returns a message stating that the user made a request to delete something that should never delete. This method also sets the HTTP header status to 403.
=cut

View file

@ -21,7 +21,7 @@ use WebGUI::URL;
=head1 NAME
Package WebGUI::Profile
Package WebGUI::Profile
=head1 SYNOPSIS
@ -30,11 +30,11 @@ use WebGUI::URL;
=head1 DESCRIPTION
Package that allows getting and setting of user profile information.
Package that allows getting and setting of user profile information.
=head1 METHODS
These methods are available from this class:
These methods are available from this class:
=cut
@ -43,7 +43,7 @@ use WebGUI::URL;
=head2 get ( )
Returns a profile hash for this user.
Returns a profile hash for this user.
=cut
@ -58,12 +58,16 @@ sub get {
=head2 new ( userId )
Constructor.
Constructor.
=over
=item userId
The userId for the profile you wish to manipulate.
=back
=cut
sub new {
@ -75,17 +79,21 @@ sub new {
#-------------------------------------------------------------------
=head setAttribute ( attributeName, value )
=head2 setAttribute ( attributeName, value )
Sets the value of an attribute.
Sets the value of an attribute.
=over
=item attributeName
An attribute of the user profile.
An attribute of the user profile.
=item value
The value to set the above named attribute to.
The value to set the above named attribute to.
=back
=cut

View file

@ -27,7 +27,7 @@ our @EXPORT = qw(&quote &getNextId);
=head1 NAME
Package WebGUI::SQL
Package WebGUI::SQL
=head1 SYNOPSIS
@ -58,13 +58,11 @@ our @EXPORT = qw(&quote &getNextId);
=head1 DESCRIPTION
Package for interfacing with SQL databases. This package
implements Perl DBI functionality in a less code-intensive
manner and adds some extra functionality.
Package for interfacing with SQL databases. This package implements Perl DBI functionality in a less code-intensive manner and adds some extra functionality.
=head1 METHODS
These methods are available from this package:
These methods are available from this package:
=cut
@ -73,7 +71,7 @@ our @EXPORT = qw(&quote &getNextId);
=head2 array ( )
Returns the next row of data as an array.
Returns the next row of data as an array.
=cut
@ -86,16 +84,19 @@ sub array {
=head2 buildArray ( sql [, dbh ] )
Builds an array of data from a series of rows.
Builds an array of data from a series of rows.
=over
=item sql
An SQL query. The query must select only one column of data.
An SQL query. The query must select only one column of data.
=item dbh
By default this method uses the WebGUI database handler. However,
you may choose to pass in your own if you wish.
By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
=back
=cut
@ -116,17 +117,19 @@ sub buildArray {
=head2 buildHash ( sql [, dbh ] )
Builds a hash of data from a series of rows.
Builds a hash of data from a series of rows.
=over
=item sql
An SQL query. The query must select only two columns of data, the
first being the key for the hash, the second being the value.
An SQL query. The query must select only two columns of data, the first being the key for the hash, the second being the value.
=item dbh
By default this method uses the WebGUI database handler. However,
you may choose to pass in your own if you wish.
By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
=back
=cut
@ -146,17 +149,19 @@ sub buildHash {
=head2 buildHashRef ( sql [, dbh ] )
Builds a hash reference of data from a series of rows.
Builds a hash reference of data from a series of rows.
=over
=item sql
An SQL query. The query must select only two columns of data, the
first being the key for the hash, the second being the value.
An SQL query. The query must select only two columns of data, the first being the key for the hash, the second being the value.
=item dbh
By default this method uses the WebGUI database handler. However,
you may choose to pass in your own if you wish.
By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
=back
=cut
@ -172,7 +177,7 @@ sub buildHashRef {
=head2 errorCode {
Returns an error code for the current handler.
Returns an error code for the current handler.
=cut
@ -185,7 +190,7 @@ sub errorCode {
=head2 errorMessage {
Returns a text error message for the current handler.
Returns a text error message for the current handler.
=cut
@ -198,7 +203,7 @@ sub errorMessage {
=head2 finish ( )
Ends a query after calling the "new" or "read" methods.
Ends a query after calling the "new" or "read" methods.
=cut
@ -211,7 +216,7 @@ sub finish {
=head2 getColumnNames {
Returns an array of column names. Use with a "read" method.
Returns an array of column names. Use with a "read" method.
=cut
@ -224,14 +229,17 @@ sub getColumnNames {
=head2 getNextId ( idName )
Increments an incrementer of the specified type and returns the
value. NOTE: This is not a regular method, but is an exported
subroutine.
Increments an incrementer of the specified type and returns the value.
NOTE: This is not a regular method, but is an exported subroutine.
=over
=item idName
Specify the name of one of the incrementers in the incrementer
table.
Specify the name of one of the incrementers in the incrementer table.
=back
=cut
@ -245,10 +253,9 @@ sub getNextId {
#-------------------------------------------------------------------
=head2 hash
=head2 hash ( )
Returns the next row of data in the form of a hash. Must be
executed on a statement handler returned by the "read" method.
Returns the next row of data in the form of a hash. Must be executed on a statement handler returned by the "read" method.
=cut
@ -265,10 +272,9 @@ sub hash {
#-------------------------------------------------------------------
=head2 hashRef
=head2 hashRef ( )
Returns the next row of data in the form of a hash reference. Must
be executed on a statement handler returned by the "read" method.
Returns the next row of data in the form of a hash reference. Must be executed on a statement handler returned by the "read" method.
=cut
@ -289,16 +295,19 @@ sub hashRef {
=head2 new ( sql [, dbh ] )
Constructor. Returns a statement handler.
Constructor. Returns a statement handler.
=over
=item sql
An SQL query.
An SQL query.
=item dbh
By default this method uses the WebGUI database handler. However,
you may choose to pass in your own if you wish.
By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
=back
=cut
@ -320,16 +329,19 @@ sub new {
=head2 quickArray ( sql [, dbh ] )
Executes a query and returns a single row of data as an array.
Executes a query and returns a single row of data as an array.
=over
=item sql
An SQL query.
An SQL query.
=item dbh
By default this method uses the WebGUI database handler. However,
you may choose to pass in your own if you wish.
By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
=back
=cut
@ -346,17 +358,19 @@ sub quickArray {
=head2 quickCSV ( sql [, dbh ] )
Executes a query and returns a comma delimited text blob with column
headers.
Executes a query and returns a comma delimited text blob with column headers.
=over
=item sql
An SQL query.
An SQL query.
=item dbh
By default this method uses the WebGUI database handler. However,
you may choose to pass in your own if you wish.
By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
=back
=cut
@ -377,16 +391,19 @@ sub quickCSV {
=head2 quickHash ( sql [, dbh ] )
Executes a query and returns a single row of data as a hash.
Executes a query and returns a single row of data as a hash.
=over
=item sql
An SQL query.
An SQL query.
=item dbh
By default this method uses the WebGUI database handler. However,
you may choose to pass in your own if you wish.
By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
=back
=cut
@ -406,17 +423,19 @@ sub quickHash {
=head2 quickHashRef ( sql [, dbh ] )
Executes a query and returns a single row of data as a hash
reference.
Executes a query and returns a single row of data as a hash reference.
=over
=item sql
An SQL query.
An SQL query.
=item dbh
By default this method uses the WebGUI database handler. However,
you may choose to pass in your own if you wish.
By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
=back
=cut
@ -436,17 +455,19 @@ sub quickHashRef {
=head2 quickTab ( sql [, dbh ] )
Executes a query and returns a tab delimited text blob with column
headers.
Executes a query and returns a tab delimited text blob with column headers.
=over
=item sql
An SQL query.
An SQL query.
=item dbh
By default this method uses the WebGUI database handler. However,
you may choose to pass in your own if you wish.
By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
=back
=cut
@ -466,13 +487,17 @@ sub quickTab {
=head2 quote ( string )
Returns a string quoted and ready for insert into the database.
NOTE: This is not a regular method, but is an exported subroutine.
Returns a string quoted and ready for insert into the database.
NOTE: This is not a regular method, but is an exported subroutine.
=over
=item string
Any scalar variable that needs to be escaped to be inserted into
the database.
Any scalar variable that needs to be escaped to be inserted into the database.
=back
=cut
@ -486,16 +511,19 @@ sub quote {
=head2 read ( sql [, dbh ] )
An alias of the "new" method. Returns a statement handler.
An alias of the "new" method. Returns a statement handler.
=over
=item sql
An SQL query.
An SQL query.
=item dbh
By default this method uses the WebGUI database handler. However,
you may choose to pass in your own if you wish.
By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
=back
=cut
@ -508,8 +536,7 @@ sub read {
=head2 rows ( )
Returns the number of rows in a statement handler created by the
"read" method.
Returns the number of rows in a statement handler created by the "read" method.
=cut
@ -522,19 +549,19 @@ sub rows {
=head2 unconditionalRead ( sql [, dbh ] )
An alias of the "read" method except that it will not cause a fatal
error in WebGUI if the query is invalid. This is useful for user
generated queries such as those in the SQL Report. Returns a
statement handler.
An alias of the "read" method except that it will not cause a fatal error in WebGUI if the query is invalid. This is useful for user generated queries such as those in the SQL Report. Returns a statement handler.
=over
=item sql
An SQL query.
An SQL query.
=item dbh
By default this method uses the WebGUI database handler. However,
you may choose to pass in your own if you wish.
By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
=back
=cut
@ -551,18 +578,19 @@ sub unconditionalRead {
=head2 write ( sql [, dbh ] )
A method specifically designed for writing to the database in an
efficient manner. Writing can be accomplished using the "new"
method, but it is not as efficient.
A method specifically designed for writing to the database in an efficient manner. Writing can be accomplished using the "new" method, but it is not as efficient.
=over
=item sql
An SQL insert or update.
An SQL insert or update.
=item dbh
By default this method uses the WebGUI database handler. However,
you may choose to pass in your own if you wish.
By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
=back
=cut

View file

@ -25,7 +25,7 @@ use WebGUI::SQL;
=head1 NAME
Package WebGUI::Search
Package WebGUI::Search
=head1 SYNOPSIS
@ -35,12 +35,11 @@ use WebGUI::SQL;
=head1 DESCRIPTION
A package built to take the hassle out of creating advanced search
functionality in WebGUI applications.
A package built to take the hassle out of creating advanced search functionality in WebGUI applications.
=head1 METHODS
These methods are available from this package:
These methods are available from this package:
=cut
@ -49,37 +48,31 @@ use WebGUI::SQL;
=head2 buildConstraints ( fieldList ) { [ all, atLeastOne, exactPhrase, without ] }
Generates and returns the constraints to an SQL where clause based
upon input from the user.
Generates and returns the constraints to an SQL where clause based upon input from the user.
=over
=item fieldList
An array reference that contains a list of the fields (table
columns) to be considered when searching.
An array reference that contains a list of the fields (table columns) to be considered when searching.
=item all
A form param with a comma or space separated list of key words to
search for in the fields of the fieldList. All the words listed
here must be found to be true.
A form param with a comma or space separated list of key words to search for in the fields of the fieldList. All the words listed here must be found to be true.
=item atLeastOne
A form param with a comma or space separated list of key words to
search for in the fields of the fieldList. Any of the words may
match in any of the fields for this to be true.
A form param with a comma or space separated list of key words to search for in the fields of the fieldList. Any of the words may match in any of the fields for this to be true.
=item exactPhrase
A form param with a phrase to search for in the fields of the
fieldList. The exact phrase must be found in one of the fields
to be true.
A form param with a phrase to search for in the fields of the fieldList. The exact phrase must be found in one of the fields to be true.
=item without
A form param with a comma or space separated list of key words to
search for in the fields of the fieldList. None of the words may
be found in any of the fields for this to be true.
A form param with a comma or space separated list of key words to search for in the fields of the fieldList. None of the words may be found in any of the fields for this to be true.
=back
=cut
@ -143,17 +136,19 @@ sub buildConstraints {
=head2 form ( hiddenFields ) { [ numResults ] }
Generates and returns the advanced search form.
Generates and returns the advanced search form.
=over
=item hiddenFields
A hash reference that contains any name/value pairs that should be
included as hidden fields in the search form.
A hash reference that contains any name/value pairs that should be included as hidden fields in the search form.
=item numResults
A form param that can optionally specify the number of results to
display. Defaults to 25.
A form param that can optionally specify the number of results to display. Defaults to 25.
=back
=cut
@ -201,6 +196,22 @@ sub form {
}
#-------------------------------------------------------------------
=head2 toggleURL ( [ pairs ] )
Returns a URL that toggles the value "search" in the user's scratch
variables on and off.
=over
=item pairs
URL name value pairs (this=that&foo=bar) to be passed with this toggle.
=back
=cut
sub toggleURL {
WebGUI::Session::setScratch("search",$session{form}{search});
my $url;

View file

@ -33,7 +33,7 @@ tie %session, 'Tie::CPHash';
=head1 NAME
Package WebGUI::Session
Package WebGUI::Session
=head1 SYNOPSIS
@ -53,23 +53,15 @@ tie %session, 'Tie::CPHash';
=head1 DESCRIPTION
This package is the heart and lifeblood of WebGUI. Without it WebGUI
could not exist. By using this package a package gains access to
WebGUI's $session variable which contains everything WebGUI needs to
know to operate.
This package is the heart and lifeblood of WebGUI. Without it WebGUI could not exist. By using this package a package gains access to WebGUI's $session variable which contains everything WebGUI needs to know to operate.
NOTE: It is important to distinguish the difference between a WebGUI
session and a user session. A user session is attached to a WebGUI
session. A WebGUI session is all of the basic data the WebGUI needs
to operate.
NOTE: It is important to distinguish the difference between a WebGUI session and a user session. A user session is attached to a WebGUI session. A WebGUI session is all of the basic data the WebGUI needs to operate.
TIP: The $session variable is a case-insensitive hash. The contents
of the has vary, but can be seen by adding debug=1 to the end of any
WebGUI URL while logged in as an admin user.
TIP: The $session variable is a case-insensitive hash. The contents of the has vary, but can be seen by adding debug=1 to the end of any WebGUI URL while logged in as an admin user.
=head1 METHODS
These subroutines are available from this package:
These subroutines are available from this package:
=cut
@ -248,8 +240,7 @@ sub _loadWobjects {
=head2 close
Cleans up a WebGUI session information from memory and disconnects from
any resources opened by the session.
Cleans up a WebGUI session information from memory and disconnects from any resources opened by the session.
=cut
@ -263,15 +254,19 @@ sub close {
=head2 convertVisitorToUser ( sessionId, userId )
Converts a visitor session to a user session.
Converts a visitor session to a user session.
=over
=item sessionId
The session to convert.
The session to convert.
=item userId
The user for the session to become.
The user for the session to become.
=back
=cut
@ -285,11 +280,15 @@ sub convertVisitorToUser {
=head2 end ( sessionId )
Removes the specified user session from memory and database.
Removes the specified user session from memory and database.
=over
=item sessionId
The session to end.
The session to end.
=back
=cut
@ -305,7 +304,7 @@ sub end {
=head2 httpHeader ( )
Generates an HTTP header.
Generates an HTTP header.
=cut
@ -328,11 +327,15 @@ sub httpHeader {
=head2 httpRedirect ( url )
Generates an HTTP header for redirect.
Generates an HTTP header for redirect.
=over
=item url
The URL to redirect to.
The URL to redirect to.
=back
=cut
@ -345,15 +348,19 @@ sub httpRedirect {
=head2 open ( webguiRoot [ , configFile ] )
Opens a closed ( or new ) WebGUI session.
Opens a closed ( or new ) WebGUI session.
=over
=item webguiRoot
The path to the WebGUI files.
The path to the WebGUI files.
=item configFile
The filename of the config file that WebGUI should operate from.
The filename of the config file that WebGUI should operate from.
=back
=cut
@ -461,12 +468,15 @@ sub open {
=head2 refreshPageInfo ( [ pageId ] )
Updates the WebGUI session to reflect new page information.
Updates the WebGUI session to reflect new page information.
=over
=item pageId
Defaults to page id "1". Specify the page id to change this WebGUI
session to use.
Defaults to page id "1". Specify the page id to change this WebGUI session to use.
=back
=cut
@ -484,13 +494,17 @@ sub refreshPageInfo {
=head2 refreshSessionVars ( sessionId )
Updates the user session variables from the database.
Updates the user session variables from the database.
NOTE: This also updates the user information.
NOTE: This also updates the user information.
=over
=item sessionId
The session id to update.
The session id to update.
=back
=cut
@ -503,13 +517,16 @@ sub refreshSessionVars {
=head2 refreshUserInfo ( userId )
Refreshes the user's information from the database into this user
session.
Refreshes the user's information from the database into this user session.
=over
=item userId
The user id to refresh into this session.
=back
=cut
sub refreshUserInfo {
@ -521,21 +538,23 @@ sub refreshUserInfo {
=head2 setCookie ( name, value [ , timeToLive ] )
Sends a cookie to the browser.
Sends a cookie to the browser.
=over
=item name
The name of the cookie to set. Must be unique from all other cookies
from this domain or it will overwrite that cookie.
The name of the cookie to set. Must be unique from all other cookies from this domain or it will overwrite that cookie.
=item value
The value to set.
The value to set.
=item timeToLive
The time that the cookie should remain in the browser. Defaults to
"+10y" (10 years from now).
The time that the cookie should remain in the browser. Defaults to "+10y" (10 years from now).
=back
=cut
@ -556,19 +575,19 @@ sub setCookie {
=head2 setScratch ( name, value )
Sets a scratch variable for this user session. Scratch variables are
just arbitrary bits of data that a programmer may wish to store in
a user session from page to page.
Sets a scratch variable for this user session. Scratch variables are just arbitrary bits of data that a programmer may wish to store in a user session from page to page.
=over
=item name
The name of the scratch variable.
The name of the scratch variable.
=item value
The value of the scratch variable. If the value is blank but defined
or if it is set to "-delete-" then the scratch variable will be
removed from the user session.
The value of the scratch variable. If the value is blank but defined or if it is set to "-delete-" then the scratch variable will be removed from the user session.
=back
=cut
@ -593,16 +612,19 @@ sub setScratch {
=head2 start ( userId [ , sessionId ] )
Start a new user session.
Start a new user session.
=over
=item userId
The user id of the user to create a session for.
The user id of the user to create a session for.
=item sessionId
Session id will be generated if not specified. In almost every case
you should let the system generate the session id.
Session id will be generated if not specified. In almost every case you should let the system generate the session id.
=back
=cut

View file

@ -25,7 +25,7 @@ use WebGUI::Template;
=head1 NAME
Package WebGUI::Style
Package WebGUI::Style
=head1 SYNOPSIS
@ -34,11 +34,11 @@ use WebGUI::Template;
=head1 DESCRIPTION
This package contains utility methods for WebGUI's style system.
This package contains utility methods for WebGUI's style system.
=head1 METHODS
These subroutines are available from this package:
These subroutines are available from this package:
=cut
@ -47,7 +47,7 @@ use WebGUI::Template;
=head2 get ( )
Returns a style based upon the current WebGUI session information.
Returns a style based upon the current WebGUI session information.
=cut

View file

@ -26,7 +26,7 @@ use WebGUI::SQL;
=head1 NAME
Package WebGUI::Template
Package WebGUI::Template
=head1 SYNOPSIS
@ -38,28 +38,32 @@ use WebGUI::SQL;
=head1 DESCRIPTION
This package contains utility methods for WebGUI's template system.
This package contains utility methods for WebGUI's template system.
=head1 METHODS
These subroutines are available from this package:
These subroutines are available from this package:
=cut
#-------------------------------------------------------------------
=head get ( [ templateId, namespace ] )
=head2 get ( [ templateId, namespace ] )
Returns a template.
Returns a template.
=over
=item templateId
Defaults to "1". Specify the templateId of the template to retrieve.
Defaults to "1". Specify the templateId of the template to retrieve.
=item namespace
Defaults to "Page". Specify the namespace of the template to retrieve.
Defaults to "Page". Specify the namespace of the template to retrieve.
=back
=cut
@ -76,12 +80,15 @@ sub get {
=head2 getList ( [ namespace ] )
Returns a hash reference containing template ids and template names
of all the templates in the specified namespace.
Returns a hash reference containing template ids and template names of all the templates in the specified namespace.
=over
=item namespace
Defaults to "Page". Specify the namespace to build the list for.
Defaults to "Page". Specify the namespace to build the list for.
=back
=cut
@ -95,16 +102,19 @@ sub getList {
=head2 process ( template [ , vars ] )
Evaluate a template replacing template commands for HTML.
Evaluate a template replacing template commands for HTML.
=over
=item template
The template to process.
The template to process.
=item vars
A hash reference containing template variables and loops. Automatically
includes the entire WebGUI session.
A hash reference containing template variables and loops. Automatically includes the entire WebGUI session.
=back
=cut

View file

@ -23,7 +23,7 @@ use WebGUI::Utility;
=head1 NAME
Package WebGUI::URL
Package WebGUI::URL
=head1 SYNOPSIS
@ -38,14 +38,11 @@ use WebGUI::Utility;
=head1 DESCRIPTION
This package provides URL writing functionality. It is important that
all WebGUI URLs be written using these methods so that they can contain
any extra information that WebGUI needs to add to the URLs in order
to function properly.
This package provides URL writing functionality. It is important that all WebGUI URLs be written using these methods so that they can contain any extra information that WebGUI needs to add to the URLs in order to function properly.
=head1 METHODS
These subroutines are available from this package:
These subroutines are available from this package:
=cut
@ -55,18 +52,22 @@ use WebGUI::Utility;
=head2 append ( url, pairs )
Returns a URL after adding some information to the end of it.
Returns a URL after adding some information to the end of it.
=over
=item url
The URL to append information to.
The URL to append information to.
=item pairs
Name value pairs to add to the URL in the form of:
Name value pairs to add to the URL in the form of:
name1=value1&name2=value2&name3=value3
=back
=cut
sub append {
@ -84,13 +85,17 @@ sub append {
=head2 escape ( string )
Encodes a string to make it safe to pass in a URL.
Encodes a string to make it safe to pass in a URL.
NOTE: See WebGUI::URL::unescape()
NOTE: See WebGUI::URL::unescape()
=over
=item string
The string to escape.
The string to escape.
=back
=cut
@ -103,18 +108,22 @@ sub escape {
=head2 gateway ( pageURL [ , pairs ] )
Generate a URL based on WebGUI's gateway script.
Generate a URL based on WebGUI's gateway script.
=over
=item pageURL
The urlized title of a page that you wish to create a URL for.
The urlized title of a page that you wish to create a URL for.
=item pairs
Name value pairs to add to the URL in the form of:
Name value pairs to add to the URL in the form of:
name1=value1&name2=value2&name3=value3
=back
=cut
sub gateway {
@ -133,12 +142,15 @@ sub gateway {
=head2 makeCompliant ( string )
Returns a string that has made into a WebGUI compliant URL.
Returns a string that has made into a WebGUI compliant URL.
=over
=item string
The string to make compliant. This is usually a page title or a
filename.
The string to make compliant. This is usually a page title or a filename.
=back
=cut
@ -158,14 +170,18 @@ sub makeCompliant {
=head2 page ( [ pairs ] )
Returns the URL of the current page.
Returns the URL of the current page.
=over
=item pairs
Name value pairs to add to the URL in the form of:
Name value pairs to add to the URL in the form of:
name1=value1&name2=value2&name3=value3
=back
=cut
sub page {
@ -184,13 +200,17 @@ sub page {
=head2 unescape
Decodes a string that was URL encoded.
Decodes a string that was URL encoded.
NOTE: See WebGUI::URL::escape()
NOTE: See WebGUI::URL::escape()
=over
=item string
The string to unescape.
The string to unescape.
=back
=cut
@ -202,13 +222,16 @@ sub unescape {
=head2 urlize ( string )
Same as makeCompliant except that it also lower-cases the string.
This is mainly meant for WebGUI page URLs.
Same as makeCompliant except that it also lower-cases the string. This is mainly meant for WebGUI page URLs.
=over
=item string
The string to urlize.
=back
=cut
sub urlize {

View file

@ -24,7 +24,7 @@ use WebGUI::Authentication;
=head1 NAME
Package WebGUI::User
Package WebGUI::User
=head1 SYNOPSIS
@ -45,12 +45,11 @@ use WebGUI::Authentication;
=head1 DESCRIPTION
This package provides an object-oriented way of managing WebGUI
users as well as getting/setting a users's profile data.
This package provides an object-oriented way of managing WebGUI users as well as getting/setting a users's profile data.
=head1 METHODS
These methods are available from this class:
These methods are available from this class:
=cut
@ -66,11 +65,15 @@ sub _create {
=head2 addToGroups ( groups )
Adds this user to the specified groups.
Adds this user to the specified groups.
=over
=item groups
An array reference containing a list of groups.
An array reference containing a list of groups.
=back
=cut
@ -89,13 +92,15 @@ sub addToGroups {
=head2 authMethod ( [ value ] )
Returns the authentication method for this user.
Returns the authentication method for this user.
=over
=item value
If specified, the authMethod is set to this value. The only valid
values are "WebGUI" and "LDAP". When a new account is created,
authMethod is defaulted to "WebGUI".
If specified, the authMethod is set to this value. The only valid values are "WebGUI" and "LDAP". When a new account is created, authMethod is defaulted to "WebGUI".
=back
=cut
@ -115,7 +120,7 @@ sub authMethod {
=head2 dateCreated ( )
Returns the epoch for when this user was created.
Returns the epoch for when this user was created.
=cut
@ -127,7 +132,7 @@ sub dateCreated {
=head2 delete ( )
Deletes this user.
Deletes this user.
=cut
@ -146,11 +151,15 @@ sub delete {
=head2 deleteFromGroups ( groups )
Deletes this user from the specified groups.
Deletes this user from the specified groups.
=over
=item groups
An array reference containing a list of groups.
An array reference containing a list of groups.
=back
=cut
@ -182,23 +191,23 @@ sub identifier {
=head2 karma ( amount, source, description )
Returns the current level of karma this user has earned.
Returns the current level of karma this user has earned.
=over
=item amount
An integer to modify this user's karma by. Note that this number can
be positive or negative.
An integer to modify this user's karma by. Note that this number can be positive or negative.
=item source
A descriptive source for this karma. Typically it would be something
like "MessageBoard (49)" or "Admin (3)". Source is used to track
where a karma modification came from.
A descriptive source for this karma. Typically it would be something like "MessageBoard (49)" or "Admin (3)". Source is used to track where a karma modification came from.
=item description
A description of why this user's karma was modified. For instance it
could be "Message Board Post" or "He was a good boy!".
A description of why this user's karma was modified. For instance it could be "Message Board Post" or "He was a good boy!".
=back
=cut
@ -214,7 +223,7 @@ sub karma {
=head2 lastUpdated ( )
Returns the epoch for when this user was last modified.
Returns the epoch for when this user was last modified.
=cut
@ -226,14 +235,15 @@ sub lastUpdated {
=head2 new ( userId )
Constructor.
Constructor.
=over
=item userId
The userId of the user you're creating an object reference for. If
left blank it will default to "1" (Visitor). If specified as "new"
then a new user account will be created and assigned the next
available userId.
The userId of the user you're creating an object reference for. If left blank it will default to "1" (Visitor). If specified as "new" then a new user account will be created and assigned the next available userId.
=back
=cut
@ -265,17 +275,19 @@ sub new {
=head2 profileField ( fieldName [ value ] )
Returns a profile field's value. If "value" is specified, it also
sets the field to that value.
Returns a profile field's value. If "value" is specified, it also sets the field to that value.
=over
=item fieldName
The profile field name such as "language" or "email" or
"cellPhone".
The profile field name such as "language" or "email" or "cellPhone".
=item value
The value to set the profile field name to.
The value to set the profile field name to.
=back
=cut
@ -297,12 +309,15 @@ sub profileField {
=head2 status ( [ value ] )
Returns the status of the user.
Returns the status of the user.
=over
=item value
If specified, the status is set to this value.
Possible values are 'Active', 'Selfdestructed' and 'Deactivated'.
If specified, the status is set to this value. Possible values are 'Active', 'Selfdestructed' and 'Deactivated'.
=back
=cut
@ -322,11 +337,15 @@ sub status {
=head2 username ( [ value ] )
Returns the username.
Returns the username.
=over
=item value
If specified, the username is set to this value.
If specified, the username is set to this value.
=back
=cut
@ -346,7 +365,7 @@ sub username {
=head2 userId ( )
Returns the userId for this user.
Returns the userId for this user.
=cut

View file

@ -27,7 +27,7 @@ our @EXPORT = qw(&makeTabSafe &makeArrayTabSafe &randomizeHash &commify &randomi
=head1 NAME
Package WebGUI::Utility
Package WebGUI::Utility
=head1 SYNOPSIS
@ -47,12 +47,11 @@ our @EXPORT = qw(&makeTabSafe &makeArrayTabSafe &randomizeHash &commify &randomi
=head1 DESCRIPTION
This package provides miscellaneous but useful utilities to the
WebGUI programmer.
This package provides miscellaneous but useful utilities to the WebGUI programmer.
=head1 METHODS
These subroutines are available from this package:
These subroutines are available from this package:
=cut
@ -61,11 +60,15 @@ our @EXPORT = qw(&makeTabSafe &makeArrayTabSafe &randomizeHash &commify &randomi
=head2 commify ( integer )
Returns a number with commas applied at each third character.
Returns a number with commas applied at each third character.
=over
=item integer
Any old number will do.
Any old number will do.
=back
=cut
@ -79,15 +82,19 @@ sub commify {
=head2 isIn ( value, list )
Returns a boolean value as to whether the value is in the array.
Returns a boolean value as to whether the value is in the array.
=over
=item value
The value to check for.
The value to check for.
=item list
An array to look for the value in.
An array to look for the value in.
=back
=cut
@ -115,13 +122,15 @@ sub isIn {
=head2 makeArrayCommaSafe ( array )
Searches through an array looking for commas and replaces them with
semi-colons. Also replaces carriage returns with spaces. This is
useful for exporting comma separated data.
Searches through an array looking for commas and replaces them with semi-colons. Also replaces carriage returns with spaces. This is useful for exporting comma separated data.
=over
=item array
A reference to the array to look through.
A reference to the array to look through.
=back
=cut
@ -137,14 +146,16 @@ sub makeArrayCommaSafe {
=head2 makeArrayTabSafe ( array )
Searches through an array looking for tabs and replaces them with
four spaces. Also replaces carriage returns with a space. This is
useful for exporting tab separated data.
Searches through an array looking for tabs and replaces them with four spaces. Also replaces carriage returns with a space. This is useful for exporting tab separated data.
=over
=item array
A reference to the array to look through.
=back
=cut
sub makeArrayTabSafe {
@ -159,11 +170,15 @@ sub makeArrayTabSafe {
=head2 makeCommaSafe ( text )
Replaces commas with semi-colons and carriage returns with spaces.
Replaces commas with semi-colons and carriage returns with spaces.
=over
=item text
The text to search through.
The text to search through.
=back
=cut
@ -177,13 +192,17 @@ sub makeCommaSafe {
#-------------------------------------------------------------------
=head2 makeCommaSafe ( text )
=head2 makeTabSafe ( text )
Replaces tabs with four spaces and carriage returns with a space each.
Replaces tabs with four spaces and carriage returns with a space each.
=over
=item text
The text to search through.
The text to search through.
=back
=cut
@ -199,15 +218,19 @@ sub makeTabSafe {
=head2 randint ( low, high )
Returns an integer between the low and high number.
Returns an integer between the low and high number.
=over
=item low
The lowest possible value. Defaults to 0.
The lowest possible value. Defaults to 0.
=item high
The highest possible value. Defaults to 1.
The highest possible value. Defaults to 1.
=back
=cut
@ -223,11 +246,15 @@ sub randint {
=head2 randomizeArray ( array )
Resorts an array in random order.
Resorts an array in random order.
=over
=item array
A reference to the array to randomize.
A reference to the array to randomize.
=back
=cut
@ -247,11 +274,15 @@ sub randomizeArray {
=head2 randomizeHash ( hashRef )
Resorts a hash tied to IxHash in random order. Returns a hash reference.
Resorts a hash tied to IxHash in random order. Returns a hash reference.
=over
=item hashRef
A reference hash to randomize.
A reference hash to randomize.
=back
=cut
@ -273,11 +304,15 @@ sub randomizeHash {
=head2 round ( real )
Returns an integer after rounding a real number.
Returns an integer after rounding a real number.
=over
=item real
Any floating point number.
Any floating point number.
=back
=cut
@ -289,13 +324,17 @@ sub round {
=head2 sortHash ( hashRef )
Sorts a hash by its values. Returns a hash reference.
Sorts a hash by its values. Returns a hash reference.
TIP: This subroutine can screw up your hash if the values aren't all unique.
TIP: This subroutine can screw up your hash if the values aren't all unique.
=over
=item hashRef
A reference to the hash to be sorted.
A reference to the hash to be sorted.
=back
=cut
@ -317,13 +356,17 @@ sub sortHash {
=head2 sortHashDecending
Sorts a hash in decending order by its values. Returns a hash reference.
Sorts a hash in decending order by its values. Returns a hash reference.
TIP: This subroutine can screw up your hash if the values aren't all unique.
TIP: This subroutine can screw up your hash if the values aren't all unique.
=over
=item hashRef
A reference to the hash to be sorted.
A reference to the hash to be sorted.
=back
=cut

View file

@ -35,22 +35,22 @@ use WebGUI::Utility;
=head1 NAME
Package WebGUI::Wobject
Package WebGUI::Wobject
=head1 SYNOPSIS
use WebGUI::Wobject;
our @ISA = qw(WebGUI::Wobject);
See the subclasses in lib/WebGUI/Wobjects for details.
See the subclasses in lib/WebGUI/Wobjects for details.
=head1 DESCRIPTION
An abstract class for all other wobjects to extend.
An abstract class for all other wobjects to extend.
=head1 METHODS
These methods are available from this class:
These methods are available from this class:
=cut
@ -77,24 +77,25 @@ sub _getNextSequenceNumber {
=head2 confirm ( message, yesURL, [ , noURL, vitalComparison ] )
=over
=item message
A string containing the message to prompt the user for this action.
A string containing the message to prompt the user for this action.
=item yesURL
A URL to the web method to execute if the user confirms the action.
A URL to the web method to execute if the user confirms the action.
=item noURL
A URL to the web method to execute if the user denies the action.
Defaults back to the current page.
A URL to the web method to execute if the user denies the action. Defaults back to the current page.
=item vitalComparison
A comparison expression to be used when checking whether the action
should be allowed to continue. Typically this is used when the
action is a delete of some sort.
A comparison expression to be used when checking whether the action should be allowed to continue. Typically this is used when the action is a delete of some sort.
=back
=cut
@ -119,19 +120,23 @@ sub confirm {
=head2 deleteCollateral ( tableName, keyName, keyValue )
Deletes a row of collateral data.
Deletes a row of collateral data.
=over
=item tableName
The name of the table you wish to delete the data from.
The name of the table you wish to delete the data from.
=item keyName
The name of the column that is the primary key in the table.
The name of the column that is the primary key in the table.
=item keyValue
An integer containing the key value.
An integer containing the key value.
=back
=cut
@ -145,7 +150,7 @@ sub deleteCollateral {
=head2 description ( )
Returns this instance's description if it exists.
Returns this instance's description if it exists.
=cut
@ -159,8 +164,7 @@ sub description {
=head2 discussionProperties ( )
Returns a formRow list of discussion properties, which may be
attached to any Wobject.
Returns a formRow list of discussion properties, which may be attached to any Wobject.
=cut
@ -215,7 +219,7 @@ sub discussionProperties {
=head2 displayTitle ( )
Returns this instance's title if displayTitle is set to yes.
Returns this instance's title if displayTitle is set to yes.
=cut
@ -231,15 +235,17 @@ sub displayTitle {
=head2 duplicate ( [ pageId ] )
Duplicates this wobject with a new wobject ID. Returns the new
wobject Id.
Duplicates this wobject with a new wobject ID. Returns the new wobject Id.
NOTE: This method is meant to be extended by all sub-classes.
NOTE: This method is meant to be extended by all sub-classes.
=over
=item pageId
If specified the wobject will be duplicated to this pageId,
otherwise it will be duplicated to the clipboard.
If specified the wobject will be duplicated to this pageId, otherwise it will be duplicated to the clipboard.
=back
=cut
@ -273,18 +279,21 @@ sub duplicate {
=head2 fileProperty ( name, labelId )
Returns a file property form row which can be used in any Wobject
properties page.
Returns a file property form row which can be used in any Wobject properties page.
NOTE: This method is meant for use with www_deleteFile.
NOTE: This method is meant for use with www_deleteFile.
=over
=item name
The name of the property that stores the filename.
The name of the property that stores the filename.
=item labelId
The internationalId of the form label for this file.
The internationalId of the form label for this file.
=back
=cut
@ -308,13 +317,15 @@ sub fileProperty {
=head2 get ( [ propertyName ] )
Returns a hash reference containing all of the properties of this
wobject instance.
Returns a hash reference containing all of the properties of this wobject instance.
=over
=item propertyName
If an individual propertyName is specified, then only that
property value is returned as a scalar.
If an individual propertyName is specified, then only that property value is returned as a scalar.
=back
=cut
@ -331,21 +342,23 @@ sub get {
=head2 getCollateral ( tableName, keyName, keyValue )
Returns a hash reference containing a row of collateral data.
Returns a hash reference containing a row of collateral data.
=over
=item tableName
The name of the table you wish to retrieve the data from.
The name of the table you wish to retrieve the data from.
=item keyName
The name of the column that is the primary key in the table.
The name of the column that is the primary key in the table.
=item keyValue
An integer containing the key value. If key value is equal to "new"
or null, then an empty hashRef containing only keyName=>"new" will
be returned to avoid strict errors.
An integer containing the key value. If key value is equal to "new" or null, then an empty hashRef containing only keyName=>"new" will be returned to avoid strict errors.
=back
=cut
@ -363,8 +376,7 @@ sub getCollateral {
=head2 inDateRange ( )
Returns a boolean value of whether the wobject should be displayed
based upon it's start and end dates.
Returns a boolean value of whether the wobject should be displayed based upon it's start and end dates.
=cut
@ -380,35 +392,31 @@ sub inDateRange {
=head2 moveCollateralDown ( tableName, idName, id [ , setName, setValue ] )
Moves a collateral data item down one position. This assumes that the
collateral data table has a column called "wobjectId" that identifies
the wobject, and a column called "sequenceNumber" that determines
the position of the data item.
Moves a collateral data item down one position. This assumes that the collateral data table has a column called "wobjectId" that identifies the wobject, and a column called "sequenceNumber" that determines the position of the data item.
=over
=item tableName
A string indicating the table that contains the collateral data.
A string indicating the table that contains the collateral data.
=item idName
A string indicating the name of the column that uniquely identifies
this collateral data item.
A string indicating the name of the column that uniquely identifies this collateral data item.
=item id
An integer that uniquely identifies this collateral data item.
An integer that uniquely identifies this collateral data item.
=item setName
By default this method assumes that the collateral will have a
wobject id in the table. However, since there is not always a wobject
id to separate one data set from another, you may specify another
field to do that.
By default this method assumes that the collateral will have a wobject id in the table. However, since there is not always a wobject id to separate one data set from another, you may specify another field to do that.
=item setValue
The value of the column defined by "setName" to select a data set
from.
The value of the column defined by "setName" to select a data set from.
=back
=cut
@ -434,35 +442,31 @@ sub moveCollateralDown {
=head2 moveCollateralUp ( tableName, idName, id [ , setName, setValue ] )
Moves a collateral data item up one position. This assumes that the
collateral data table has a column called "wobjectId" that identifies
the wobject, and a column called "sequenceNumber" that determines
the position of the data item.
Moves a collateral data item up one position. This assumes that the collateral data table has a column called "wobjectId" that identifies the wobject, and a column called "sequenceNumber" that determines the position of the data item.
=over
=item tableName
A string indicating the table that contains the collateral data.
A string indicating the table that contains the collateral data.
=item idName
A string indicating the name of the column that uniquely identifies
this collateral data item.
A string indicating the name of the column that uniquely identifies this collateral data item.
=item id
An integer that uniquely identifies this collateral data item.
An integer that uniquely identifies this collateral data item.
=item setName
By default this method assumes that the collateral will have a
wobject id in the table. However, since there is not always a wobject
id to separate one data set from another, you may specify another
field to do that.
By default this method assumes that the collateral will have a wobject id in the table. However, since there is not always a wobject id to separate one data set from another, you may specify another field to do that.
=item setValue
The value of the column defined by "setName" to select a data set
from.
The value of the column defined by "setName" to select a data set from.
=back
=cut
@ -488,21 +492,19 @@ sub moveCollateralUp {
=head2 new ( properties )
Constructor.
Constructor.
NOTE: This method should never need to be overridden or extended.
NOTE: This method should never need to be overridden or extended.
=over
=item properties
A hash reference containing at minimum "wobjectId" and "namespace"
and wobjectId may be set to "new" if you're creating a new
instance. This hash reference should be the one created by
WebGUI.pm and passed to the wobject subclass.
A hash reference containing at minimum "wobjectId" and "namespace" and wobjectId may be set to "new" if you're creating a new instance. This hash reference should be the one created by WebGUI.pm and passed to the wobject subclass.
NOTE: It may seem a little weird that the initial data for the
wobject instance is coming from WebGUI.pm, but this was done
to lessen database traffic thus increasing the speed of all
wobjects.
NOTE: It may seem a little weird that the initial data for the wobject instance is coming from WebGUI.pm, but this was done to lessen database traffic thus increasing the speed of all wobjects.
=back
=cut
@ -517,10 +519,14 @@ sub new {
Decides whether or not macros should be processed and returns the
appropriate output.
=over
=item output
An HTML blob to be processed for macros.
=back
=cut
sub processMacros {
@ -535,18 +541,21 @@ sub processMacros {
=head2 processTemplate ( templateId, vars )
Returns the content generated from this template.
Returns the content generated from this template.
NOTE: Only for use in wobjects that support templates.
NOTE: Only for use in wobjects that support templates.
=over
=item templateId
An id referring to a particular template in the templates table.
An id referring to a particular template in the templates table.
=item hashRef
A hash reference containing variables and loops to pass to the
template engine.
A hash reference containing variables and loops to pass to the template engine.
=back
=cut
@ -562,10 +571,9 @@ sub processTemplate {
=head2 purge ( )
Removes this wobject from the database and all it's attachments
from the filesystem.
Removes this wobject from the database and all it's attachments from the filesystem.
NOTE: This method is meant to be extended by all sub-classes.
NOTE: This method is meant to be extended by all sub-classes.
=cut
@ -583,27 +591,27 @@ sub purge {
=head2 reorderCollateral ( tableName, keyName [ , setName, setValue ] )
Resequences collateral data. Typically useful after deleting a
collateral item to remove the gap created by the deletion.
Resequences collateral data. Typically useful after deleting a collateral item to remove the gap created by the deletion.
=over
=item tableName
The name of the table to resequence.
The name of the table to resequence.
=item keyName
The key column name used to determine which data needs sorting within the table.
The key column name used to determine which data needs sorting within the table.
=item setName
Defaults to "wobjectId". This is used to define which data set to
reorder.
Defaults to "wobjectId". This is used to define which data set to reorder.
=item setValue
Used to define which data set to reorder. Defaults to the wobjectId
for this instance. Defaults to the value of "setName" in the wobject
properties.
Used to define which data set to reorder. Defaults to the wobjectId for this instance. Defaults to the value of "setName" in the wobject properties.
=back
=cut
@ -626,25 +634,23 @@ sub reorderCollateral {
=head2 set ( [ hashRef, arrayRef ] )
Stores the values specified in hashRef to the database.
Stores the values specified in hashRef to the database.
NOTE: This method should be extended by all subclasses.
NOTE: This method should be extended by all subclasses.
=over
=item hashRef
A hash reference of the properties of this wobject instance. This
method will accept any name/value pair and associate it with this
wobject instance in memory, but will only store the following
fields to the database:
A hash reference of the properties of this wobject instance. This method will accept any name/value pair and associate it with this wobject instance in memory, but will only store the following fields to the database:
title, displayTitle, description, processMacros,
pageId, templatePosition, startDate, endDate, sequenceNumber
title, displayTitle, description, processMacros, pageId, templatePosition, startDate, endDate, sequenceNumber
=item arrayRef
An array reference containing a list of properties associated
with this Wobject class. The items in the list should marry
up to fields in the Wobject extention table for this class.
An array reference containing a list of properties associated with this Wobject class. The items in the list should marry up to fields in the Wobject extention table for this class.
=back
=cut
@ -698,52 +704,39 @@ sub set {
=head2 setCollateral ( tableName, keyName, properties [ , useSequenceNumber, useWobjectId, setName, setValue ] )
Performs and insert/update of collateral data for any wobject's
collateral data. Returns the primary key value for that row of
data.
Performs and insert/update of collateral data for any wobject's collateral data. Returns the primary key value for that row of data.
=over
=item tableName
The name of the table to insert the data.
The name of the table to insert the data.
=item keyName
The column name of the primary key in the table specified above.
This must also be an incrementerId in the incrementer table.
The column name of the primary key in the table specified above. This must also be an incrementerId in the incrementer table.
=item properties
A hash reference containing the name/value pairs to be inserted
into the database where the name is the column name. Note that
the primary key should be specified in this list, and if it's value
is "new" or null a new row will be created.
A hash reference containing the name/value pairs to be inserted into the database where the name is the column name. Note that the primary key should be specified in this list, and if it's value is "new" or null a new row will be created.
=item useSequenceNumber
If set to "1", a new sequenceNumber will be generated and inserted
into the row. Note that this means you must have a sequenceNumber
column in the table. Also note that this requires the presence of
the wobjectId column. Defaults to "1".
If set to "1", a new sequenceNumber will be generated and inserted into the row. Note that this means you must have a sequenceNumber column in the table. Also note that this requires the presence of the wobjectId column. Defaults to "1".
=item useWobjectId
If set to "1", the current wobjectId will be inserted into the table
upon creation of a new row. Note that this means the table better
have a wobjectId column. Defaults to "1".
If set to "1", the current wobjectId will be inserted into the table upon creation of a new row. Note that this means the table better have a wobjectId column. Defaults to "1".
=item setName
If this collateral data set is not grouped by wobjectId, but by another
column then specify that column here. The useSequenceNumber parameter
will then use this column name instead of wobjectId to generate
the sequenceNumber.
If this collateral data set is not grouped by wobjectId, but by another column then specify that column here. The useSequenceNumber parameter will then use this column name instead of wobjectId to generate the sequenceNumber.
=item setValue
If you've specified a setName you may also set a value for that set.
Defaults to the value for this id from the wobject properties.
If you've specified a setName you may also set a value for that set. Defaults to the value for this id from the wobject properties.
=item
=back
=cut
@ -795,43 +788,11 @@ sub setCollateral {
}
#-------------------------------------------------------------------
=head2 templateProperties
Returns a list of template properties.
=cut
sub templateProperties {
my ($f, $templates, $templateId, $subtext);
$templateId = $_[0]->get("templateId") || 1;
if ($_[0]->get("wobjectId") ne "new" && $session{user}{uiLevel} >= 5) {
$subtext = '<a href="'.WebGUI::URL::page("op=editTemplate&tid=".$templateId."&return="
.WebGUI::URL::escape("func=edit&wid=".$_[0]->get("wobjectId"))).'">'
.WebGUI::International::get(741).'</a> / <a href="'.WebGUI::URL::page("op=listTemplates").'">'
.WebGUI::International::get(742).'</a>';
}
$templates = WebGUI::SQL->buildHashRef("select templateId,name from template where namespace="
.quote($_[0]->get("namespace"))." order by name");
$f = WebGUI::HTMLForm->new;
$f->select(
-name=>"templateId",
-options=>$templates,
-label=>WebGUI::International::get(740),
-value=>[$templateId],
-uiLevel=>1,
-subtext=>$subtext
);
return $f->printRowsOnly;
}
#-------------------------------------------------------------------
=head2 uiLevel
Returns the UI Level of a wobject. Defaults to "0" for all wobjects.
Override to set the UI Level higher for a given wobject.
Returns the UI Level of a wobject. Defaults to "0" for all wobjects. Override to set the UI Level higher for a given wobject.
=cut
@ -843,7 +804,7 @@ sub uiLevel {
=head2 www_approvePost ( )
Sets the status flag on a discussion message to "approved".
Sets the status flag on a discussion message to "approved".
=cut
@ -860,9 +821,9 @@ sub www_approvePost {
=head2 www_copy ( )
Copies this instance to the clipboard.
Copies this instance to the clipboard.
NOTE: Should never need to be overridden or extended.
NOTE: Should never need to be overridden or extended.
=cut
@ -879,7 +840,7 @@ sub www_copy {
=head2 www_cut ( )
Moves this instance to the clipboard.
Moves this instance to the clipboard.
=cut
@ -897,7 +858,7 @@ sub www_cut {
=head2 www_delete ( )
Prompts a user to confirm whether they wish to delete this instance.
Prompts a user to confirm whether they wish to delete this instance.
=cut
@ -925,7 +886,7 @@ sub www_delete {
=head2 www_deleteConfirm ( )
Moves this instance to the trash.
Moves this instance to the trash.
=cut
@ -944,7 +905,7 @@ sub www_deleteConfirm {
=head2 www_deleteFile ( )
Displays a confirmation message relating to the deletion of a file.
Displays a confirmation message relating to the deletion of a file.
=cut
@ -960,7 +921,7 @@ sub www_deleteFile {
=head2 www_deleteFileConfirm ( )
Deletes a file from this instance.
Deletes a file from this instance.
=cut
@ -974,8 +935,7 @@ sub www_deleteFileConfirm {
=head2 www_deleteMessage ( )
Displays a message asking for confirmation to delete a message from
a discussion.
Displays a message asking for confirmation to delete a message from a discussion.
=cut
@ -991,7 +951,7 @@ sub www_deleteMessage {
=head2 www_deleteMessageConfirm ( )
Deletes a message from a discussion.
Deletes a message from a discussion.
=cut
@ -1007,7 +967,7 @@ sub www_deleteMessageConfirm {
=head2 www_denyPost ( )
Sets the status flag on a discussion message to "denied".
Sets the status flag on a discussion message to "denied".
=cut
@ -1023,13 +983,17 @@ sub www_denyPost {
=head2 www_edit ( formRows )
Displays the common properties of any/all wobjects.
Displays the common properties of any/all wobjects.
NOTE: This method should be extended by all wobjects.
NOTE: This method should be extended by all wobjects.
=over
=item formRows
The custom form rows from the wobject subclass edit page.
The custom form rows from the wobject subclass edit page.
=back
=cut
@ -1097,9 +1061,9 @@ sub www_edit {
=head2 www_editSave ( )
Saves the default properties of any/all wobjects.
Saves the default properties of any/all wobjects.
NOTE: This method should be extended by all subclasses.
NOTE: This method should be extended by all subclasses.
=cut
@ -1137,7 +1101,7 @@ sub www_editSave {
=head2 www_lockThread ( )
Locks a discussion thread from the current message down.
Locks a discussion thread from the current message down.
=cut
@ -1154,7 +1118,7 @@ sub www_lockThread {
=head2 www_moveBottom ( )
Moves this instance to the bottom of the page.
Moves this instance to the bottom of the page.
=cut
@ -1172,7 +1136,7 @@ sub www_moveBottom {
=head2 www_moveDown ( )
Moves this instance down one spot on the page.
Moves this instance down one spot on the page.
=cut
@ -1197,7 +1161,7 @@ sub www_moveDown {
=head2 www_moveTop ( )
Moves this instance to the top of the page.
Moves this instance to the top of the page.
=cut
@ -1215,7 +1179,7 @@ sub www_moveTop {
=head2 www_moveUp ( )
Moves this instance up one spot on the page.
Moves this instance up one spot on the page.
=cut
@ -1240,7 +1204,7 @@ sub www_moveUp {
=head2 www_paste ( )
Moves this instance from the clipboard to the current page.
Moves this instance from the clipboard to the current page.
=cut
@ -1260,7 +1224,7 @@ sub www_paste {
=head2 www_post ( )
Displays a discussion message post form.
Displays a discussion message post form.
=cut
@ -1276,7 +1240,7 @@ sub www_post {
=head2 www_post ( )
Saves a message post to a discussion.
Saves a message post to a discussion.
=cut
@ -1293,7 +1257,7 @@ sub www_postSave {
=head2 www_search ( )
Searches an attached discussion.
Searches an attached discussion.
=cut
@ -1305,12 +1269,15 @@ sub www_search {
=head2 www_showMessage ( [menuItem] )
Shows a message from a discussion.
Shows a message from a discussion.
=over
=item menuItem
You can optionally extend this method by passing in an HTML string
of menu items to be added to the menu of this display.
You can optionally extend this method by passing in an HTML string of menu items to be added to the menu of this display.
=back
=cut
@ -1327,7 +1294,7 @@ sub www_showMessage {
=head2 www_unlockThread ( )
Unlocks a discussion thread from the current message on down.
Unlocks a discussion thread from the current message on down.
=cut
@ -1344,8 +1311,7 @@ sub www_unlockThread {
=head2 www_view ( )
The default display mechanism for any wobject. This web method MUST
be overridden.
The default display mechanism for any wobject. This web method MUST be overridden.
=cut