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

@ -95,6 +95,8 @@ sub box {
Copies an attachment from one node to another. Copies an attachment from one node to another.
=over
=item newNode =item newNode
Define the node to copy the attachment to. Define the node to copy the attachment to.
@ -103,6 +105,8 @@ sub box {
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 =cut
sub copy { sub copy {
@ -144,10 +148,13 @@ sub copy {
Generates a thumbnail for this attachment. Generates a thumbnail for this attachment.
=over
=item thumbnailSize =item thumbnailSize
Defaults to the global setting for thumbnail size. However, it Defaults to the global setting for thumbnail size. However, it can be overriden with this value. Specified in pixels.
can be overriden with this value. Specified in pixels.
=back
=cut =cut
@ -336,10 +343,7 @@ sub getSize {
=head2 getThumbnail ( ) =head2 getThumbnail ( )
Returns a full URL to the thumbnail for this attachment. Thumbnails 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.
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 =cut
@ -401,11 +405,11 @@ sub isImage {
Constructor. Constructor.
=over
=item filename =item filename
What is the filename for this attachment. If you'll be uploading 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.
the attachment using the "save" method then you may leave this
field blank.
=item node =item node
@ -413,8 +417,9 @@ sub isImage {
=item nodeSubordinate =item nodeSubordinate
The subordinate element of the node where this attachment is (or The subordinate element of the node where this attachment is (or will be placed).
will be placed).
=back
=cut =cut
@ -431,10 +436,14 @@ sub new {
Renames an attachment's filename. Renames an attachment's filename.
=over
=item newFilename =item newFilename
Define the new filename for this attachment. Define the new filename for this attachment.
=back
=cut =cut
sub rename { sub rename {
@ -447,13 +456,15 @@ sub rename {
=head2 resizeImage ( [ imageSize ] ) =head2 resizeImage ( [ imageSize ] )
Resizes this attachment to the specified size. Use this method only Resizes this attachment to the specified size. Use this method only if the attachment is an image.
if the attachment is an image.
=over
=item imageSize =item imageSize
Defaults to the max image size setting. Specify a value in pixels Defaults to the max image size setting. Specify a value in pixels to resize this image to.
to resize this image to.
=back
=cut =cut
@ -479,28 +490,23 @@ sub resizeImage {
=head2 save ( formVariableName [, thumbnailSize, imageSize ] ) =head2 save ( formVariableName [, thumbnailSize, imageSize ] )
Grabs an attachment from a form POST and saves it to a node. It Grabs an attachment from a form POST and saves it to a node. It then returns the filename of the attachment.
then returns the filename of the attachment.
=over
=item formVariableName =item formVariableName
Provide the form variable name to which the file being uploaded Provide the form variable name to which the file being uploaded is assigned.
is assigned.
=item thumbnailSize =item thumbnailSize
If an image is being uploaded a thumbnail will be generated 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.
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 =item imageSize
If a web image (gif, png, jpg, jpeg) is being uploaded it will be 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.
resized if it is larger than this value. By default images are
resized to stay within the contraints of the Max Image Size =back
setting in the file settings.
=cut =cut
@ -544,8 +550,9 @@ sub save {
=head2 saveFromFilesystem ( pathToFile [, thumbnailSize, imageSize ] ) =head2 saveFromFilesystem ( pathToFile [, thumbnailSize, imageSize ] )
Grabs an attachment from the server's file system and saves it to a node. It Grabs an attachment from the server's file system and saves it to a node. It then returns the filename of the attachment.
then returns the filename of the attachment.
=over
=item pathToFile =item pathToFile
@ -553,18 +560,13 @@ sub save {
=item thumbnailSize =item thumbnailSize
If an image is being grabbed a thumbnail will be generated 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.
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 =item imageSize
If a web image (gif, png, jpg, jpeg) is being grabbed it will be 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.
resized if it is larger than this value. By default images are
resized to stay within the contraints of the Max Image Size =back
setting in the file settings.
=cut =cut

View file

@ -1,14 +1,20 @@
package WebGUI::Authentication; package WebGUI::Authentication;
#------------------------------------------------------------------- =head1 LEGAL
# WebGUI is Copyright 2001-2002 Plain Black LLC.
#------------------------------------------------------------------- -------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license WebGUI is Copyright 2001-2002 Plain Black LLC.
# (docs/license.txt) that came with this distribution before using -------------------------------------------------------------------
# this software. Please read the legal notices (docs/legal.txt) and the license
#------------------------------------------------------------------- (docs/license.txt) that came with this distribution before using
# http://www.plainblack.com info@plainblack.com this software.
#------------------------------------------------------------------- -------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=cut
use strict qw(vars subs); use strict qw(vars subs);
use WebGUI::ErrorHandler; use WebGUI::ErrorHandler;
@ -16,6 +22,49 @@ use WebGUI::Session;
use WebGUI::SQL; 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 { sub _execute {
my ($authMethod, $function, $params) = @_; my ($authMethod, $function, $params) = @_;
@ -27,10 +76,12 @@ 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 =item userId
This user's id. This user's id.
@ -39,6 +90,8 @@ sub _execute {
Specify the authentication method. Specify the authentication method.
=back
=cut =cut
sub adminForm { sub adminForm {
@ -49,10 +102,12 @@ 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 =item userId
The user id to save the information for. The user id to save the information for.
@ -61,6 +116,8 @@ sub adminForm {
Specify the authentication method. Specify the authentication method.
=back
=cut =cut
sub adminFormSave { sub adminFormSave {
@ -71,14 +128,18 @@ 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 =item authMethod
Specify the authentication method. Specify the authentication method.
=back
=cut =cut
sub adminFormValidate { sub adminFormValidate {
@ -88,10 +149,11 @@ sub adminFormValidate {
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head authenticate ( userId, identifier, authMethod ) =head2 authenticate ( userId, identifier, authMethod )
Check to see that the user supplied information is correct. Returns Check to see that the user supplied information is correct. Returns "1" if successful otherwise it returns an error message.
"1" if successful otherwise it returns an error message.
=over
=item userId =item userId
@ -99,13 +161,14 @@ sub adminFormValidate {
=item identifier =item identifier
The password, pass phrase, PIN, or other unique identifier to The password, pass phrase, PIN, or other unique identifier to verify this user.
verify this user.
=item authMethod =item authMethod
The type of authentication to use to authenticate this user. The type of authentication to use to authenticate this user.
=back
=cut =cut
sub authenticate { sub authenticate {
@ -115,16 +178,18 @@ sub authenticate {
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head deleteParams ( userId ) =head2 deleteParams ( userId )
Removes the specified user's authentication parameters from the Removes the specified user's authentication parameters from the database for all authentication methods. This is primarily useful when deleting the user's account.
database for all authentication methods. This is primarily useful
when deleting the user's account. =over
=item userId =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 =cut
sub deleteParams { sub deleteParams {
@ -137,9 +202,11 @@ 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 =item userId
@ -147,8 +214,9 @@ sub deleteParams {
=item authMethod =item authMethod
Optionally specify the authentication method. Defaults to the system-wide Optionally specify the authentication method. Defaults to the system-wide authentication method.
authentication method.
=back
=cut =cut
@ -163,15 +231,18 @@ sub getParams {
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head optionsLabel ( authMethod ) =head2 optionsLabel ( authMethod )
Returns a label that can be displayed to describe the settings for Returns a label that can be displayed to describe the settings for this auth method.
this auth method.
=over
=item authMethod =item authMethod
The authentication method. The authentication method.
=back
=cut =cut
sub optionsLabel { sub optionsLabel {
@ -182,7 +253,7 @@ 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.
@ -195,15 +266,18 @@ sub registrationForm {
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head registrationFormSave ( userId ) =head2 registrationFormSave ( userId )
Creates the appropriate values in the database for this user based Creates the appropriate values in the database for this user based upon their registration information.
upon their registration information.
=over
=item userId =item userId
The user id to store with the registration data. The user id to store with the registration data.
=back
=cut =cut
sub registrationFormSave { sub registrationFormSave {
@ -213,7 +287,7 @@ 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.
@ -227,14 +301,18 @@ 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 =item authMethod
The authentication method to display the form for. The authentication method to display the form for.
=back
=cut =cut
sub settingsForm { sub settingsForm {
@ -245,10 +323,12 @@ 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 =item userId
Specify a user id. Specify a user id.
@ -261,6 +341,8 @@ sub settingsForm {
A hash reference containing parameter names and values to be saved. A hash reference containing parameter names and values to be saved.
=back
=cut =cut
sub saveParams { sub saveParams {
@ -276,7 +358,7 @@ sub saveParams {
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head userForm ( ) =head2 userForm ( )
Returns the user authentication data form. Returns the user authentication data form.
@ -290,7 +372,7 @@ sub userForm {
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head userFormSave ( ) =head2 userFormSave ( )
Saves user form data to the database. Saves user form data to the database.
@ -303,7 +385,7 @@ 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.

View file

@ -50,8 +50,7 @@ our @EXPORT = qw(&localtime &time &addToTime &addToDate &epochToHuman &epochToSe
=head1 DESCRIPTION =head1 DESCRIPTION
This package provides easy to use date math functions, which are This package provides easy to use date math functions, which are normally a complete pain.
normally a complete pain.
=head1 METHODS =head1 METHODS
@ -68,6 +67,8 @@ our @EXPORT = qw(&localtime &time &addToTime &addToDate &epochToHuman &epochToSe
Returns an epoch date with the amount of time added. Returns an epoch date with the amount of time added.
=over
=item epoch =item epoch
The number of seconds since January 1, 1970. The number of seconds since January 1, 1970.
@ -84,6 +85,8 @@ our @EXPORT = qw(&localtime &time &addToTime &addToDate &epochToHuman &epochToSe
The number of days to add to the epoch. The number of days to add to the epoch.
=back
=cut =cut
sub addToDate { sub addToDate {
@ -100,6 +103,8 @@ sub addToDate {
Returns an epoch date with the amount of time added. Returns an epoch date with the amount of time added.
=over
=item epoch =item epoch
The number of seconds since January 1, 1970. The number of seconds since January 1, 1970.
@ -116,6 +121,8 @@ sub addToDate {
The number of seconds to add to the epoch. The number of seconds to add to the epoch.
=back
=cut =cut
sub addToTime { sub addToTime {
@ -132,10 +139,14 @@ sub addToTime {
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 =item epoch
The number of seconds since January 1, 1970. The number of seconds since January 1, 1970.
=back
=cut =cut
sub dayStartEnd { sub dayStartEnd {
@ -152,14 +163,15 @@ sub dayStartEnd {
Returns a formated date string. Returns a formated date string.
=over
=item epoch =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 =item format
A string representing the output format for the date. Defaults to A string representing the output format for the date. Defaults to '%z %Z'. You can use the following to format your date string:
'%z %Z'. You can use the following to format your date string:
%% = % (percent) symbol. %% = % (percent) symbol.
%c = The calendar month name. %c = The calendar month name.
@ -181,6 +193,8 @@ sub dayStartEnd {
%z = The current user's date format preference. %z = The current user's date format preference.
%Z = The current user's time format preference. %Z = The current user's time format preference.
=back
=cut =cut
sub epochToHuman { sub epochToHuman {
@ -253,13 +267,16 @@ sub epochToHuman {
=head2 epochToSet ( epoch ) =head2 epochToSet ( epoch )
Returns a set date (used by WebGUI::HTMLForm->date) in the format Returns a set date (used by WebGUI::HTMLForm->date) in the format of MM/DD/YYYY.
of MM/DD/YYYY.
=over
=item epoch =item epoch
The number of seconds since January 1, 1970. The number of seconds since January 1, 1970.
=back
=cut =cut
sub epochToSet { sub epochToSet {
@ -270,13 +287,16 @@ sub epochToSet {
=head2 getMonthName ( month ) =head2 getMonthName ( month )
Returns a string containing the calendar month name in the language Returns a string containing the calendar month name in the language of the current user.
of the current user.
=over
=item month =item month
An integer ranging from 1-12 representing the month. An integer ranging from 1-12 representing the month.
=back
=cut =cut
sub getMonthName { sub getMonthName {
@ -311,13 +331,15 @@ sub getMonthName {
=head2 getDayName ( day ) =head2 getDayName ( day )
Returns a string containing the weekday name in the language of the Returns a string containing the weekday name in the language of the current user.
current user.
=over
=item day =item day
An integer ranging from 1-7 representing the day of the week (Sunday An integer ranging from 1-7 representing the day of the week (Sunday is 1 and Saturday is 7).
is 1 and Saturday is 7).
=back
=cut =cut
@ -346,10 +368,14 @@ sub getDayName {
Returns an epoch date derived from the human date. Returns an epoch date derived from the human date.
=over
=item date =item date
The human date string. YYYY-MM-DD HH:MM:SS The human date string. YYYY-MM-DD HH:MM:SS
=back
=cut =cut
sub humanToEpoch { sub humanToEpoch {
@ -373,14 +399,17 @@ sub humanToEpoch {
Returns the number of seconds derived from the interval. Returns the number of seconds derived from the interval.
=over
=item interval =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 =item units
A string which represents the units of the interval. The string A string which represents the units of the interval. The string must be 'years', 'months', 'days', 'hours', 'minutes', or 'seconds'.
must be 'years', 'months', 'days', 'hours', 'minutes', or 'seconds'.
=back
=cut =cut
@ -406,14 +435,16 @@ sub intervalToSeconds {
=head2 localtime ( epoch ) =head2 localtime ( epoch )
Returns an array of time elements. The elements are: years, months, Returns an array of time elements. The elements are: years, months, days, hours, minutes, seconds, day of year, day of week, daylight savings time.
days, hours, minutes, seconds, day of year, day of week, daylight
savings time. =over
=item epoch =item epoch
The number of seconds since January 1, 1970. The number of seconds since January 1, 1970.
=back
=cut =cut
sub localtime { sub localtime {
@ -423,8 +454,9 @@ sub localtime {
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head2 monthCount ( startEpoch, endEpoch ) =head2 monthCount ( startEpoch, endEpoch )
Returns the number of months between the start and end dates Returns the number of months between the start and end dates (inclusive).
(inclusive).
=over
=item startEpoch =item startEpoch
@ -434,6 +466,8 @@ sub localtime {
An epoch datestamp corresponding to the last month. An epoch datestamp corresponding to the last month.
=back
=cut =cut
sub monthCount { sub monthCount {
@ -450,10 +484,14 @@ sub monthCount {
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 =item epoch
The number of seconds since January 1, 1970. The number of seconds since January 1, 1970.
=back
=cut =cut
sub monthStartEnd { sub monthStartEnd {
@ -471,10 +509,13 @@ sub monthStartEnd {
Returns an interval and units derived the number of seconds. Returns an interval and units derived the number of seconds.
=over
=item seconds =item seconds
The number of seconds in the interval. The number of seconds in the interval.
=back
=cut =cut
@ -511,10 +552,14 @@ sub secondsToInterval {
Returns an epoch date. Returns an epoch date.
=over
=item set =item set
A string in the format of MM/DD/YYYY. A string in the format of MM/DD/YYYY.
=back
=cut =cut
sub setToEpoch { sub setToEpoch {
@ -542,7 +587,7 @@ sub setToEpoch {
=head2 time ( ) =head2 time ( )
Returns an epoch date. Returns an epoch date for now.
=cut =cut

View file

@ -28,10 +28,7 @@ use WebGUI::User;
=head1 WebGUI Discussions =head1 WebGUI Discussions
This package implements WebGUI's discussion system. However it is 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.
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 =cut

View file

@ -20,7 +20,7 @@ use WebGUI::Session;
=head1 NAME =head1 NAME
Package WebGUI::ErrorHandler WebGUI::ErrorHandler
=head1 SYNOPSIS =head1 SYNOPSIS
@ -48,10 +48,14 @@ use WebGUI::Session;
Inserts an AUDIT type message into the WebGUI log. Inserts an AUDIT type message into the WebGUI log.
=over
=item message =item message
Whatever message you wish to insert into the log. Whatever message you wish to insert into the log.
=back
=cut =cut
sub audit { sub audit {
@ -67,10 +71,7 @@ sub audit {
=head2 fatalError ( ) =head2 fatalError ( )
Outputs an error message to the user and logs an error. Should only 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).
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 =cut
@ -161,10 +162,14 @@ sub fatalError {
Adds a SECURITY type message to the log. Adds a SECURITY type message to the log.
=over
=item message =item message
The message you wish to add to the log. The message you wish to add to the log.
=back
=cut =cut
sub security { sub security {
@ -183,10 +188,14 @@ sub security {
Adds a WARNING type message to the log. Adds a WARNING type message to the log.
=over
=item message =item message
The message you wish to add to the log. The message you wish to add to the log.
=back
=cut =cut
sub warn { sub warn {

View file

@ -60,14 +60,11 @@ use WebGUI::URL;
=head1 DESCRIPTION =head1 DESCRIPTION
Base forms package. Eliminates some of the normal code work that goes Base forms package. Eliminates some of the normal code work that goes along with creating forms. Used by the HTMLForm package.
along with creating forms. Used by the HTMLForm package.
=head1 FUNCTIONS =head1 FUNCTIONS
All of the functions in this package accept the input of a hash All of the functions in this package accept the input of a hash reference containing the parameters to populate the form element. These functions are available from this package:
reference containing the parameters to populate the form element.
These functions are available from this package:
=cut =cut
@ -91,6 +88,8 @@ sub _fixSpecialCharacters {
Returns a checkbox form element. Returns a checkbox form element.
=over
=item name =item name
The name field for this form element. The name field for this form element.
@ -105,12 +104,12 @@ sub _fixSpecialCharacters {
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=back
=cut =cut
sub checkbox { sub checkbox {
@ -126,32 +125,32 @@ sub checkbox {
Returns checkbox list. Returns checkbox list.
=over
=item name =item name
The name field for this form element. The name field for this form element.
=item options =item options
The list of options for this list. Should be passed as a
hash reference. The list of options for this list. Should be passed as a hash reference.
=item value =item value
The default value(s) for this form element. This should be passed The default value(s) for this form element. This should be passed as an array reference.
as an array reference.
=item vertical =item vertical
If set to "1" the radio button elements will be laid out If set to "1" the radio button elements will be laid out horizontally. Defaults to "0".
horizontally. Defaults to "0".
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=back
=cut =cut
sub checkList { sub checkList {
@ -183,40 +182,38 @@ sub checkList {
=head2 combo ( hashRef ) =head2 combo ( hashRef )
Returns a select list and a text field. If the Returns a select list and a text field. If the text box is filled out it will have a value stored in "name"_new.
text box is filled out it will have a value stored in "name"_new.
=over
=item name =item name
The name field for this form element. The name field for this form element.
=item options =item options
The list of options for the select list. Should be passed as a
hash reference. The list of options for the select list. Should be passed as a hash reference.
=item value =item value
The default value(s) for this form element. This should be passed The default value(s) for this form element. This should be passed as an array reference.
as an array reference.
=item size =item size
The number of characters tall this form element should be. Defaults The number of characters tall this form element should be. Defaults to "1".
to "1".
=item multiple =item multiple
A boolean value for whether this select list should allow multiple A boolean value for whether this select list should allow multiple selections. Defaults to "0".
selections. Defaults to "0".
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=back
=cut =cut
sub combo { sub combo {
@ -241,6 +238,8 @@ sub combo {
Returns a date field. Returns a date field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
@ -251,21 +250,19 @@ sub combo {
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=item size =item size
The number of characters wide this form element should be. There The number of characters wide this form element should be. There should be no reason for anyone to specify this.
should be no reason for anyone to specify this.
=item noDate =item noDate
By default a date is placed in the "value" field. Set this to "1" By default a date is placed in the "value" field. Set this to "1" to turn off the default date.
to turn off the default date.
=back
=cut =cut
@ -296,6 +293,8 @@ sub date {
Returns an email address field. Returns an email address field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
@ -310,16 +309,15 @@ sub date {
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=item size =item size
The number of characters wide this form element should be. There The number of characters wide this form element should be. There should be no reason for anyone to specify this.
should be no reason for anyone to specify this.
=back
=cut =cut
@ -339,8 +337,9 @@ sub email {
=head2 fieldType ( hashRef ) =head2 fieldType ( hashRef )
Returns a field type select list field. This is primarily useful for Returns a field type select list field. This is primarily useful for building dynamic form builders.
building dynamic form builders.
=over
=item name =item name
@ -348,33 +347,28 @@ sub email {
=item types =item types
An array reference of field types to be displayed. The field names An array reference of field types to be displayed. The field names are the names of the methods from this forms package. Note that not all field types are supported.
are the names of the methods from this forms package. Note that not
all field types are supported.
=item value =item value
The default value(s) for this form element. This should be passed The default value(s) for this form element. This should be passed as an array reference.
as an array reference.
=item size =item size
The number of characters tall this form element should be. Defaults The number of characters tall this form element should be. Defaults to "1".
to "1".
=item multiple =item multiple
A boolean value for whether this select list should allow multiple A boolean value for whether this select list should allow multiple selections. Defaults to "0".
selections. Defaults to "0".
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=back
=cut =cut
sub fieldType { sub fieldType {
@ -423,22 +417,23 @@ sub fieldType {
Returns a file upload field. Returns a file upload field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=item size =item size
The number of characters wide this form element should be. There The number of characters wide this form element should be. There should be no reason for anyone to specify this.
should be no reason for anyone to specify this.
=back
=cut =cut
@ -454,6 +449,8 @@ sub file {
Returns a form header. Returns a form header.
=over
=item action =item action
The form action. Defaults to the current page. The form action. Defaults to the current page.
@ -468,8 +465,9 @@ sub file {
=item extras =item extras
If you want to add anything special to the form header like If you want to add anything special to the form header like javascript actions or stylesheet info, then use this.
javascript actions or stylesheet info, then use this.
=back
=cut =cut
@ -486,9 +484,9 @@ sub formHeader {
=head2 group ( hashRef ] ) =head2 group ( hashRef ] )
Returns a group pull-down field. A group pull down Returns a group pull-down field. A group pull down provides a select list that provides name value pairs for all the groups in the WebGUI system.
provides a select list that provides name value pairs for all the
groups in the WebGUI system. =over
=item name =item name
@ -496,8 +494,7 @@ sub formHeader {
=item value =item value
The selected group id(s) for this form element. This should be passed The selected group id(s) for this form element. This should be passed as an array reference. Defaults to "7" (Everyone).
as an array reference. Defaults to "7" (Everyone).
=item size =item size
@ -509,12 +506,12 @@ sub formHeader {
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=back
=cut =cut
sub group { sub group {
@ -542,6 +539,8 @@ sub group {
Returns a hidden field. Returns a hidden field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
@ -550,6 +549,8 @@ sub group {
The default value for this form element. The default value for this form element.
=back
=cut =cut
sub hidden { sub hidden {
@ -561,9 +562,9 @@ sub hidden {
=head2 hiddenList ( hashRef ) =head2 hiddenList ( hashRef )
Returns a list of hidden fields. This is primarily to be used by Returns a list of hidden fields. This is primarily to be used by the HTMLForm package, but we decided to make it a public method in case anybody else had a use for it.
the HTMLForm package, but we decided to make it a public method
in case anybody else had a use for it. =over
=item name =item name
@ -575,8 +576,9 @@ sub hidden {
=item value =item value
An array reference where each value in the array should be a name An array reference where each value in the array should be a name from the hash (if you want it to show up in the hidden list).
from the hash (if you want it to show up in the hidden list).
=back
=cut =cut
@ -601,10 +603,9 @@ sub hiddenList {
=head2 HTMLArea ( hashRef ) =head2 HTMLArea ( hashRef )
Returns an HTML area. An HTML area is different than Returns an HTML area. An HTML area is different than a standard text area in that it provides rich edit functionality and some special error trapping for HTML and other special characters.
a standard text area in that it provides rich edit functionality
and some special error trapping for HTML and other special =over
characters.
=item name =item name
@ -616,26 +617,23 @@ sub hiddenList {
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=item wrap =item wrap
The method for wrapping text in the text area. Defaults to The method for wrapping text in the text area. Defaults to "virtual". There should be almost no reason to specify this.
"virtual". There should be almost no reason to specify this.
=item rows =item rows
The number of characters tall this form element should be. There The number of characters tall this form element should be. There should be no reason for anyone to specify this.
should be no reason for anyone to specify this.
=item columns =item columns
The number of characters wide this form element should be. There The number of characters wide this form element should be. There should be no reason for anyone to specify this.
should be no reason for anyone to specify this.
=back
=cut =cut
@ -722,6 +720,8 @@ sub HTMLArea {
Returns an integer field. Returns an integer field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
@ -732,21 +732,19 @@ sub HTMLArea {
=item maxlength =item maxlength
The maximum number of characters to allow in this form element. The maximum number of characters to allow in this form element. Defaults to 11.
Defaults to 11.
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=item size =item size
The number of characters wide this form element should be. There The number of characters wide this form element should be. There should be no reason for anyone to specify this.
should be no reason for anyone to specify this.
=back
=cut =cut
@ -782,31 +780,28 @@ sub integer {
Returns a time interval field. Returns a time interval field.
=over
=item name =item name
The the base name for this form element. This form element actually The the base name for this form element. This form element actually returns two values under different names. They are name_interval and name_units.
returns two values under different names. They are name_interval and
name_units.
=item intervalValue =item intervalValue
The default value for interval portion of this form element. Defaults The default value for interval portion of this form element. Defaults to '1'.
to '1'.
=item unitsValue =item unitsValue
The default value for units portion of this form element. Defaults The default value for units portion of this form element. Defaults to 'seconds'. Possible values are 'seconds', 'minutes', 'hours', 'days', 'weeks', 'months', and 'years'.
to 'seconds'. Possible values are 'seconds', 'minutes', 'hours',
'days', 'weeks', 'months', and 'years'.
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=back
=cut =cut
sub interval { sub interval {
@ -841,6 +836,8 @@ sub interval {
Returns a password field. Returns a password field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
@ -851,22 +848,19 @@ sub interval {
=item maxlength =item maxlength
The maximum number of characters to allow in this form element. The maximum number of characters to allow in this form element. Defaults to "35".
Defaults to "35".
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=item size =item size
The number of characters wide this form element should be. There The number of characters wide this form element should be. There should be no reason for anyone to specify this. Defaults to "30" unless overridden in the settings.
should be no reason for anyone to specify this. Defaults to "30"
unless overridden in the settings. =back
=cut =cut
@ -883,7 +877,9 @@ sub password {
=head2 phone ( hashRef ) =head2 phone ( hashRef )
Returns a phone field. Returns a telephone number field.
=over
=item name =item name
@ -899,16 +895,15 @@ sub password {
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=item size =item size
The number of characters wide this form element should be. There The number of characters wide this form element should be. There should be no reason for anyone to specify this.
should be no reason for anyone to specify this.
=back
=cut =cut
@ -930,6 +925,8 @@ sub phone {
Returns a radio button. Returns a radio button.
=over
=item name =item name
The name field for this form element. The name field for this form element.
@ -944,12 +941,13 @@ sub phone {
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=back
=cut =cut
sub radio { sub radio {
@ -964,14 +962,15 @@ sub radio {
Returns a radio button list field. Returns a radio button list field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
=item options =item options
The list of options for this list. Should be passed as a The list of options for this list. Should be passed as a hash reference.
hash reference.
=item value =item value
@ -979,17 +978,16 @@ sub radio {
=item vertical =item vertical
If set to "1" the radio button elements will be laid out If set to "1" the radio button elements will be laid out horizontally. Defaults to "0".
horizontally. Defaults to "0".
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=back
=cut =cut
sub radioList { sub radioList {
@ -1017,38 +1015,36 @@ sub radioList {
Returns a select list field. Returns a select list field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
=item options =item options
The list of options for this select list. Should be passed as a The list of options for this select list. Should be passed as a hash reference.
hash reference.
=item value =item value
The default value(s) for this form element. This should be passed The default value(s) for this form element. This should be passed as an array reference.
as an array reference.
=item size =item size
The number of characters tall this form element should be. Defaults The number of characters tall this form element should be. Defaults to "1".
to "1".
=item multiple =item multiple
A boolean value for whether this select list should allow multiple A boolean value for whether this select list should allow multiple selections. Defaults to "0".
selections. Defaults to "0".
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=back
=cut =cut
sub selectList { sub selectList {
@ -1075,18 +1071,20 @@ sub selectList {
Returns a submit button. Returns a submit button.
=over
=item value =item value
The button text for this submit button. Defaults to "save". The button text for this submit button. Defaults to "save".
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=back
=cut =cut
sub submit { sub submit {
@ -1103,6 +1101,8 @@ sub submit {
Returns a select list of templates. Returns a select list of templates.
=over
=item name =item name
The name field for this form element. The name field for this form element.
@ -1113,8 +1113,9 @@ sub submit {
=item namespace =item namespace
The namespace for the list of templates to return. If this is The namespace for the list of templates to return. If this is omitted, all templates will be displayed.
omitted, all templates will be displayed.
=back
=cut =cut
@ -1134,6 +1135,8 @@ sub template {
Returns a text input field. Returns a text input field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
@ -1148,16 +1151,15 @@ sub template {
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=item size =item size
The number of characters wide this form element should be. There The number of characters wide this form element should be. There should be no reason for anyone to specify this.
should be no reason for anyone to specify this.
=back
=cut =cut
@ -1177,6 +1179,8 @@ sub text {
Returns a text area field. Returns a text area field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
@ -1187,26 +1191,23 @@ sub text {
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=item wrap =item wrap
The method for wrapping text in the text area. Defaults to The method for wrapping text in the text area. Defaults to "virtual". There should be almost no reason to specify this.
"virtual". There should be almost no reason to specify this.
=item rows =item rows
The number of characters tall this form element should be. There The number of characters tall this form element should be. There should be no reason for anyone to specify this.
should be no reason for anyone to specify this.
=item columns =item columns
The number of characters wide this form element should be. There The number of characters wide this form element should be. There should be no reason for anyone to specify this.
should be no reason for anyone to specify this.
=back
=cut =cut
@ -1228,6 +1229,8 @@ sub textarea {
Returns a URL field. Returns a URL field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
@ -1238,21 +1241,19 @@ sub textarea {
=item maxlength =item maxlength
The maximum number of characters to allow in this form element. The maximum number of characters to allow in this form element. Defaults to 2048.
Defaults to 2048.
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=item size =item size
The number of characters wide this form element should be. There The number of characters wide this form element should be. There should be no reason for anyone to specify this.
should be no reason for anyone to specify this.
=back
=cut =cut
@ -1276,8 +1277,9 @@ sub url {
=head2 whatNext ( hashRef ] ) =head2 whatNext ( hashRef ] )
Returns a "What next?" select list for use with chained action forms Returns a "What next?" select list for use with chained action forms in WebGUI.
in WebGUI.
=over
=item options =item options
@ -1293,12 +1295,12 @@ sub url {
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=back
=cut =cut
sub whatNext { sub whatNext {
@ -1319,23 +1321,24 @@ sub whatNext {
Returns a yes/no radio field. Returns a yes/no radio field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
=item value =item value
The default value(s) for this form element. Valid values are "1" The default value(s) for this form element. Valid values are "1" and "0". Defaults to "1".
and "0". Defaults to "1".
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=back
=cut =cut
sub yesNo { sub yesNo {
@ -1369,6 +1372,8 @@ sub yesNo {
Returns a zip code field. Returns a zip code field.
=over
=item name =item name
The name field for this form element. The name field for this form element.
@ -1383,16 +1388,15 @@ sub yesNo {
=item extras =item extras
If you want to add anything special to this form element like If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
javascript actions, or stylesheet information, you'd add it in
here as follows:
'onChange="this.form.submit()"' 'onChange="this.form.submit()"'
=item size =item size
The number of characters wide this form element should be. There The number of characters wide this form element should be. There should be no reason for anyone to specify this.
should be no reason for anyone to specify this.
=back
=cut =cut

View file

@ -43,17 +43,18 @@ use WebGUI::Session;
=head2 cleanSegment ( html ) =head2 cleanSegment ( html )
Returns an HTML segment that has been stripped of the <BODY> tag 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.
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 NOTE: This filter does have one exception, it leaves anything before the <BODY> tag that is enclosed in <STYLE></STYLE> tags.
the <BODY> tag that is enclosed in <STYLE></STYLE> tags.
=over
=item html =item html
The HTML segment you want cleaned. The HTML segment you want cleaned.
=back
=cut =cut
sub cleanSegment { sub cleanSegment {
@ -75,16 +76,17 @@ sub cleanSegment {
Returns HTML with unwanted tags filtered out. Returns HTML with unwanted tags filtered out.
=over
=item html =item html
The HTML content you want filtered. The HTML content you want filtered.
=item filter =item filter
Choose from all, none, javascript, or most. Defaults to most. 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.
All removes all HTML tags; none removes no HTML tags; javascript
removes all references to javacript; and most removes all but =back
simple formatting tags like bold and italics.
=cut =cut

File diff suppressed because it is too large Load diff

View file

@ -46,10 +46,7 @@ our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon &copyIcon &deleteIcon &editIcon
=head1 DESCRIPTION =head1 DESCRIPTION
A package for generating user interface buttons. The subroutines 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.
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 =head1 METHODS
@ -63,15 +60,18 @@ our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon &copyIcon &deleteIcon &editIcon
Generates a button with the word "Become" printed on it. Generates a button with the word "Become" printed on it.
=over
=item urlParameters =item urlParameters
Any URL parameters that need to be tacked on to the current URL Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
to accomplish whatever function this button represents.
=item pageURL =item pageURL
The URL to any page. Defaults to the current page. The URL to any page. Defaults to the current page.
=back
=cut =cut
sub becomeIcon { sub becomeIcon {
@ -88,15 +88,18 @@ sub becomeIcon {
Generates a button with the word "Copy" printed on it. Generates a button with the word "Copy" printed on it.
=over
=item urlParameters =item urlParameters
Any URL parameters that need to be tacked on to the current URL Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
to accomplish whatever function this button represents.
=item pageURL =item pageURL
The URL to any page. Defaults to the current page. The URL to any page. Defaults to the current page.
=back
=cut =cut
sub copyIcon { sub copyIcon {
@ -113,15 +116,18 @@ sub copyIcon {
Generates a button with the word "Cut" printed on it. Generates a button with the word "Cut" printed on it.
=over
=item urlParameters =item urlParameters
Any URL parameters that need to be tacked on to the current URL Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
to accomplish whatever function this button represents.
=item pageURL =item pageURL
The URL to any page. Defaults to the current page. The URL to any page. Defaults to the current page.
=back
=cut =cut
sub cutIcon { sub cutIcon {
@ -138,15 +144,18 @@ sub cutIcon {
Generates a button with an "X" printed on it. Generates a button with an "X" printed on it.
=over
=item urlParameters =item urlParameters
Any URL parameters that need to be tacked on to the current URL Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
to accomplish whatever function this button represents.
=item pageURL =item pageURL
The URL to any page. Defaults to the current page. The URL to any page. Defaults to the current page.
=back
=cut =cut
sub deleteIcon { sub deleteIcon {
@ -163,15 +172,18 @@ sub deleteIcon {
Generates a button with the word "Edit" printed on it. Generates a button with the word "Edit" printed on it.
=over
=item urlParameters =item urlParameters
Any URL parameters that need to be tacked on to the current URL Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
to accomplish whatever function this button represents.
=item pageURL =item pageURL
The URL to any page. Defaults to the current page. The URL to any page. Defaults to the current page.
=back
=cut =cut
sub editIcon { sub editIcon {
@ -188,15 +200,17 @@ sub editIcon {
Generates a button with the word "Help" printed on it. Generates a button with the word "Help" printed on it.
=over
=item helpId =item helpId
The id in the help table that relates to the help documentation The id in the help table that relates to the help documentation for your function.
for your function.
=item namespace =item namespace
If your help documentation is not in the WebGUI namespace, then If your help documentation is not in the WebGUI namespace, then you must specify the namespace for this help.
you must specify the namespace for this help.
=back
=cut =cut
@ -214,15 +228,18 @@ sub helpIcon {
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 =item urlParameters
Any URL parameters that need to be tacked on to the current URL Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
to accomplish whatever function this button represents.
=item pageURL =item pageURL
The URL to any page. Defaults to the current page. The URL to any page. Defaults to the current page.
=back
=cut =cut
sub moveBottomIcon { sub moveBottomIcon {
@ -239,15 +256,18 @@ sub moveBottomIcon {
Generates a button with a down arrow printed on it. Generates a button with a down arrow printed on it.
=over
=item urlParameters =item urlParameters
Any URL parameters that need to be tacked on to the current URL Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
to accomplish whatever function this button represents.
=item pageURL =item pageURL
The URL to any page. Defaults to the current page. The URL to any page. Defaults to the current page.
=back
=cut =cut
sub moveDownIcon { sub moveDownIcon {
@ -264,15 +284,18 @@ sub moveDownIcon {
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 =item urlParameters
Any URL parameters that need to be tacked on to the current URL Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
to accomplish whatever function this button represents.
=item pageURL =item pageURL
The URL to any page. Defaults to the current page. The URL to any page. Defaults to the current page.
=back
=cut =cut
sub moveTopIcon { sub moveTopIcon {
@ -289,15 +312,18 @@ sub moveTopIcon {
Generates a button with an up arrow printed on it. Generates a button with an up arrow printed on it.
=over
=item urlParameters =item urlParameters
Any URL parameters that need to be tacked on to the current URL Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
to accomplish whatever function this button represents.
=item pageURL =item pageURL
The URL to any page. Defaults to the current page. The URL to any page. Defaults to the current page.
=back
=cut =cut
sub moveUpIcon { sub moveUpIcon {
@ -312,9 +338,7 @@ sub moveUpIcon {
=head2 pageIcon ( ) =head2 pageIcon ( )
Generates an icon that looks like a page. It's purpose is to Generates an icon that looks like a page. It's purpose is to represent whether you're looking at page properties or Wobject properties.
represent whether you're looking at page properties or Wobject
properties.
=cut =cut
@ -328,15 +352,18 @@ sub pageIcon {
Generates a button with the word "View" printed on it. Generates a button with the word "View" printed on it.
=over
=item urlParameters =item urlParameters
Any URL parameters that need to be tacked on to the current URL Any URL parameters that need to be tacked on to the current URL to accomplish whatever function this button represents.
to accomplish whatever function this button represents.
=item pageURL =item pageURL
The URL to any page. Defaults to the current page. The URL to any page. Defaults to the current page.
=back
=cut =cut
sub viewIcon { sub viewIcon {
@ -351,9 +378,7 @@ sub viewIcon {
=head2 wobjectIcon ( ) =head2 wobjectIcon ( )
Generates an icon that looks like a wobject. It's purpose is to Generates an icon that looks like a wobject. It's purpose is to represent whether you're looking at page properties or Wobject properties.
represent whether you're looking at page properties or Wobject
properties.
=cut =cut

View file

@ -45,25 +45,23 @@ my %international;
=head2 get ( internationalId [ , namespace, languageId ] ) =head2 get ( internationalId [ , namespace, languageId ] )
Returns the internationalized message string for the user's language. Returns the internationalized message string for the user's language. If there is no internationalized message, this method will return the English string.
If there is no internationalized message, this method will
return the English string. =over
=item internationalId =item internationalId
An integer that relates to a message in the international table An integer that relates to a message in the international table in the WebGUI database.
in the WebGUI database.
=item namespace =item namespace
A string that relates to the namespace field in the international A string that relates to the namespace field in the international table in the WebGUI database. Defaults to 'WebGUI'.
table in the WebGUI database. Defaults to 'WebGUI'.
=item languageId =item languageId
An integer that specifies the language that the user should see. 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).
Defaults to the user's defined language. If the user hasn't specified
a default language it defaults to '1' (English). =back
=cut =cut
@ -97,8 +95,7 @@ sub get {
=head2 getLanguages ( ) =head2 getLanguages ( )
Returns a hash reference to the languages (languageId/lanugage) Returns a hash reference to the languages (languageId/lanugage) installed on this WebGUI system.
installed on this WebGUI system.
=cut =cut

View file

@ -34,9 +34,7 @@ use WebGUI::Session;
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. 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.
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 =head1 METHODS
@ -52,10 +50,14 @@ use WebGUI::Session;
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 =item parameterString
A string containing a comma separated list of paramenters. A string containing a comma separated list of paramenters.
=back
=cut =cut
sub getParams { sub getParams {
@ -76,10 +78,14 @@ sub getParams {
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 =item html
A string of HTML to be processed. A string of HTML to be processed.
=back
=cut =cut
sub process { sub process {

View file

@ -47,6 +47,8 @@ use WebGUI::Session;
Sends an SMTP email message to the specified user. Sends an SMTP email message to the specified user.
=over
=item to =item to
An email address for the TO line. An email address for the TO line.
@ -65,13 +67,14 @@ use WebGUI::Session;
=item from =item from
The email address for the FROM line. Defaults to the email address The email address for the FROM line. Defaults to the email address specified in the Company Settings.
specified in the Company Settings.
=item bcc =item bcc
The email address for the BCC line. The email address for the BCC line.
=back
=cut =cut
sub send { sub send {

View file

@ -76,6 +76,8 @@ sub _notify {
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 =item userId
The id of the user that should receive this notification. The id of the user that should receive this notification.
@ -98,13 +100,14 @@ sub _notify {
=item url =item url
The URL of any action that should be taken based upon this The URL of any action that should be taken based upon this notification (if any).
notification (if any).
=item status =item status
Defaults to 'notice'. Can be 'pending', 'notice', or 'completed'. Defaults to 'notice'. Can be 'pending', 'notice', or 'completed'.
=back
=cut =cut
sub addEntry { sub addEntry {
@ -137,8 +140,9 @@ sub addEntry {
=head2 addInternationalizedEntry ( userId, groupId, url, internationalId [ , namespace, status ] ) =head2 addInternationalizedEntry ( userId, groupId, url, internationalId [ , namespace, status ] )
Adds an entry to the message log using a translated message from Adds an entry to the message log using a translated message from the internationalization system and sends out notifications to users.
the internationalization system and sends out notifications to users.
=over
=item userId =item userId
@ -154,8 +158,7 @@ sub addEntry {
=item url =item url
The URL of any action that should be taken based upon this The URL of any action that should be taken based upon this notification (if any).
notification (if any).
=item internationalId =item internationalId
@ -169,6 +172,8 @@ sub addEntry {
Defaults to 'notice'. Can be 'pending', 'notice', or 'completed'. Defaults to 'notice'. Can be 'pending', 'notice', or 'completed'.
=back
=cut =cut
sub addInternationalizedEntry { sub addInternationalizedEntry {
@ -209,10 +214,14 @@ sub addInternationalizedEntry {
Set a message log entry to complete. Set a message log entry to complete.
=over
=item messageLogId =item messageLogId
The id of the message to complete. The id of the message to complete.
=back
=cut =cut
sub completeEntry { sub completeEntry {

View file

@ -51,19 +51,21 @@ use WebGUI::URL;
Draws a vertical navigation system. Returns HTML. Draws a vertical navigation system. Returns HTML.
=over
=item tree =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 =item seperator
A string containing HTML to seperate each navigation item. Defaults A string containing HTML to seperate each navigation item. Defaults to "&middot;".
to "&middot;".
=item class =item class
A stylesheet class for each link in the navigation. Defaults to A stylesheet class for each link in the navigation. Defaults to "horizontalMenu".
"horizontalMenu".
=back
=cut =cut
@ -96,19 +98,19 @@ sub drawHorizontal {
Draws a vertical navigation system. Returns HTML. Draws a vertical navigation system. Returns HTML.
=over
=item tree =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 =item bullet
A string containing HTML to generate a bullet that will be placed A string containing HTML to generate a bullet that will be placed in front of each tree item. Defaults to none.
in front of each tree item. Defaults to none.
=item class =item class
A stylesheet class for each link in the navigation. Defaults to A stylesheet class for each link in the navigation. Defaults to "verticalMenu".
"verticalMenu".
=item spacing =item spacing
@ -118,6 +120,8 @@ sub drawHorizontal {
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 =cut
sub drawVertical { sub drawVertical {
@ -148,9 +152,7 @@ sub drawVertical {
=head2 tree ( parentId [, toLevel ] ) =head2 tree ( parentId [, toLevel ] )
Generates and returns a hash reference containing a page tree with 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:
keys of "url", "title", and "sub" with orignating keys of page ids.
The tree looks like this:
root root
|-pageId |-pageId
@ -166,14 +168,17 @@ sub drawVertical {
`-pageId `-pageId
`-etc `-etc
=over
=item parentId =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 =item toLevel
The depth the tree should be traversed. Defaults to "0". If set to The depth the tree should be traversed. Defaults to "0". If set to "0" the entire tree will be traversed.
"0" the entire tree will be traversed.
=back
=cut =cut

View file

@ -36,10 +36,7 @@ use WebGUI::Session;
=head1 DESCRIPTION =head1 DESCRIPTION
Package to manipulate WebGUI storage nodes. The nodes system is a 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.
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 =head1 METHODS
@ -127,6 +124,18 @@ sub getURL {
Constructor. Constructor.
=over
=item node1
The first level of the hash heirarchy.
=item node2
The second level of the hash heirarchy.
=back
=cut =cut
sub new { sub new {

View file

@ -62,10 +62,14 @@ sub _newPositionFormat {
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 =item templateId
The id of the page template you wish to count. The id of the page template you wish to count.
=back
=cut =cut
sub countTemplatePositions { sub countTemplatePositions {
@ -84,10 +88,14 @@ sub countTemplatePositions {
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 =item templateId
The id of the page template you wish to draw. The id of the page template you wish to draw.
=back
=cut =cut
sub drawTemplate { sub drawTemplate {
@ -104,8 +112,7 @@ sub drawTemplate {
=head2 getTemplateList =head2 getTemplateList
Returns a hash reference containing template ids and template titles Returns a hash reference containing template ids and template titles for all the page templates available in the system.
for all the page templates available in the system.
=cut =cut
@ -119,10 +126,14 @@ sub getTemplateList {
Returns an HTML template. Returns an HTML template.
=over
=item templateId =item templateId
The id of the page template you wish to retrieve. The id of the page template you wish to retrieve.
=back
=cut =cut
sub getTemplate { sub getTemplate {
@ -135,13 +146,16 @@ sub getTemplate {
=head2 getTemplatePositions ( templateId ) =head2 getTemplatePositions ( templateId )
Returns a hash reference containing the positions available in Returns a hash reference containing the positions available in the specified page template.
the specified page template.
=over
=item templateId =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 =cut
sub getTemplatePositions { sub getTemplatePositions {
@ -159,6 +173,8 @@ sub getTemplatePositions {
Returns a unique page URL. Returns a unique page URL.
=over
=item url =item url
The URL you're hoping for. The URL you're hoping for.
@ -167,6 +183,8 @@ sub getTemplatePositions {
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 =cut
sub makeUnique { sub makeUnique {

View file

@ -58,13 +58,15 @@ use WebGUI::URL;
=head2 getBar ( [ pageNumber ] ) =head2 getBar ( [ pageNumber ] )
Returns the pagination bar including First, Previous, Next, and Returns the pagination bar including First, Previous, Next, and last links. If there's only one page, nothing is returned.
last links. If there's only one page, nothing is returned.
=over
=item pageNumber =item pageNumber
Defaults to the page you're currently viewing. This is mostly here Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
as an override and probably has no real use.
=back
=cut =cut
@ -91,14 +93,15 @@ sub getBar {
=head2 getBarAdvanced ( [ pageNumber ] ) =head2 getBarAdvanced ( [ pageNumber ] )
Returns the pagination bar including First, Previous, Page Numbers, Returns the pagination bar including First, Previous, Page Numbers, Next, and Last links. If there's only one page, nothing is returned.
Next, and Last links. If there's only one page, nothing is
returned. =over
=item pageNumber =item pageNumber
Defaults to the page you're currently viewing. This is mostly here Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
as an override and probably has no real use.
=back
=cut =cut
@ -127,13 +130,15 @@ sub getBarAdvanced {
=head2 getBarSimple ( [ pageNumber ] ) =head2 getBarSimple ( [ pageNumber ] )
Returns the pagination bar including only Previous and Next links. Returns the pagination bar including only Previous and Next links. If there's only one page, nothing is returned.
If there's only one page, nothing is returned.
=over
=item pageNumber =item pageNumber
Defaults to the page you're currently viewing. This is mostly here Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
as an override and probably has no real use.
=back
=cut =cut
@ -156,14 +161,15 @@ sub getBarSimple {
=head2 getBarTraditional ( [ pageNumber ] ) =head2 getBarTraditional ( [ pageNumber ] )
Returns the pagination bar including Previous, Page Numbers, Returns the pagination bar including Previous, Page Numbers, and Next links. If there's only one page, nothing is returned.
and Next links. If there's only one page, nothing is
returned. =over
=item pageNumber =item pageNumber
Defaults to the page you're currently viewing. This is mostly here Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
as an override and probably has no real use.
=back
=cut =cut
@ -190,10 +196,13 @@ sub getBarTraditional {
Returns a link to the first page's data. Returns a link to the first page's data.
=over
=item pageNumber =item pageNumber
Defaults to the page you're currently viewing. This is mostly here Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
as an override and probably has no real use.
=back
=cut =cut
@ -217,10 +226,13 @@ sub getFirstPageLink {
Returns a link to the last page's data. Returns a link to the last page's data.
=over
=item pageNumber =item pageNumber
Defaults to the page you're currently viewing. This is mostly here Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
as an override and probably has no real use.
=back
=cut =cut
@ -244,10 +256,13 @@ sub getLastPageLink {
Returns a link to the next page's data. Returns a link to the next page's data.
=over
=item pageNumber =item pageNumber
Defaults to the page you're currently viewing. This is mostly here Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
as an override and probably has no real use.
=back
=cut =cut
@ -284,13 +299,15 @@ sub getNumberOfPages {
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 NOTE: This is really only useful if you passed in an array reference of strings when you created this object.
of strings when you created this object.
=over
=item pageNumber =item pageNumber
Defaults to the page you're currently viewing. This is mostly here Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
as an override and probably has no real use.
=back
=cut =cut
@ -305,10 +322,13 @@ sub getPage {
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 =item pageNumber
Defaults to the page you're currently viewing. This is mostly here Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
as an override and probably has no real use.
=back
=cut =cut
@ -331,8 +351,7 @@ sub getPageData {
=head2 getPageNumber ( ) =head2 getPageNumber ( )
Returns the current page number. If no page number can be found Returns the current page number. If no page number can be found then it returns 1.
then it returns 1.
=cut =cut
@ -346,10 +365,13 @@ sub getPageNumber {
Returns links to all pages in this paginator. Returns links to all pages in this paginator.
=over
=item pageNumber =item pageNumber
Defaults to the page you're currently viewing. This is mostly here Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
as an override and probably has no real use.
=back
=cut =cut
@ -375,10 +397,13 @@ sub getPageLinks {
Returns a link to the previous page's data. Returns a link to the previous page's data.
=over
=item pageNumber =item pageNumber
Defaults to the page you're currently viewing. This is mostly here Defaults to the page you're currently viewing. This is mostly here as an override and probably has no real use.
as an override and probably has no real use.
=back
=cut =cut
@ -400,10 +425,11 @@ sub getPreviousPageLink {
Constructor. Constructor.
=over
=item currentURL =item currentURL
The URL of the current page including attributes. The page number The URL of the current page including attributes. The page number will be appended to this in all links generated by the paginator.
will be appended to this in all links generated by the paginator.
=item rowArrayRef =item rowArrayRef
@ -411,19 +437,17 @@ sub getPreviousPageLink {
=item paginateAfter =item paginateAfter
The number of rows to display per page. If left blank it defaults The number of rows to display per page. If left blank it defaults to 50.
to 50.
=item pageNumber =item pageNumber
By default the paginator uses a form variable of "pn" to determine the 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.
page number. If you wish it to use some other variable, then specify
the page number here.
=item formVar =item formVar
Specify the form variable the paginator should use in it's links. Specify the form variable the paginator should use in it's links. Defaults to "pn".
Defaults to "pn".
=back
=cut =cut
@ -442,11 +466,12 @@ sub new {
=head2 setDataByQuery ( query [, dbh ] ) =head2 setDataByQuery ( query [, dbh ] )
Retrieves a data set from a database and replaces whatever data Retrieves a data set from a database and replaces whatever data set was passed in through the constructor.
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 =item query
An SQL query that will retrieve a data set. An SQL query that will retrieve a data set.
@ -455,6 +480,8 @@ sub new {
A DBI-style database handler. Defaults to the WebGUI site handler. A DBI-style database handler. Defaults to the WebGUI site handler.
=back
=cut =cut
sub setDataByQuery { sub setDataByQuery {

View file

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

View file

@ -60,10 +60,14 @@ sub get {
Constructor. Constructor.
=over
=item userId =item userId
The userId for the profile you wish to manipulate. The userId for the profile you wish to manipulate.
=back
=cut =cut
sub new { sub new {
@ -75,10 +79,12 @@ 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 =item attributeName
An attribute of the user profile. An attribute of the user profile.
@ -87,6 +93,8 @@ sub new {
The value to set the above named attribute to. The value to set the above named attribute to.
=back
=cut =cut
sub setAttribute { sub setAttribute {

View file

@ -58,9 +58,7 @@ our @EXPORT = qw(&quote &getNextId);
=head1 DESCRIPTION =head1 DESCRIPTION
Package for interfacing with SQL databases. This package Package for interfacing with SQL databases. This package implements Perl DBI functionality in a less code-intensive manner and adds some extra functionality.
implements Perl DBI functionality in a less code-intensive
manner and adds some extra functionality.
=head1 METHODS =head1 METHODS
@ -88,14 +86,17 @@ sub array {
Builds an array of data from a series of rows. Builds an array of data from a series of rows.
=over
=item sql =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 =item dbh
By default this method uses the WebGUI database handler. However, By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
you may choose to pass in your own if you wish.
=back
=cut =cut
@ -118,15 +119,17 @@ sub buildArray {
Builds a hash of data from a series of rows. Builds a hash of data from a series of rows.
=over
=item sql =item sql
An SQL query. The query must select only two columns of data, the 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.
first being the key for the hash, the second being the value.
=item dbh =item dbh
By default this method uses the WebGUI database handler. However, By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
you may choose to pass in your own if you wish.
=back
=cut =cut
@ -148,15 +151,17 @@ sub buildHash {
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 =item sql
An SQL query. The query must select only two columns of data, the 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.
first being the key for the hash, the second being the value.
=item dbh =item dbh
By default this method uses the WebGUI database handler. However, By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
you may choose to pass in your own if you wish.
=back
=cut =cut
@ -224,14 +229,17 @@ sub getColumnNames {
=head2 getNextId ( idName ) =head2 getNextId ( idName )
Increments an incrementer of the specified type and returns the Increments an incrementer of the specified type and returns the value.
value. NOTE: This is not a regular method, but is an exported
subroutine. NOTE: This is not a regular method, but is an exported subroutine.
=over
=item idName =item idName
Specify the name of one of the incrementers in the incrementer Specify the name of one of the incrementers in the incrementer table.
table.
=back
=cut =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 Returns the next row of data in the form of a hash. Must be executed on a statement handler returned by the "read" method.
executed on a statement handler returned by the "read" method.
=cut =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 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.
be executed on a statement handler returned by the "read" method.
=cut =cut
@ -291,14 +297,17 @@ sub hashRef {
Constructor. Returns a statement handler. Constructor. Returns a statement handler.
=over
=item sql =item sql
An SQL query. An SQL query.
=item dbh =item dbh
By default this method uses the WebGUI database handler. However, By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
you may choose to pass in your own if you wish.
=back
=cut =cut
@ -322,14 +331,17 @@ sub new {
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 =item sql
An SQL query. An SQL query.
=item dbh =item dbh
By default this method uses the WebGUI database handler. However, By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
you may choose to pass in your own if you wish.
=back
=cut =cut
@ -346,8 +358,9 @@ sub quickArray {
=head2 quickCSV ( sql [, dbh ] ) =head2 quickCSV ( sql [, dbh ] )
Executes a query and returns a comma delimited text blob with column Executes a query and returns a comma delimited text blob with column headers.
headers.
=over
=item sql =item sql
@ -355,8 +368,9 @@ sub quickArray {
=item dbh =item dbh
By default this method uses the WebGUI database handler. However, By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
you may choose to pass in your own if you wish.
=back
=cut =cut
@ -379,14 +393,17 @@ sub quickCSV {
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 =item sql
An SQL query. An SQL query.
=item dbh =item dbh
By default this method uses the WebGUI database handler. However, By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
you may choose to pass in your own if you wish.
=back
=cut =cut
@ -406,8 +423,9 @@ sub quickHash {
=head2 quickHashRef ( sql [, dbh ] ) =head2 quickHashRef ( 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 reference.
reference.
=over
=item sql =item sql
@ -415,8 +433,9 @@ sub quickHash {
=item dbh =item dbh
By default this method uses the WebGUI database handler. However, By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
you may choose to pass in your own if you wish.
=back
=cut =cut
@ -436,8 +455,9 @@ sub quickHashRef {
=head2 quickTab ( sql [, dbh ] ) =head2 quickTab ( sql [, dbh ] )
Executes a query and returns a tab delimited text blob with column Executes a query and returns a tab delimited text blob with column headers.
headers.
=over
=item sql =item sql
@ -445,8 +465,9 @@ sub quickHashRef {
=item dbh =item dbh
By default this method uses the WebGUI database handler. However, By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
you may choose to pass in your own if you wish.
=back
=cut =cut
@ -467,12 +488,16 @@ sub quickTab {
=head2 quote ( string ) =head2 quote ( string )
Returns a string quoted and ready for insert into the database. Returns a string quoted and ready for insert into the database.
NOTE: This is not a regular method, but is an exported subroutine. NOTE: This is not a regular method, but is an exported subroutine.
=over
=item string =item string
Any scalar variable that needs to be escaped to be inserted into Any scalar variable that needs to be escaped to be inserted into the database.
the database.
=back
=cut =cut
@ -488,14 +513,17 @@ sub quote {
An alias of the "new" method. Returns a statement handler. An alias of the "new" method. Returns a statement handler.
=over
=item sql =item sql
An SQL query. An SQL query.
=item dbh =item dbh
By default this method uses the WebGUI database handler. However, By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
you may choose to pass in your own if you wish.
=back
=cut =cut
@ -508,8 +536,7 @@ sub read {
=head2 rows ( ) =head2 rows ( )
Returns the number of rows in a statement handler created by the Returns the number of rows in a statement handler created by the "read" method.
"read" method.
=cut =cut
@ -522,10 +549,9 @@ sub rows {
=head2 unconditionalRead ( sql [, dbh ] ) =head2 unconditionalRead ( sql [, dbh ] )
An alias of the "read" method except that it will not cause a fatal 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.
error in WebGUI if the query is invalid. This is useful for user
generated queries such as those in the SQL Report. Returns a =over
statement handler.
=item sql =item sql
@ -533,8 +559,9 @@ sub rows {
=item dbh =item dbh
By default this method uses the WebGUI database handler. However, By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
you may choose to pass in your own if you wish.
=back
=cut =cut
@ -551,9 +578,9 @@ sub unconditionalRead {
=head2 write ( sql [, dbh ] ) =head2 write ( sql [, dbh ] )
A method specifically designed for writing to the database in an 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.
efficient manner. Writing can be accomplished using the "new"
method, but it is not as efficient. =over
=item sql =item sql
@ -561,8 +588,9 @@ sub unconditionalRead {
=item dbh =item dbh
By default this method uses the WebGUI database handler. However, By default this method uses the WebGUI database handler. However, you may choose to pass in your own if you wish.
you may choose to pass in your own if you wish.
=back
=cut =cut

View file

@ -35,8 +35,7 @@ use WebGUI::SQL;
=head1 DESCRIPTION =head1 DESCRIPTION
A package built to take the hassle out of creating advanced search A package built to take the hassle out of creating advanced search functionality in WebGUI applications.
functionality in WebGUI applications.
=head1 METHODS =head1 METHODS
@ -49,37 +48,31 @@ use WebGUI::SQL;
=head2 buildConstraints ( fieldList ) { [ all, atLeastOne, exactPhrase, without ] } =head2 buildConstraints ( fieldList ) { [ all, atLeastOne, exactPhrase, without ] }
Generates and returns the constraints to an SQL where clause based Generates and returns the constraints to an SQL where clause based upon input from the user.
upon input from the user.
=over
=item fieldList =item fieldList
An array reference that contains a list of the fields (table An array reference that contains a list of the fields (table columns) to be considered when searching.
columns) to be considered when searching.
=item all =item all
A form param with a comma or space separated list of key words to 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.
search for in the fields of the fieldList. All the words listed
here must be found to be true.
=item atLeastOne =item atLeastOne
A form param with a comma or space separated list of key words to 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.
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 =item exactPhrase
A form param with a phrase to search for in the fields of the 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.
fieldList. The exact phrase must be found in one of the fields
to be true.
=item without =item without
A form param with a comma or space separated list of key words to 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.
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 =cut
@ -145,15 +138,17 @@ sub buildConstraints {
Generates and returns the advanced search form. Generates and returns the advanced search form.
=over
=item hiddenFields =item hiddenFields
A hash reference that contains any name/value pairs that should be A hash reference that contains any name/value pairs that should be included as hidden fields in the search form.
included as hidden fields in the search form.
=item numResults =item numResults
A form param that can optionally specify the number of results to A form param that can optionally specify the number of results to display. Defaults to 25.
display. Defaults to 25.
=back
=cut =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 { sub toggleURL {
WebGUI::Session::setScratch("search",$session{form}{search}); WebGUI::Session::setScratch("search",$session{form}{search});
my $url; my $url;

View file

@ -53,19 +53,11 @@ tie %session, 'Tie::CPHash';
=head1 DESCRIPTION =head1 DESCRIPTION
This package is the heart and lifeblood of WebGUI. Without it WebGUI 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.
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 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.
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 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.
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 =head1 METHODS
@ -248,8 +240,7 @@ sub _loadWobjects {
=head2 close =head2 close
Cleans up a WebGUI session information from memory and disconnects from Cleans up a WebGUI session information from memory and disconnects from any resources opened by the session.
any resources opened by the session.
=cut =cut
@ -265,6 +256,8 @@ sub close {
Converts a visitor session to a user session. Converts a visitor session to a user session.
=over
=item sessionId =item sessionId
The session to convert. The session to convert.
@ -273,6 +266,8 @@ sub close {
The user for the session to become. The user for the session to become.
=back
=cut =cut
sub convertVisitorToUser { sub convertVisitorToUser {
@ -287,10 +282,14 @@ sub convertVisitorToUser {
Removes the specified user session from memory and database. Removes the specified user session from memory and database.
=over
=item sessionId =item sessionId
The session to end. The session to end.
=back
=cut =cut
sub end { sub end {
@ -330,10 +329,14 @@ sub httpHeader {
Generates an HTTP header for redirect. Generates an HTTP header for redirect.
=over
=item url =item url
The URL to redirect to. The URL to redirect to.
=back
=cut =cut
sub httpRedirect { sub httpRedirect {
@ -347,6 +350,8 @@ sub httpRedirect {
Opens a closed ( or new ) WebGUI session. Opens a closed ( or new ) WebGUI session.
=over
=item webguiRoot =item webguiRoot
The path to the WebGUI files. The path to the WebGUI files.
@ -355,6 +360,8 @@ sub httpRedirect {
The filename of the config file that WebGUI should operate from. The filename of the config file that WebGUI should operate from.
=back
=cut =cut
sub open { sub open {
@ -463,10 +470,13 @@ sub open {
Updates the WebGUI session to reflect new page information. Updates the WebGUI session to reflect new page information.
=over
=item pageId =item pageId
Defaults to page id "1". Specify the page id to change this WebGUI Defaults to page id "1". Specify the page id to change this WebGUI session to use.
session to use.
=back
=cut =cut
@ -488,10 +498,14 @@ sub refreshPageInfo {
NOTE: This also updates the user information. NOTE: This also updates the user information.
=over
=item sessionId =item sessionId
The session id to update. The session id to update.
=back
=cut =cut
sub refreshSessionVars { sub refreshSessionVars {
@ -503,13 +517,16 @@ sub refreshSessionVars {
=head2 refreshUserInfo ( userId ) =head2 refreshUserInfo ( userId )
Refreshes the user's information from the database into this user Refreshes the user's information from the database into this user session.
session.
=over
=item userId =item userId
The user id to refresh into this session. The user id to refresh into this session.
=back
=cut =cut
sub refreshUserInfo { sub refreshUserInfo {
@ -523,10 +540,11 @@ sub refreshUserInfo {
Sends a cookie to the browser. Sends a cookie to the browser.
=over
=item name =item name
The name of the cookie to set. Must be unique from all other cookies The name of the cookie to set. Must be unique from all other cookies from this domain or it will overwrite that cookie.
from this domain or it will overwrite that cookie.
=item value =item value
@ -534,8 +552,9 @@ sub refreshUserInfo {
=item timeToLive =item timeToLive
The time that the cookie should remain in the browser. Defaults to The time that the cookie should remain in the browser. Defaults to "+10y" (10 years from now).
"+10y" (10 years from now).
=back
=cut =cut
@ -556,9 +575,9 @@ sub setCookie {
=head2 setScratch ( name, value ) =head2 setScratch ( name, value )
Sets a scratch variable for this user session. Scratch variables are 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.
just arbitrary bits of data that a programmer may wish to store in
a user session from page to page. =over
=item name =item name
@ -566,9 +585,9 @@ sub setCookie {
=item value =item value
The value of the scratch variable. If the value is blank but defined 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.
or if it is set to "-delete-" then the scratch variable will be
removed from the user session. =back
=cut =cut
@ -595,14 +614,17 @@ sub setScratch {
Start a new user session. Start a new user session.
=over
=item userId =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 =item sessionId
Session id will be generated if not specified. In almost every case Session id will be generated if not specified. In almost every case you should let the system generate the session id.
you should let the system generate the session id.
=back
=cut =cut

View file

@ -49,10 +49,12 @@ use WebGUI::SQL;
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head get ( [ templateId, namespace ] ) =head2 get ( [ templateId, namespace ] )
Returns a template. Returns a template.
=over
=item templateId =item templateId
Defaults to "1". Specify the templateId of the template to retrieve. Defaults to "1". Specify the templateId of the template to retrieve.
@ -61,6 +63,8 @@ use WebGUI::SQL;
Defaults to "Page". Specify the namespace of the template to retrieve. Defaults to "Page". Specify the namespace of the template to retrieve.
=back
=cut =cut
sub get { sub get {
@ -76,13 +80,16 @@ sub get {
=head2 getList ( [ namespace ] ) =head2 getList ( [ namespace ] )
Returns a hash reference containing template ids and template names Returns a hash reference containing template ids and template names of all the templates in the specified namespace.
of all the templates in the specified namespace.
=over
=item namespace =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 =cut
sub getList { sub getList {
@ -97,14 +104,17 @@ sub getList {
Evaluate a template replacing template commands for HTML. Evaluate a template replacing template commands for HTML.
=over
=item template =item template
The template to process. The template to process.
=item vars =item vars
A hash reference containing template variables and loops. Automatically A hash reference containing template variables and loops. Automatically includes the entire WebGUI session.
includes the entire WebGUI session.
=back
=cut =cut

View file

@ -38,10 +38,7 @@ use WebGUI::Utility;
=head1 DESCRIPTION =head1 DESCRIPTION
This package provides URL writing functionality. It is important that 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.
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 =head1 METHODS
@ -57,6 +54,8 @@ use WebGUI::Utility;
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 =item url
The URL to append information to. The URL to append information to.
@ -67,6 +66,8 @@ use WebGUI::Utility;
name1=value1&name2=value2&name3=value3 name1=value1&name2=value2&name3=value3
=back
=cut =cut
sub append { sub append {
@ -88,10 +89,14 @@ sub append {
NOTE: See WebGUI::URL::unescape() NOTE: See WebGUI::URL::unescape()
=over
=item string =item string
The string to escape. The string to escape.
=back
=cut =cut
sub escape { sub escape {
@ -105,6 +110,8 @@ sub escape {
Generate a URL based on WebGUI's gateway script. Generate a URL based on WebGUI's gateway script.
=over
=item pageURL =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.
@ -115,6 +122,8 @@ sub escape {
name1=value1&name2=value2&name3=value3 name1=value1&name2=value2&name3=value3
=back
=cut =cut
sub gateway { sub gateway {
@ -135,10 +144,13 @@ sub gateway {
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 =item string
The string to make compliant. This is usually a page title or a The string to make compliant. This is usually a page title or a filename.
filename.
=back
=cut =cut
@ -160,12 +172,16 @@ sub makeCompliant {
Returns the URL of the current page. Returns the URL of the current page.
=over
=item pairs =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 name1=value1&name2=value2&name3=value3
=back
=cut =cut
sub page { sub page {
@ -188,10 +204,14 @@ sub page {
NOTE: See WebGUI::URL::escape() NOTE: See WebGUI::URL::escape()
=over
=item string =item string
The string to unescape. The string to unescape.
=back
=cut =cut
sub unescape { sub unescape {
@ -202,13 +222,16 @@ sub unescape {
=head2 urlize ( string ) =head2 urlize ( string )
Same as makeCompliant except that it also lower-cases the string. Same as makeCompliant except that it also lower-cases the string. This is mainly meant for WebGUI page URLs.
This is mainly meant for WebGUI page URLs.
=over
=item string =item string
The string to urlize. The string to urlize.
=back
=cut =cut
sub urlize { sub urlize {

View file

@ -45,8 +45,7 @@ use WebGUI::Authentication;
=head1 DESCRIPTION =head1 DESCRIPTION
This package provides an object-oriented way of managing WebGUI This package provides an object-oriented way of managing WebGUI users as well as getting/setting a users's profile data.
users as well as getting/setting a users's profile data.
=head1 METHODS =head1 METHODS
@ -68,10 +67,14 @@ sub _create {
Adds this user to the specified groups. Adds this user to the specified groups.
=over
=item groups =item groups
An array reference containing a list of groups. An array reference containing a list of groups.
=back
=cut =cut
sub addToGroups { sub addToGroups {
@ -91,11 +94,13 @@ sub addToGroups {
Returns the authentication method for this user. Returns the authentication method for this user.
=over
=item value =item value
If specified, the authMethod is set to this value. The only valid 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".
values are "WebGUI" and "LDAP". When a new account is created,
authMethod is defaulted to "WebGUI". =back
=cut =cut
@ -148,10 +153,14 @@ sub delete {
Deletes this user from the specified groups. Deletes this user from the specified groups.
=over
=item groups =item groups
An array reference containing a list of groups. An array reference containing a list of groups.
=back
=cut =cut
sub deleteFromGroups { sub deleteFromGroups {
@ -184,21 +193,21 @@ sub identifier {
Returns the current level of karma this user has earned. Returns the current level of karma this user has earned.
=over
=item amount =item amount
An integer to modify this user's karma by. Note that this number can An integer to modify this user's karma by. Note that this number can be positive or negative.
be positive or negative.
=item source =item source
A descriptive source for this karma. Typically it would be something 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.
like "MessageBoard (49)" or "Admin (3)". Source is used to track
where a karma modification came from.
=item description =item description
A description of why this user's karma was modified. For instance it A description of why this user's karma was modified. For instance it could be "Message Board Post" or "He was a good boy!".
could be "Message Board Post" or "He was a good boy!".
=back
=cut =cut
@ -228,12 +237,13 @@ sub lastUpdated {
Constructor. Constructor.
=over
=item userId =item userId
The userId of the user you're creating an object reference for. If 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.
left blank it will default to "1" (Visitor). If specified as "new"
then a new user account will be created and assigned the next =back
available userId.
=cut =cut
@ -265,18 +275,20 @@ sub new {
=head2 profileField ( fieldName [ value ] ) =head2 profileField ( fieldName [ value ] )
Returns a profile field's value. If "value" is specified, it also Returns a profile field's value. If "value" is specified, it also sets the field to that value.
sets the field to that value.
=over
=item fieldName =item fieldName
The profile field name such as "language" or "email" or The profile field name such as "language" or "email" or "cellPhone".
"cellPhone".
=item value =item value
The value to set the profile field name to. The value to set the profile field name to.
=back
=cut =cut
sub profileField { sub profileField {
@ -299,10 +311,13 @@ sub profileField {
Returns the status of the user. Returns the status of the user.
=over
=item value =item value
If specified, the status is set to this value. If specified, the status is set to this value. Possible values are 'Active', 'Selfdestructed' and 'Deactivated'.
Possible values are 'Active', 'Selfdestructed' and 'Deactivated'.
=back
=cut =cut
@ -324,10 +339,14 @@ sub status {
Returns the username. Returns the username.
=over
=item value =item value
If specified, the username is set to this value. If specified, the username is set to this value.
=back
=cut =cut
sub username { sub username {

View file

@ -47,8 +47,7 @@ our @EXPORT = qw(&makeTabSafe &makeArrayTabSafe &randomizeHash &commify &randomi
=head1 DESCRIPTION =head1 DESCRIPTION
This package provides miscellaneous but useful utilities to the This package provides miscellaneous but useful utilities to the WebGUI programmer.
WebGUI programmer.
=head1 METHODS =head1 METHODS
@ -63,10 +62,14 @@ our @EXPORT = qw(&makeTabSafe &makeArrayTabSafe &randomizeHash &commify &randomi
Returns a number with commas applied at each third character. Returns a number with commas applied at each third character.
=over
=item integer =item integer
Any old number will do. Any old number will do.
=back
=cut =cut
sub commify { sub commify {
@ -81,6 +84,8 @@ sub commify {
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 =item value
The value to check for. The value to check for.
@ -89,6 +94,8 @@ sub commify {
An array to look for the value in. An array to look for the value in.
=back
=cut =cut
sub isIn { sub isIn {
@ -115,14 +122,16 @@ sub isIn {
=head2 makeArrayCommaSafe ( array ) =head2 makeArrayCommaSafe ( array )
Searches through an array looking for commas and replaces them with 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.
semi-colons. Also replaces carriage returns with spaces. This is
useful for exporting comma separated data. =over
=item array =item array
A reference to the array to look through. A reference to the array to look through.
=back
=cut =cut
sub makeArrayCommaSafe { sub makeArrayCommaSafe {
@ -137,14 +146,16 @@ sub makeArrayCommaSafe {
=head2 makeArrayTabSafe ( array ) =head2 makeArrayTabSafe ( array )
Searches through an array looking for tabs and replaces them with 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.
four spaces. Also replaces carriage returns with a space. This is
useful for exporting tab separated data. =over
=item array =item array
A reference to the array to look through. A reference to the array to look through.
=back
=cut =cut
sub makeArrayTabSafe { sub makeArrayTabSafe {
@ -161,10 +172,14 @@ sub makeArrayTabSafe {
Replaces commas with semi-colons and carriage returns with spaces. Replaces commas with semi-colons and carriage returns with spaces.
=over
=item text =item text
The text to search through. The text to search through.
=back
=cut =cut
sub makeCommaSafe { sub makeCommaSafe {
@ -177,14 +192,18 @@ 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 =item text
The text to search through. The text to search through.
=back
=cut =cut
sub makeTabSafe { sub makeTabSafe {
@ -201,6 +220,8 @@ sub makeTabSafe {
Returns an integer between the low and high number. Returns an integer between the low and high number.
=over
=item low =item low
The lowest possible value. Defaults to 0. The lowest possible value. Defaults to 0.
@ -209,6 +230,8 @@ sub makeTabSafe {
The highest possible value. Defaults to 1. The highest possible value. Defaults to 1.
=back
=cut =cut
sub randint { sub randint {
@ -225,10 +248,14 @@ sub randint {
Resorts an array in random order. Resorts an array in random order.
=over
=item array =item array
A reference to the array to randomize. A reference to the array to randomize.
=back
=cut =cut
sub randomizeArray { sub randomizeArray {
@ -249,10 +276,14 @@ sub randomizeArray {
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 =item hashRef
A reference hash to randomize. A reference hash to randomize.
=back
=cut =cut
sub randomizeHash { sub randomizeHash {
@ -275,10 +306,14 @@ sub randomizeHash {
Returns an integer after rounding a real number. Returns an integer after rounding a real number.
=over
=item real =item real
Any floating point number. Any floating point number.
=back
=cut =cut
sub round { sub round {
@ -293,10 +328,14 @@ sub round {
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 =item hashRef
A reference to the hash to be sorted. A reference to the hash to be sorted.
=back
=cut =cut
sub sortHash { sub sortHash {
@ -321,10 +360,14 @@ sub sortHash {
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 =item hashRef
A reference to the hash to be sorted. A reference to the hash to be sorted.
=back
=cut =cut
sub sortHashDescending { sub sortHashDescending {

View file

@ -77,6 +77,8 @@ sub _getNextSequenceNumber {
=head2 confirm ( message, yesURL, [ , noURL, vitalComparison ] ) =head2 confirm ( message, yesURL, [ , noURL, vitalComparison ] )
=over
=item message =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.
@ -87,14 +89,13 @@ sub _getNextSequenceNumber {
=item noURL =item noURL
A URL to the web method to execute if the user denies the action. A URL to the web method to execute if the user denies the action. Defaults back to the current page.
Defaults back to the current page.
=item vitalComparison =item vitalComparison
A comparison expression to be used when checking whether the action 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.
should be allowed to continue. Typically this is used when the
action is a delete of some sort. =back
=cut =cut
@ -121,6 +122,8 @@ sub confirm {
Deletes a row of collateral data. Deletes a row of collateral data.
=over
=item tableName =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.
@ -133,6 +136,8 @@ sub confirm {
An integer containing the key value. An integer containing the key value.
=back
=cut =cut
sub deleteCollateral { sub deleteCollateral {
@ -159,8 +164,7 @@ sub description {
=head2 discussionProperties ( ) =head2 discussionProperties ( )
Returns a formRow list of discussion properties, which may be Returns a formRow list of discussion properties, which may be attached to any Wobject.
attached to any Wobject.
=cut =cut
@ -231,15 +235,17 @@ sub displayTitle {
=head2 duplicate ( [ pageId ] ) =head2 duplicate ( [ pageId ] )
Duplicates this wobject with a new wobject ID. Returns the new Duplicates this wobject with a new wobject ID. Returns the new wobject Id.
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 =item pageId
If specified the wobject will be duplicated to this pageId, If specified the wobject will be duplicated to this pageId, otherwise it will be duplicated to the clipboard.
otherwise it will be duplicated to the clipboard.
=back
=cut =cut
@ -273,11 +279,12 @@ sub duplicate {
=head2 fileProperty ( name, labelId ) =head2 fileProperty ( name, labelId )
Returns a file property form row which can be used in any Wobject Returns a file property form row which can be used in any Wobject properties page.
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 =item name
The name of the property that stores the filename. The name of the property that stores the filename.
@ -286,6 +293,8 @@ sub duplicate {
The internationalId of the form label for this file. The internationalId of the form label for this file.
=back
=cut =cut
sub fileProperty { sub fileProperty {
@ -308,13 +317,15 @@ sub fileProperty {
=head2 get ( [ propertyName ] ) =head2 get ( [ propertyName ] )
Returns a hash reference containing all of the properties of this Returns a hash reference containing all of the properties of this wobject instance.
wobject instance.
=over
=item propertyName =item propertyName
If an individual propertyName is specified, then only that If an individual propertyName is specified, then only that property value is returned as a scalar.
property value is returned as a scalar.
=back
=cut =cut
@ -333,6 +344,8 @@ sub get {
Returns a hash reference containing a row of collateral data. Returns a hash reference containing a row of collateral data.
=over
=item tableName =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.
@ -343,9 +356,9 @@ sub get {
=item keyValue =item keyValue
An integer containing the key value. If key value is equal to "new" 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.
or null, then an empty hashRef containing only keyName=>"new" will
be returned to avoid strict errors. =back
=cut =cut
@ -363,8 +376,7 @@ sub getCollateral {
=head2 inDateRange ( ) =head2 inDateRange ( )
Returns a boolean value of whether the wobject should be displayed Returns a boolean value of whether the wobject should be displayed based upon it's start and end dates.
based upon it's start and end dates.
=cut =cut
@ -380,10 +392,9 @@ sub inDateRange {
=head2 moveCollateralDown ( tableName, idName, id [ , setName, setValue ] ) =head2 moveCollateralDown ( tableName, idName, id [ , setName, setValue ] )
Moves a collateral data item down one position. This assumes that the 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.
collateral data table has a column called "wobjectId" that identifies
the wobject, and a column called "sequenceNumber" that determines =over
the position of the data item.
=item tableName =item tableName
@ -391,8 +402,7 @@ sub inDateRange {
=item idName =item idName
A string indicating the name of the column that uniquely identifies A string indicating the name of the column that uniquely identifies this collateral data item.
this collateral data item.
=item id =item id
@ -400,15 +410,13 @@ sub inDateRange {
=item setName =item setName
By default this method assumes that the collateral will have a 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.
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 =item setValue
The value of the column defined by "setName" to select a data set The value of the column defined by "setName" to select a data set from.
from.
=back
=cut =cut
@ -434,10 +442,9 @@ sub moveCollateralDown {
=head2 moveCollateralUp ( tableName, idName, id [ , setName, setValue ] ) =head2 moveCollateralUp ( tableName, idName, id [ , setName, setValue ] )
Moves a collateral data item up one position. This assumes that the 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.
collateral data table has a column called "wobjectId" that identifies
the wobject, and a column called "sequenceNumber" that determines =over
the position of the data item.
=item tableName =item tableName
@ -445,8 +452,7 @@ sub moveCollateralDown {
=item idName =item idName
A string indicating the name of the column that uniquely identifies A string indicating the name of the column that uniquely identifies this collateral data item.
this collateral data item.
=item id =item id
@ -454,15 +460,13 @@ sub moveCollateralDown {
=item setName =item setName
By default this method assumes that the collateral will have a 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.
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 =item setValue
The value of the column defined by "setName" to select a data set The value of the column defined by "setName" to select a data set from.
from.
=back
=cut =cut
@ -492,17 +496,15 @@ sub moveCollateralUp {
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 =item properties
A hash reference containing at minimum "wobjectId" and "namespace" 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.
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 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.
wobject instance is coming from WebGUI.pm, but this was done
to lessen database traffic thus increasing the speed of all =back
wobjects.
=cut =cut
@ -517,10 +519,14 @@ sub new {
Decides whether or not macros should be processed and returns the Decides whether or not macros should be processed and returns the
appropriate output. appropriate output.
=over
=item output =item output
An HTML blob to be processed for macros. An HTML blob to be processed for macros.
=back
=cut =cut
sub processMacros { sub processMacros {
@ -539,14 +545,17 @@ sub processMacros {
NOTE: Only for use in wobjects that support templates. NOTE: Only for use in wobjects that support templates.
=over
=item templateId =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 =item hashRef
A hash reference containing variables and loops to pass to the A hash reference containing variables and loops to pass to the template engine.
template engine.
=back
=cut =cut
@ -562,8 +571,7 @@ sub processTemplate {
=head2 purge ( ) =head2 purge ( )
Removes this wobject from the database and all it's attachments Removes this wobject from the database and all it's attachments from the filesystem.
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.
@ -583,8 +591,9 @@ sub purge {
=head2 reorderCollateral ( tableName, keyName [ , setName, setValue ] ) =head2 reorderCollateral ( tableName, keyName [ , setName, setValue ] )
Resequences collateral data. Typically useful after deleting a Resequences collateral data. Typically useful after deleting a collateral item to remove the gap created by the deletion.
collateral item to remove the gap created by the deletion.
=over
=item tableName =item tableName
@ -596,14 +605,13 @@ sub purge {
=item setName =item setName
Defaults to "wobjectId". This is used to define which data set to Defaults to "wobjectId". This is used to define which data set to reorder.
reorder.
=item setValue =item setValue
Used to define which data set to reorder. Defaults to the wobjectId 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.
for this instance. Defaults to the value of "setName" in the wobject
properties. =back
=cut =cut
@ -630,21 +638,19 @@ sub reorderCollateral {
NOTE: This method should be extended by all subclasses. NOTE: This method should be extended by all subclasses.
=over
=item hashRef =item hashRef
A hash reference of the properties of this wobject instance. This 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:
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, title, displayTitle, description, processMacros, pageId, templatePosition, startDate, endDate, sequenceNumber
pageId, templatePosition, startDate, endDate, sequenceNumber
=item arrayRef =item arrayRef
An array reference containing a list of properties associated 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.
with this Wobject class. The items in the list should marry
up to fields in the Wobject extention table for this class. =back
=cut =cut
@ -698,9 +704,9 @@ sub set {
=head2 setCollateral ( tableName, keyName, properties [ , useSequenceNumber, useWobjectId, setName, setValue ] ) =head2 setCollateral ( tableName, keyName, properties [ , useSequenceNumber, useWobjectId, setName, setValue ] )
Performs and insert/update of collateral data for any wobject's Performs and insert/update of collateral data for any wobject's collateral data. Returns the primary key value for that row of data.
collateral data. Returns the primary key value for that row of
data. =over
=item tableName =item tableName
@ -708,42 +714,29 @@ sub set {
=item keyName =item keyName
The column name of the primary key in the table specified above. The column name of the primary key in the table specified above. This must also be an incrementerId in the incrementer table.
This must also be an incrementerId in the incrementer table.
=item properties =item properties
A hash reference containing the name/value pairs to be inserted 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.
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 =item useSequenceNumber
If set to "1", a new sequenceNumber will be generated and inserted 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".
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 =item useWobjectId
If set to "1", the current wobjectId will be inserted into the table 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".
upon creation of a new row. Note that this means the table better
have a wobjectId column. Defaults to "1".
=item setName =item setName
If this collateral data set is not grouped by wobjectId, but by another 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.
column then specify that column here. The useSequenceNumber parameter
will then use this column name instead of wobjectId to generate
the sequenceNumber.
=item setValue =item setValue
If you've specified a setName you may also set a value for that set. 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.
Defaults to the value for this id from the wobject properties.
=item =back
=cut =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 =head2 uiLevel
Returns the UI Level of a wobject. Defaults to "0" for all wobjects. Returns the UI Level of a wobject. Defaults to "0" for all wobjects. Override to set the UI Level higher for a given wobject.
Override to set the UI Level higher for a given wobject.
=cut =cut
@ -974,8 +935,7 @@ sub www_deleteFileConfirm {
=head2 www_deleteMessage ( ) =head2 www_deleteMessage ( )
Displays a message asking for confirmation to delete a message from Displays a message asking for confirmation to delete a message from a discussion.
a discussion.
=cut =cut
@ -1027,10 +987,14 @@ sub www_denyPost {
NOTE: This method should be extended by all wobjects. NOTE: This method should be extended by all wobjects.
=over
=item formRows =item formRows
The custom form rows from the wobject subclass edit page. The custom form rows from the wobject subclass edit page.
=back
=cut =cut
sub www_edit { sub www_edit {
@ -1307,10 +1271,13 @@ sub www_search {
Shows a message from a discussion. Shows a message from a discussion.
=over
=item menuItem =item menuItem
You can optionally extend this method by passing in an HTML string You can optionally extend this method by passing in an HTML string of menu items to be added to the menu of this display.
of menu items to be added to the menu of this display.
=back
=cut =cut
@ -1344,8 +1311,7 @@ sub www_unlockThread {
=head2 www_view ( ) =head2 www_view ( )
The default display mechanism for any wobject. This web method MUST The default display mechanism for any wobject. This web method MUST be overridden.
be overridden.
=cut =cut