Fixed POD syntax.
This commit is contained in:
parent
4481cbec49
commit
3e89b31e13
28 changed files with 2003 additions and 1657 deletions
|
|
@ -34,7 +34,7 @@ use WebGUI::Utility;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Attachment
|
Package WebGUI::Attachment
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -59,12 +59,12 @@ use WebGUI::Utility;
|
||||||
$filename = $attachment->saveFromFilesystem($pathToFile);
|
$filename = $attachment->saveFromFilesystem($pathToFile);
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
Package to manipulate WebGUI Attachments.
|
Package to manipulate WebGUI Attachments.
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
These methods are available from this class:
|
These methods are available from this class:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -73,7 +73,7 @@ use WebGUI::Utility;
|
||||||
|
|
||||||
=head2 box ( )
|
=head2 box ( )
|
||||||
|
|
||||||
Displays the attachment in WebGUI's standard "Attachment Box".
|
Displays the attachment in WebGUI's standard "Attachment Box".
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -93,15 +93,19 @@ sub box {
|
||||||
|
|
||||||
=head2 copy ( newNode [, newNodeSub ] )
|
=head2 copy ( newNode [, newNodeSub ] )
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
=item newNodeSub
|
=item newNodeSub
|
||||||
|
|
||||||
If there is a subordinate element on this node define it here.
|
If there is a subordinate element on this node define it here.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -142,12 +146,15 @@ sub copy {
|
||||||
|
|
||||||
=head2 createThumbnail ( [ thumbnailSize ] )
|
=head2 createThumbnail ( [ thumbnailSize ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -177,7 +184,7 @@ sub createThumbnail {
|
||||||
|
|
||||||
=head2 delete ( )
|
=head2 delete ( )
|
||||||
|
|
||||||
Deletes an attachment from its node.
|
Deletes an attachment from its node.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -190,7 +197,7 @@ sub delete {
|
||||||
|
|
||||||
=head2 deleteNode ( )
|
=head2 deleteNode ( )
|
||||||
|
|
||||||
Deletes deletes this attachment's node (and everything in it).
|
Deletes deletes this attachment's node (and everything in it).
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -203,7 +210,7 @@ sub deleteNode {
|
||||||
|
|
||||||
=head2 getFilename ( )
|
=head2 getFilename ( )
|
||||||
|
|
||||||
Returns the attachment's filename.
|
Returns the attachment's filename.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -216,7 +223,7 @@ sub getFilename {
|
||||||
|
|
||||||
=head2 getIcon ( )
|
=head2 getIcon ( )
|
||||||
|
|
||||||
Returns the full URL to the file icon for this attachment.
|
Returns the full URL to the file icon for this attachment.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -299,7 +306,7 @@ sub getIcon {
|
||||||
|
|
||||||
=head2 getPath ( )
|
=head2 getPath ( )
|
||||||
|
|
||||||
Returns a full path to an attachment.
|
Returns a full path to an attachment.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -312,7 +319,7 @@ sub getPath {
|
||||||
|
|
||||||
=head2 getSize ( )
|
=head2 getSize ( )
|
||||||
|
|
||||||
Returns the size of this file.
|
Returns the size of this file.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
@ -358,7 +362,7 @@ sub getThumbnail {
|
||||||
|
|
||||||
=head2 getType ( )
|
=head2 getType ( )
|
||||||
|
|
||||||
Returns the extension or type of this attachment.
|
Returns the extension or type of this attachment.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -374,7 +378,7 @@ sub getType {
|
||||||
|
|
||||||
=head2 getURL ( )
|
=head2 getURL ( )
|
||||||
|
|
||||||
Returns a full URL to an attachment.
|
Returns a full URL to an attachment.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -387,7 +391,7 @@ sub getURL {
|
||||||
|
|
||||||
=head2 isImage ( )
|
=head2 isImage ( )
|
||||||
|
|
||||||
Returns a 1 or 0 depending on whether the file is an image or not.
|
Returns a 1 or 0 depending on whether the file is an image or not.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -399,22 +403,23 @@ sub isImage {
|
||||||
|
|
||||||
=head2 new ( filename, node [, nodeSubordinate ] )
|
=head2 new ( filename, node [, nodeSubordinate ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
The node where this attachment is (or will be placed).
|
The node where this attachment is (or will be placed).
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
@ -429,11 +434,15 @@ sub new {
|
||||||
|
|
||||||
=head2 rename ( newFilename )
|
=head2 rename ( newFilename )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -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,27 +550,23 @@ 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
|
||||||
|
|
||||||
Provide the local path to this file.
|
Provide the local path to this file.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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,17 +76,21 @@ sub _execute {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head adminForm ( userId, authMethod )
|
=head2 adminForm ( userId, authMethod )
|
||||||
|
|
||||||
Returns the admin form for the specified authentication method.
|
Returns the admin form for the specified authentication method.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item userId
|
=item userId
|
||||||
|
|
||||||
This user's id.
|
This user's id.
|
||||||
|
|
||||||
=item authMethod
|
=item authMethod
|
||||||
|
|
||||||
Specify the authentication method.
|
Specify the authentication method.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -49,17 +102,21 @@ sub adminForm {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head adminFormSave ( userId, authMethod )
|
=head2 adminFormSave ( userId, authMethod )
|
||||||
|
|
||||||
Saves the specified user's authentication information to the database.
|
Saves the specified user's authentication information to the database.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item userId
|
=item userId
|
||||||
|
|
||||||
The user id to save the information for.
|
The user id to save the information for.
|
||||||
|
|
||||||
=item authMethod
|
=item authMethod
|
||||||
|
|
||||||
Specify the authentication method.
|
Specify the authentication method.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -71,13 +128,17 @@ sub adminFormSave {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head adminFormValidate ( authMethod )
|
=head2 adminFormValidate ( authMethod )
|
||||||
|
|
||||||
Returns an error string if there are any problems with the form data.
|
Returns an error string if there are any problems with the form data.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item authMethod
|
=item authMethod
|
||||||
|
|
||||||
Specify the authentication method.
|
Specify the authentication method.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -88,23 +149,25 @@ sub adminFormValidate {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head authenticate ( userId, identifier, authMethod )
|
=head2 authenticate ( userId, identifier, authMethod )
|
||||||
|
|
||||||
Check to see that the user supplied information is correct. Returns
|
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
|
||||||
|
|
||||||
The user to authenticate.
|
The user to authenticate.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
@ -115,15 +178,17 @@ 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
|
||||||
|
|
||||||
|
|
@ -137,18 +202,21 @@ sub deleteParams {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head getParams ( userId [ , authMethod ] )
|
=head2 getParams ( userId [ , authMethod ] )
|
||||||
|
|
||||||
Returns an error string if there are any problems with the form data.
|
Returns a hash reference with the user's authentication information.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item userId
|
=item userId
|
||||||
|
|
||||||
Specify a user id.
|
Specify a user id.
|
||||||
|
|
||||||
=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,14 +231,17 @@ 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
|
||||||
|
|
||||||
|
|
@ -182,9 +253,9 @@ sub optionsLabel {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head registrationForm ( )
|
=head2 registrationForm ( )
|
||||||
|
|
||||||
Returns the user registration form for the default auth method.
|
Returns the user registration form for the default auth method.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -195,14 +266,17 @@ 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
|
||||||
|
|
||||||
|
|
@ -213,9 +287,9 @@ sub registrationFormSave {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head registrationFormValidate ( )
|
=head2 registrationFormValidate ( )
|
||||||
|
|
||||||
Returns an error string if there are any problems with the form data.
|
Returns an error string if there are any problems with the form data.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -227,13 +301,17 @@ sub registrationFormValidate {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head settingsForm ( authMethod )
|
=head2 settingsForm ( authMethod )
|
||||||
|
|
||||||
Returns a form for the WebGUI settings area.
|
Returns a form for the WebGUI settings area.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item authMethod
|
=item authMethod
|
||||||
|
|
||||||
The authentication method to display the form for.
|
The authentication method to display the form for.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -245,21 +323,25 @@ sub settingsForm {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head saveParams ( userId, authMethod, data )
|
=head2 saveParams ( userId, authMethod, data )
|
||||||
|
|
||||||
Saves the user's authentication parameters to the database.
|
Saves the user's authentication parameters to the database.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item userId
|
=item userId
|
||||||
|
|
||||||
Specify a user id.
|
Specify a user id.
|
||||||
|
|
||||||
=item authMethod
|
=item authMethod
|
||||||
|
|
||||||
Specify the authentication method to save these paramaters under.
|
Specify the authentication method to save these paramaters under.
|
||||||
|
|
||||||
=item data
|
=item data
|
||||||
|
|
||||||
A hash reference containing parameter names and values to be saved.
|
A hash reference containing parameter names and values to be saved.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -276,9 +358,9 @@ sub saveParams {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head userForm ( )
|
=head2 userForm ( )
|
||||||
|
|
||||||
Returns the user authentication data form.
|
Returns the user authentication data form.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -290,9 +372,9 @@ sub userForm {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head userFormSave ( )
|
=head2 userFormSave ( )
|
||||||
|
|
||||||
Saves user form data to the database.
|
Saves user form data to the database.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -303,9 +385,9 @@ sub userFormSave {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head userFormValidate ( )
|
=head2 userFormValidate ( )
|
||||||
|
|
||||||
Returns an error string if there are any problems with the form data.
|
Returns an error string if there are any problems with the form data.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ our @EXPORT = qw(&localtime &time &addToTime &addToDate &epochToHuman &epochToSe
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::DateTime
|
Package WebGUI::DateTime
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -50,12 +50,11 @@ 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
|
||||||
|
|
||||||
These functions are available from this package:
|
These functions are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -66,23 +65,27 @@ our @EXPORT = qw(&localtime &time &addToTime &addToDate &epochToHuman &epochToSe
|
||||||
|
|
||||||
=head2 addToDate ( epoch [ , years, months, days ] )
|
=head2 addToDate ( epoch [ , years, months, days ] )
|
||||||
|
|
||||||
Returns an epoch date with the amount of time added.
|
Returns an epoch date with the amount of time added.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item epoch
|
=item epoch
|
||||||
|
|
||||||
The number of seconds since January 1, 1970.
|
The number of seconds since January 1, 1970.
|
||||||
|
|
||||||
=item years
|
=item years
|
||||||
|
|
||||||
The number of years to add to the epoch.
|
The number of years to add to the epoch.
|
||||||
|
|
||||||
=item months
|
=item months
|
||||||
|
|
||||||
The number of months to add to the epoch.
|
The number of months to add to the epoch.
|
||||||
|
|
||||||
=item days
|
=item days
|
||||||
|
|
||||||
The number of days to add to the epoch.
|
The number of days to add to the epoch.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -98,23 +101,27 @@ sub addToDate {
|
||||||
|
|
||||||
=head2 addToTime ( epoch [ , hours, minutes, seconds ] )
|
=head2 addToTime ( epoch [ , hours, minutes, seconds ] )
|
||||||
|
|
||||||
Returns an epoch date with the amount of time added.
|
Returns an epoch date with the amount of time added.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item epoch
|
=item epoch
|
||||||
|
|
||||||
The number of seconds since January 1, 1970.
|
The number of seconds since January 1, 1970.
|
||||||
|
|
||||||
=item hours
|
=item hours
|
||||||
|
|
||||||
The number of hours to add to the epoch.
|
The number of hours to add to the epoch.
|
||||||
|
|
||||||
=item minutes
|
=item minutes
|
||||||
|
|
||||||
The number of minutes to add to the epoch.
|
The number of minutes to add to the epoch.
|
||||||
|
|
||||||
=item seconds
|
=item seconds
|
||||||
|
|
||||||
The number of seconds to add to the epoch.
|
The number of seconds to add to the epoch.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -130,11 +137,15 @@ sub addToTime {
|
||||||
|
|
||||||
=head2 dayStartEnd ( epoch )
|
=head2 dayStartEnd ( epoch )
|
||||||
|
|
||||||
Returns the epoch dates for the start and end of the day.
|
Returns the epoch dates for the start and end of the day.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item epoch
|
=item epoch
|
||||||
|
|
||||||
The number of seconds since January 1, 1970.
|
The number of seconds since January 1, 1970.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -150,16 +161,17 @@ sub dayStartEnd {
|
||||||
|
|
||||||
=head2 epochToHuman ( [ epoch, format ] )
|
=head2 epochToHuman ( [ epoch, format ] )
|
||||||
|
|
||||||
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,12 +267,15 @@ 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
|
||||||
|
|
||||||
|
|
@ -270,12 +287,15 @@ 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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -344,11 +366,15 @@ sub getDayName {
|
||||||
|
|
||||||
=head2 humanToEpoch ( date )
|
=head2 humanToEpoch ( date )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -371,16 +397,19 @@ sub humanToEpoch {
|
||||||
|
|
||||||
=head2 intervalToSeconds ( interval, units )
|
=head2 intervalToSeconds ( interval, units )
|
||||||
|
|
||||||
Returns the number of seconds derived from the interval.
|
Returns the number of seconds derived from the interval.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item interval
|
=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,13 +435,15 @@ 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
|
||||||
|
|
||||||
|
|
@ -423,16 +454,19 @@ 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
|
||||||
|
|
||||||
An epoch datestamp corresponding to the first month.
|
An epoch datestamp corresponding to the first month.
|
||||||
|
|
||||||
=item endEpoch
|
=item endEpoch
|
||||||
|
|
||||||
An epoch datestamp corresponding to the last month.
|
An epoch datestamp corresponding to the last month.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -448,11 +482,15 @@ sub monthCount {
|
||||||
|
|
||||||
=head2 monthStartEnd ( epoch )
|
=head2 monthStartEnd ( epoch )
|
||||||
|
|
||||||
Returns the epoch dates for the start and end of the month.
|
Returns the epoch dates for the start and end of the month.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item epoch
|
=item epoch
|
||||||
|
|
||||||
The number of seconds since January 1, 1970.
|
The number of seconds since January 1, 1970.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -469,12 +507,15 @@ sub monthStartEnd {
|
||||||
|
|
||||||
=head2 secondsToInterval ( seconds )
|
=head2 secondsToInterval ( seconds )
|
||||||
|
|
||||||
Returns an interval and units derived the number of seconds.
|
Returns an interval and units derived the number of seconds.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item seconds
|
=item seconds
|
||||||
|
|
||||||
The number of seconds in the interval.
|
The number of seconds in the interval.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -509,11 +550,15 @@ sub secondsToInterval {
|
||||||
|
|
||||||
=head2 setToEpoch ( set )
|
=head2 setToEpoch ( set )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -542,7 +587,7 @@ sub setToEpoch {
|
||||||
|
|
||||||
=head2 time ( )
|
=head2 time ( )
|
||||||
|
|
||||||
Returns an epoch date.
|
Returns an epoch date for now.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ use FileHandle;
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
|
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::ErrorHandler
|
WebGUI::ErrorHandler
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -32,11 +32,11 @@ use WebGUI::Session;
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
This package provides simple but effective error handling and logging for WebGUI.
|
This package provides simple but effective error handling and logging for WebGUI.
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
These functions are available from this package:
|
These functions are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -46,11 +46,15 @@ use WebGUI::Session;
|
||||||
|
|
||||||
=head2 audit ( message )
|
=head2 audit ( message )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -159,11 +160,15 @@ sub fatalError {
|
||||||
|
|
||||||
=head2 security ( message )
|
=head2 security ( message )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -181,11 +186,15 @@ sub security {
|
||||||
|
|
||||||
=head2 warn ( message )
|
=head2 warn ( message )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -20,7 +20,7 @@ use WebGUI::Session;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::HTML
|
Package WebGUI::HTML
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -30,11 +30,11 @@ use WebGUI::Session;
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
A package for manipulating and massaging HTML.
|
A package for manipulating and massaging HTML.
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
These methods are available from this package:
|
These methods are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -43,16 +43,17 @@ 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
|
||||||
|
|
||||||
|
|
@ -73,18 +74,19 @@ sub cleanSegment {
|
||||||
|
|
||||||
=head2 filter ( html [, filter ] )
|
=head2 filter ( html [, filter ] )
|
||||||
|
|
||||||
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
|
|
@ -25,7 +25,7 @@ our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon ©Icon &deleteIcon &editIcon
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Icon
|
Package WebGUI::Icon
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -46,14 +46,11 @@ our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon ©Icon &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
|
||||||
|
|
||||||
These subroutines are available from this package:
|
These subroutines are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -61,16 +58,19 @@ our @EXPORT = qw(&helpIcon &becomeIcon &cutIcon ©Icon &deleteIcon &editIcon
|
||||||
|
|
||||||
=head2 becomeIcon ( urlParameters [, pageURL ] )
|
=head2 becomeIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
||||||
Generates a button with the word "Become" printed on it.
|
Generates a button with the word "Become" printed on it.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item urlParameters
|
=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
|
||||||
|
|
||||||
|
|
@ -86,16 +86,19 @@ sub becomeIcon {
|
||||||
|
|
||||||
=head2 copyIcon ( urlParameters [, pageURL ] )
|
=head2 copyIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
||||||
Generates a button with the word "Copy" printed on it.
|
Generates a button with the word "Copy" printed on it.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item urlParameters
|
=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
|
||||||
|
|
||||||
|
|
@ -111,16 +114,19 @@ sub copyIcon {
|
||||||
|
|
||||||
=head2 cutIcon ( urlParameters [, pageURL ] )
|
=head2 cutIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
||||||
Generates a button with the word "Cut" printed on it.
|
Generates a button with the word "Cut" printed on it.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item urlParameters
|
=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
|
||||||
|
|
||||||
|
|
@ -136,16 +142,19 @@ sub cutIcon {
|
||||||
|
|
||||||
=head2 deleteIcon ( urlParameters [, pageURL ] )
|
=head2 deleteIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
||||||
Generates a button with an "X" printed on it.
|
Generates a button with an "X" printed on it.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item urlParameters
|
=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
|
||||||
|
|
||||||
|
|
@ -161,16 +170,19 @@ sub deleteIcon {
|
||||||
|
|
||||||
=head2 editIcon ( urlParameters [, pageURL ] )
|
=head2 editIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
||||||
Generates a button with the word "Edit" printed on it.
|
Generates a button with the word "Edit" printed on it.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item urlParameters
|
=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
|
||||||
|
|
||||||
|
|
@ -186,17 +198,19 @@ sub editIcon {
|
||||||
|
|
||||||
=head2 helpIcon ( helpId [, namespace ] )
|
=head2 helpIcon ( helpId [, namespace ] )
|
||||||
|
|
||||||
Generates a button with the word "Help" printed on it.
|
Generates a button with the word "Help" printed on it.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item helpId
|
=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
|
||||||
|
|
||||||
|
|
@ -212,16 +226,19 @@ sub helpIcon {
|
||||||
|
|
||||||
=head2 moveBottomIcon ( urlParameters [, pageURL ] )
|
=head2 moveBottomIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
||||||
Generates a button with a double down arrow printed on it.
|
Generates a button with a double down arrow printed on it.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item urlParameters
|
=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
|
||||||
|
|
||||||
|
|
@ -237,16 +254,19 @@ sub moveBottomIcon {
|
||||||
|
|
||||||
=head2 moveDownIcon ( urlParameters [, pageURL ] )
|
=head2 moveDownIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
||||||
Generates a button with a down arrow printed on it.
|
Generates a button with a down arrow printed on it.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item urlParameters
|
=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
|
||||||
|
|
||||||
|
|
@ -262,16 +282,19 @@ sub moveDownIcon {
|
||||||
|
|
||||||
=head2 moveTopIcon ( urlParameters [, pageURL ] )
|
=head2 moveTopIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
||||||
Generates a button with a double up arrow printed on it.
|
Generates a button with a double up arrow printed on it.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item urlParameters
|
=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
|
||||||
|
|
||||||
|
|
@ -287,16 +310,19 @@ sub moveTopIcon {
|
||||||
|
|
||||||
=head2 moveUpIcon ( urlParameters [, pageURL ] )
|
=head2 moveUpIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
||||||
Generates a button with an up arrow printed on it.
|
Generates a button with an up arrow printed on it.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item urlParameters
|
=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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -326,16 +350,19 @@ sub pageIcon {
|
||||||
|
|
||||||
=head2 viewIcon ( urlParameters [, pageURL ] )
|
=head2 viewIcon ( urlParameters [, pageURL ] )
|
||||||
|
|
||||||
Generates a button with the word "View" printed on it.
|
Generates a button with the word "View" printed on it.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item urlParameters
|
=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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ my %international;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::International
|
Package WebGUI::International
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -32,11 +32,11 @@ my %international;
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
This package provides an interface to the internationalization system.
|
This package provides an interface to the internationalization system.
|
||||||
|
|
||||||
=head1 FUNCTIONS
|
=head1 FUNCTIONS
|
||||||
|
|
||||||
These functions are available from this package:
|
These functions are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ use WebGUI::Session;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Macro
|
Package WebGUI::Macro
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -32,15 +32,13 @@ use WebGUI::Session;
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
This package is the interface to the WebGUI macro system.
|
This package is the interface to the WebGUI macro system.
|
||||||
|
|
||||||
NOTE: This entire system is likely to be replaced in the near future.
|
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
|
||||||
|
|
||||||
These functions are available from this package:
|
These functions are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -50,11 +48,15 @@ use WebGUI::Session;
|
||||||
|
|
||||||
=head2 getParams ( parameterString )
|
=head2 getParams ( parameterString )
|
||||||
|
|
||||||
A simple, but error prone mechanism for getting a prameter list from a string. Returns an array of parameters.
|
A simple, but error prone mechanism for getting a prameter list from a string. Returns an array of parameters.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item parameterString
|
=item parameterString
|
||||||
|
|
||||||
A string containing a comma separated list of paramenters.
|
A string containing a comma separated list of paramenters.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -74,11 +76,15 @@ sub getParams {
|
||||||
|
|
||||||
=head2 process ( html )
|
=head2 process ( html )
|
||||||
|
|
||||||
Runs all the WebGUI macros to and replaces them in the HTML with their output.
|
Runs all the WebGUI macros to and replaces them in the HTML with their output.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item html
|
=item html
|
||||||
|
|
||||||
A string of HTML to be processed.
|
A string of HTML to be processed.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ use WebGUI::Session;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Mail
|
Package WebGUI::Mail
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -31,11 +31,11 @@ use WebGUI::Session;
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
This package provides access to use SMTP based email services.
|
This package provides access to use SMTP based email services.
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
These methods are available from this class:
|
These methods are available from this class:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -45,32 +45,35 @@ use WebGUI::Session;
|
||||||
|
|
||||||
=head2 send ( to, subject, message [ , cc, from, bcc ] )
|
=head2 send ( to, subject, message [ , cc, from, bcc ] )
|
||||||
|
|
||||||
Sends an SMTP email message to the specified user.
|
Sends an SMTP email message to the specified user.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item to
|
=item to
|
||||||
|
|
||||||
An email address for the TO line.
|
An email address for the TO line.
|
||||||
|
|
||||||
=item subject
|
=item subject
|
||||||
|
|
||||||
The subject line for the email.
|
The subject line for the email.
|
||||||
|
|
||||||
=item message
|
=item message
|
||||||
|
|
||||||
The message body for the email.
|
The message body for the email.
|
||||||
|
|
||||||
=item cc
|
=item cc
|
||||||
|
|
||||||
The email address for the CC line.
|
The email address for the CC line.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use WebGUI::Utility;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::MessageLog
|
Package WebGUI::MessageLog
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -40,11 +40,11 @@ use WebGUI::Utility;
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
This package is WebGUI's notification system.
|
This package is WebGUI's notification system.
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
These functions are available from this package:
|
These functions are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -74,36 +74,39 @@ sub _notify {
|
||||||
|
|
||||||
=head2 addEntry ( userId, groupId, subject, message [ , url, status ] )
|
=head2 addEntry ( userId, groupId, subject, message [ , url, status ] )
|
||||||
|
|
||||||
Adds an entry to the message log and sends out notification to users.
|
Adds an entry to the message log and sends out notification to users.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item userId
|
=item userId
|
||||||
|
|
||||||
The id of the user that should receive this notification.
|
The id of the user that should receive this notification.
|
||||||
|
|
||||||
NOTE: This can be left blank if you're specifying a groupId.
|
NOTE: This can be left blank if you're specifying a groupId.
|
||||||
|
|
||||||
=item groupId
|
=item groupId
|
||||||
|
|
||||||
The id of the group that should receive this notification.
|
The id of the group that should receive this notification.
|
||||||
|
|
||||||
NOTE: This can be left blank if you're specifying a userId.
|
NOTE: This can be left blank if you're specifying a userId.
|
||||||
|
|
||||||
=item subject
|
=item subject
|
||||||
|
|
||||||
The subject of the notification.
|
The subject of the notification.
|
||||||
|
|
||||||
=item message
|
=item message
|
||||||
|
|
||||||
The content of the notification.
|
The content of the notification.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
@ -137,37 +140,39 @@ 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
|
||||||
|
|
||||||
The id of the user that should receive this notification.
|
The id of the user that should receive this notification.
|
||||||
|
|
||||||
NOTE: This can be left blank if you're specifying a groupId.
|
NOTE: This can be left blank if you're specifying a groupId.
|
||||||
|
|
||||||
=item groupId
|
=item groupId
|
||||||
|
|
||||||
The id of the group that should receive this notification.
|
The id of the group that should receive this notification.
|
||||||
|
|
||||||
NOTE: This can be left blank if you're specifying a userId.
|
NOTE: This can be left blank if you're specifying a userId.
|
||||||
|
|
||||||
=item url
|
=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
|
||||||
|
|
||||||
The unique identifier from the internationalization system of the message to send.
|
The unique identifier from the internationalization system of the message to send.
|
||||||
|
|
||||||
=item namespace
|
=item namespace
|
||||||
|
|
||||||
The namespace from the internationalization system of the message to send. Defaults to "WebGUI";
|
The namespace from the internationalization system of the message to send. Defaults to "WebGUI";
|
||||||
|
|
||||||
=item status
|
=item status
|
||||||
|
|
||||||
Defaults to 'notice'. Can be 'pending', 'notice', or 'completed'.
|
Defaults to 'notice'. Can be 'pending', 'notice', or 'completed'.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -207,11 +212,15 @@ sub addInternationalizedEntry {
|
||||||
|
|
||||||
=head2 completeEntry ( messageLogId )
|
=head2 completeEntry ( messageLogId )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ use WebGUI::URL;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Navigation
|
Package WebGUI::Navigation
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -37,11 +37,11 @@ use WebGUI::URL;
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
A package used to generate navigation.
|
A package used to generate navigation.
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
These methods are available from this package:
|
These methods are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -49,21 +49,23 @@ use WebGUI::URL;
|
||||||
|
|
||||||
=head2 drawHorizontal ( tree [ , seperator, class ] )
|
=head2 drawHorizontal ( tree [ , seperator, class ] )
|
||||||
|
|
||||||
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 "·".
|
||||||
to "·".
|
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
@ -94,29 +96,31 @@ sub drawHorizontal {
|
||||||
|
|
||||||
=head2 drawVertical ( tree [, bullet, class, spacing, indent ] )
|
=head2 drawVertical ( tree [, bullet, class, spacing, indent ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
An integer with the linespacing for the navigation. Defaults to 1.
|
An integer with the linespacing for the navigation. Defaults to 1.
|
||||||
|
|
||||||
=item indent
|
=item indent
|
||||||
|
|
||||||
An integer with the about of indenting to start with. Defaults to 0.
|
An integer with the about of indenting to start with. Defaults to 0.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ use WebGUI::Session;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Node
|
Package WebGUI::Node
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -35,15 +35,12 @@ use WebGUI::Session;
|
||||||
$node->getURL;
|
$node->getURL;
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
These methods are available from this package:
|
These methods are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -52,7 +49,7 @@ use WebGUI::Session;
|
||||||
|
|
||||||
=head2 create ( )
|
=head2 create ( )
|
||||||
|
|
||||||
Creates this node on the file system.
|
Creates this node on the file system.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -76,7 +73,7 @@ sub create {
|
||||||
|
|
||||||
=head2 delete ( )
|
=head2 delete ( )
|
||||||
|
|
||||||
Deletes this node and its contents (if any) from the filesystem.
|
Deletes this node and its contents (if any) from the filesystem.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -89,7 +86,7 @@ sub delete {
|
||||||
|
|
||||||
=head2 getPath ( )
|
=head2 getPath ( )
|
||||||
|
|
||||||
Returns a full path to this node.
|
Returns a full path to this node.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -107,7 +104,7 @@ sub getPath {
|
||||||
|
|
||||||
=head2 getURL ( )
|
=head2 getURL ( )
|
||||||
|
|
||||||
Returns a full URL to this node.
|
Returns a full URL to this node.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -125,7 +122,19 @@ sub getURL {
|
||||||
|
|
||||||
=head2 new ( node1 [, node2 ] )
|
=head2 new ( node1 [, node2 ] )
|
||||||
|
|
||||||
Constructor.
|
Constructor.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item node1
|
||||||
|
|
||||||
|
The first level of the hash heirarchy.
|
||||||
|
|
||||||
|
=item node2
|
||||||
|
|
||||||
|
The second level of the hash heirarchy.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ use WebGUI::Template;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Page
|
Package WebGUI::Page
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -42,11 +42,11 @@ use WebGUI::Template;
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
This package provides utility functions for WebGUI's page system.
|
This package provides utility functions for WebGUI's page system.
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
These functions are available from this package:
|
These functions are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -60,11 +60,15 @@ sub _newPositionFormat {
|
||||||
|
|
||||||
=head2 countTemplatePositions ( templateId )
|
=head2 countTemplatePositions ( templateId )
|
||||||
|
|
||||||
Returns the number of template positions in the specified page template.
|
Returns the number of template positions in the specified page template.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item templateId
|
=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
|
||||||
|
|
||||||
|
|
@ -82,11 +86,15 @@ sub countTemplatePositions {
|
||||||
|
|
||||||
=head2 drawTemplate ( templateId )
|
=head2 drawTemplate ( templateId )
|
||||||
|
|
||||||
Returns an HTML string containing a small representation of the page template.
|
Returns an HTML string containing a small representation of the page template.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item templateId
|
=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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -117,11 +124,15 @@ sub getTemplateList {
|
||||||
|
|
||||||
=head2 getTemplate ( templateId )
|
=head2 getTemplate ( templateId )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -135,12 +146,15 @@ 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
|
||||||
|
|
||||||
|
|
@ -157,15 +171,19 @@ sub getTemplatePositions {
|
||||||
|
|
||||||
=head2 makeUnique ( pageURL, pageId )
|
=head2 makeUnique ( pageURL, pageId )
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
=item pageId
|
=item pageId
|
||||||
|
|
||||||
The page id of the page you're creating a URL for.
|
The page id of the page you're creating a URL for.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ use WebGUI::URL;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Paginator
|
Package WebGUI::Paginator
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -45,11 +45,11 @@ use WebGUI::URL;
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
Package that paginates rows of arbitrary data for display on the web.
|
Package that paginates rows of arbitrary data for display on the web.
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
These methods are available from this class:
|
These methods are available from this class:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -188,12 +194,15 @@ sub getBarTraditional {
|
||||||
|
|
||||||
=head2 getFirstPageLink ( [ pageNumber ] )
|
=head2 getFirstPageLink ( [ pageNumber ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -215,12 +224,15 @@ sub getFirstPageLink {
|
||||||
|
|
||||||
=head2 getLastPageLink ( [ pageNumber ] )
|
=head2 getLastPageLink ( [ pageNumber ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -242,12 +254,15 @@ sub getLastPageLink {
|
||||||
|
|
||||||
=head2 getNextPageLink ( [ pageNumber ] )
|
=head2 getNextPageLink ( [ pageNumber ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -267,7 +282,7 @@ sub getNextPageLink {
|
||||||
|
|
||||||
=head2 getNumberOfPages ( )
|
=head2 getNumberOfPages ( )
|
||||||
|
|
||||||
Returns the number of pages in this paginator.
|
Returns the number of pages in this paginator.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -282,15 +297,17 @@ sub getNumberOfPages {
|
||||||
|
|
||||||
=head2 getPage ( [ pageNumber ] )
|
=head2 getPage ( [ pageNumber ] )
|
||||||
|
|
||||||
Returns the data from the page specified as a string.
|
Returns the data from the page specified as a string.
|
||||||
|
|
||||||
NOTE: This is really only useful if you passed in an array reference
|
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
|
||||||
|
|
||||||
|
|
@ -303,12 +320,15 @@ sub getPage {
|
||||||
|
|
||||||
=head2 getPageData ( [ pageNumber ] )
|
=head2 getPageData ( [ pageNumber ] )
|
||||||
|
|
||||||
Returns the data from the page specified as an array reference.
|
Returns the data from the page specified as an array reference.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item pageNumber
|
=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
|
||||||
|
|
||||||
|
|
@ -344,12 +363,15 @@ sub getPageNumber {
|
||||||
|
|
||||||
=head2 getPageLinks ( [ pageNumber ] )
|
=head2 getPageLinks ( [ pageNumber ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -373,12 +395,15 @@ sub getPageLinks {
|
||||||
|
|
||||||
=head2 getPreviousPageLink ( [ pageNumber ] )
|
=head2 getPreviousPageLink ( [ pageNumber ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -398,32 +423,31 @@ sub getPreviousPageLink {
|
||||||
|
|
||||||
=head2 new ( currentURL, rowArrayRef [, paginateAfter, pageNumber, formVar ] )
|
=head2 new ( currentURL, rowArrayRef [, paginateAfter, pageNumber, formVar ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
An array reference to all the rows of data for this page.
|
An array reference to all the rows of data for this page.
|
||||||
|
|
||||||
=item paginateAfter
|
=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,18 +466,21 @@ 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.
|
||||||
|
|
||||||
=item dbh
|
=item dbh
|
||||||
|
|
||||||
A DBI-style database handler. Defaults to the WebGUI site handler.
|
A DBI-style database handler. Defaults to the WebGUI site handler.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ use WebGUI::URL;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Privilege
|
Package WebGUI::Privilege
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -41,12 +41,11 @@ 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
|
||||||
|
|
||||||
These functions are available from this package:
|
These functions are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -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,17 +191,19 @@ 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
|
||||||
|
|
||||||
The group that you wish to verify against the user.
|
The group that you wish to verify against the user.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ use WebGUI::URL;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Profile
|
Package WebGUI::Profile
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -30,11 +30,11 @@ use WebGUI::URL;
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
Package that allows getting and setting of user profile information.
|
Package that allows getting and setting of user profile information.
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
These methods are available from this class:
|
These methods are available from this class:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ use WebGUI::URL;
|
||||||
|
|
||||||
=head2 get ( )
|
=head2 get ( )
|
||||||
|
|
||||||
Returns a profile hash for this user.
|
Returns a profile hash for this user.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -58,12 +58,16 @@ sub get {
|
||||||
|
|
||||||
=head2 new ( userId )
|
=head2 new ( userId )
|
||||||
|
|
||||||
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,17 +79,21 @@ sub new {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head setAttribute ( attributeName, value )
|
=head2 setAttribute ( attributeName, value )
|
||||||
|
|
||||||
Sets the value of an attribute.
|
Sets the value of an attribute.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item attributeName
|
=item attributeName
|
||||||
|
|
||||||
An attribute of the user profile.
|
An attribute of the user profile.
|
||||||
|
|
||||||
=item value
|
=item value
|
||||||
|
|
||||||
The value to set the above named attribute to.
|
The value to set the above named attribute to.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ our @EXPORT = qw("e &getNextId);
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::SQL
|
Package WebGUI::SQL
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -58,13 +58,11 @@ our @EXPORT = qw("e &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
|
||||||
|
|
||||||
These methods are available from this package:
|
These methods are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -73,7 +71,7 @@ our @EXPORT = qw("e &getNextId);
|
||||||
|
|
||||||
=head2 array ( )
|
=head2 array ( )
|
||||||
|
|
||||||
Returns the next row of data as an array.
|
Returns the next row of data as an array.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -86,16 +84,19 @@ sub array {
|
||||||
|
|
||||||
=head2 buildArray ( sql [, dbh ] )
|
=head2 buildArray ( sql [, dbh ] )
|
||||||
|
|
||||||
Builds an array of data from a series of rows.
|
Builds an array of data from a series of rows.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item sql
|
=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
|
||||||
|
|
||||||
|
|
@ -116,17 +117,19 @@ sub buildArray {
|
||||||
|
|
||||||
=head2 buildHash ( sql [, dbh ] )
|
=head2 buildHash ( sql [, dbh ] )
|
||||||
|
|
||||||
Builds a hash of data from a series of rows.
|
Builds a hash of data from a series of rows.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item sql
|
=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
|
||||||
|
|
||||||
|
|
@ -146,17 +149,19 @@ sub buildHash {
|
||||||
|
|
||||||
=head2 buildHashRef ( sql [, dbh ] )
|
=head2 buildHashRef ( sql [, dbh ] )
|
||||||
|
|
||||||
Builds a hash reference of data from a series of rows.
|
Builds a hash reference of data from a series of rows.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item sql
|
=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
|
||||||
|
|
||||||
|
|
@ -172,7 +177,7 @@ sub buildHashRef {
|
||||||
|
|
||||||
=head2 errorCode {
|
=head2 errorCode {
|
||||||
|
|
||||||
Returns an error code for the current handler.
|
Returns an error code for the current handler.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -185,7 +190,7 @@ sub errorCode {
|
||||||
|
|
||||||
=head2 errorMessage {
|
=head2 errorMessage {
|
||||||
|
|
||||||
Returns a text error message for the current handler.
|
Returns a text error message for the current handler.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -198,7 +203,7 @@ sub errorMessage {
|
||||||
|
|
||||||
=head2 finish ( )
|
=head2 finish ( )
|
||||||
|
|
||||||
Ends a query after calling the "new" or "read" methods.
|
Ends a query after calling the "new" or "read" methods.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -211,7 +216,7 @@ sub finish {
|
||||||
|
|
||||||
=head2 getColumnNames {
|
=head2 getColumnNames {
|
||||||
|
|
||||||
Returns an array of column names. Use with a "read" method.
|
Returns an array of column names. Use with a "read" method.
|
||||||
|
|
||||||
=cut
|
=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
|
||||||
|
|
||||||
|
|
@ -289,16 +295,19 @@ sub hashRef {
|
||||||
|
|
||||||
=head2 new ( sql [, dbh ] )
|
=head2 new ( sql [, dbh ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -320,16 +329,19 @@ sub new {
|
||||||
|
|
||||||
=head2 quickArray ( sql [, dbh ] )
|
=head2 quickArray ( sql [, dbh ] )
|
||||||
|
|
||||||
Executes a query and returns a single row of data as an array.
|
Executes a query and returns a single row of data as an array.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item sql
|
=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,17 +358,19 @@ 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
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -377,16 +391,19 @@ sub quickCSV {
|
||||||
|
|
||||||
=head2 quickHash ( sql [, dbh ] )
|
=head2 quickHash ( sql [, dbh ] )
|
||||||
|
|
||||||
Executes a query and returns a single row of data as a hash.
|
Executes a query and returns a single row of data as a hash.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item sql
|
=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,17 +423,19 @@ 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
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -436,17 +455,19 @@ 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
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -466,13 +487,17 @@ 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
|
||||||
|
|
||||||
|
|
@ -486,16 +511,19 @@ sub quote {
|
||||||
|
|
||||||
=head2 read ( sql [, dbh ] )
|
=head2 read ( sql [, dbh ] )
|
||||||
|
|
||||||
An alias of the "new" method. Returns a statement handler.
|
An alias of the "new" method. Returns a statement handler.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item sql
|
=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,19 +549,19 @@ 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
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -551,18 +578,19 @@ 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
|
||||||
|
|
||||||
An SQL insert or update.
|
An SQL insert or update.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ use WebGUI::SQL;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Search
|
Package WebGUI::Search
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -35,12 +35,11 @@ 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
|
||||||
|
|
||||||
These methods are available from this package:
|
These methods are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -143,17 +136,19 @@ sub buildConstraints {
|
||||||
|
|
||||||
=head2 form ( hiddenFields ) { [ numResults ] }
|
=head2 form ( hiddenFields ) { [ numResults ] }
|
||||||
|
|
||||||
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;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ tie %session, 'Tie::CPHash';
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Session
|
Package WebGUI::Session
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -53,23 +53,15 @@ 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
|
||||||
|
|
||||||
These subroutines are available from this package:
|
These subroutines are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -263,15 +254,19 @@ sub close {
|
||||||
|
|
||||||
=head2 convertVisitorToUser ( sessionId, userId )
|
=head2 convertVisitorToUser ( sessionId, userId )
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
=item userId
|
=item userId
|
||||||
|
|
||||||
The user for the session to become.
|
The user for the session to become.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -285,11 +280,15 @@ sub convertVisitorToUser {
|
||||||
|
|
||||||
=head2 end ( sessionId )
|
=head2 end ( sessionId )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -305,7 +304,7 @@ sub end {
|
||||||
|
|
||||||
=head2 httpHeader ( )
|
=head2 httpHeader ( )
|
||||||
|
|
||||||
Generates an HTTP header.
|
Generates an HTTP header.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -328,11 +327,15 @@ sub httpHeader {
|
||||||
|
|
||||||
=head2 httpRedirect ( url )
|
=head2 httpRedirect ( url )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -345,15 +348,19 @@ sub httpRedirect {
|
||||||
|
|
||||||
=head2 open ( webguiRoot [ , configFile ] )
|
=head2 open ( webguiRoot [ , configFile ] )
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
=item configFile
|
=item configFile
|
||||||
|
|
||||||
The filename of the config file that WebGUI should operate from.
|
The filename of the config file that WebGUI should operate from.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -461,12 +468,15 @@ sub open {
|
||||||
|
|
||||||
=head2 refreshPageInfo ( [ pageId ] )
|
=head2 refreshPageInfo ( [ pageId ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -484,13 +494,17 @@ sub refreshPageInfo {
|
||||||
|
|
||||||
=head2 refreshSessionVars ( sessionId )
|
=head2 refreshSessionVars ( sessionId )
|
||||||
|
|
||||||
Updates the user session variables from the database.
|
Updates the user session variables from the database.
|
||||||
|
|
||||||
NOTE: This also updates the user information.
|
NOTE: This also updates the user information.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item sessionId
|
=item sessionId
|
||||||
|
|
||||||
The session id to update.
|
The session id to update.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
@ -521,21 +538,23 @@ sub refreshUserInfo {
|
||||||
|
|
||||||
=head2 setCookie ( name, value [ , timeToLive ] )
|
=head2 setCookie ( name, value [ , timeToLive ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
The value to set.
|
The value to set.
|
||||||
|
|
||||||
=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,19 +575,19 @@ 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
|
||||||
|
|
||||||
The name of the scratch variable.
|
The name of the scratch variable.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
@ -593,16 +612,19 @@ sub setScratch {
|
||||||
|
|
||||||
=head2 start ( userId [ , sessionId ] )
|
=head2 start ( userId [ , sessionId ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ use WebGUI::Template;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Style
|
Package WebGUI::Style
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -34,11 +34,11 @@ use WebGUI::Template;
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
This package contains utility methods for WebGUI's style system.
|
This package contains utility methods for WebGUI's style system.
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
These subroutines are available from this package:
|
These subroutines are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -47,7 +47,7 @@ use WebGUI::Template;
|
||||||
|
|
||||||
=head2 get ( )
|
=head2 get ( )
|
||||||
|
|
||||||
Returns a style based upon the current WebGUI session information.
|
Returns a style based upon the current WebGUI session information.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ use WebGUI::SQL;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Template
|
Package WebGUI::Template
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -38,28 +38,32 @@ use WebGUI::SQL;
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
This package contains utility methods for WebGUI's template system.
|
This package contains utility methods for WebGUI's template system.
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
These subroutines are available from this package:
|
These subroutines are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=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.
|
||||||
|
|
||||||
=item namespace
|
=item namespace
|
||||||
|
|
||||||
Defaults to "Page". Specify the namespace of the template to retrieve.
|
Defaults to "Page". Specify the namespace of the template to retrieve.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -76,12 +80,15 @@ 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
|
||||||
|
|
||||||
|
|
@ -95,16 +102,19 @@ sub getList {
|
||||||
|
|
||||||
=head2 process ( template [ , vars ] )
|
=head2 process ( template [ , vars ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ use WebGUI::Utility;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::URL
|
Package WebGUI::URL
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -38,14 +38,11 @@ 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
|
||||||
|
|
||||||
These subroutines are available from this package:
|
These subroutines are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -55,18 +52,22 @@ use WebGUI::Utility;
|
||||||
|
|
||||||
=head2 append ( url, pairs )
|
=head2 append ( url, pairs )
|
||||||
|
|
||||||
Returns a URL after adding some information to the end of it.
|
Returns a URL after adding some information to the end of it.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item url
|
=item url
|
||||||
|
|
||||||
The URL to append information to.
|
The URL to append information to.
|
||||||
|
|
||||||
=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 append {
|
sub append {
|
||||||
|
|
@ -84,13 +85,17 @@ sub append {
|
||||||
|
|
||||||
=head2 escape ( string )
|
=head2 escape ( string )
|
||||||
|
|
||||||
Encodes a string to make it safe to pass in a URL.
|
Encodes a string to make it safe to pass in a URL.
|
||||||
|
|
||||||
NOTE: See WebGUI::URL::unescape()
|
NOTE: See WebGUI::URL::unescape()
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item string
|
=item string
|
||||||
|
|
||||||
The string to escape.
|
The string to escape.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -103,18 +108,22 @@ sub escape {
|
||||||
|
|
||||||
=head2 gateway ( pageURL [ , pairs ] )
|
=head2 gateway ( pageURL [ , pairs ] )
|
||||||
|
|
||||||
Generate a URL based on WebGUI's gateway script.
|
Generate a URL based on WebGUI's gateway script.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item pageURL
|
=item pageURL
|
||||||
|
|
||||||
The urlized title of a page that you wish to create a URL for.
|
The urlized title of a page that you wish to create a URL for.
|
||||||
|
|
||||||
=item pairs
|
=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 gateway {
|
sub gateway {
|
||||||
|
|
@ -133,12 +142,15 @@ sub gateway {
|
||||||
|
|
||||||
=head2 makeCompliant ( string )
|
=head2 makeCompliant ( string )
|
||||||
|
|
||||||
Returns a string that has made into a WebGUI compliant URL.
|
Returns a string that has made into a WebGUI compliant URL.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item string
|
=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
|
||||||
|
|
||||||
|
|
@ -158,14 +170,18 @@ sub makeCompliant {
|
||||||
|
|
||||||
=head2 page ( [ pairs ] )
|
=head2 page ( [ pairs ] )
|
||||||
|
|
||||||
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 {
|
||||||
|
|
@ -184,13 +200,17 @@ sub page {
|
||||||
|
|
||||||
=head2 unescape
|
=head2 unescape
|
||||||
|
|
||||||
Decodes a string that was URL encoded.
|
Decodes a string that was URL encoded.
|
||||||
|
|
||||||
NOTE: See WebGUI::URL::escape()
|
NOTE: See WebGUI::URL::escape()
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item string
|
=item string
|
||||||
|
|
||||||
The string to unescape.
|
The string to unescape.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ use WebGUI::Authentication;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::User
|
Package WebGUI::User
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -45,12 +45,11 @@ 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
|
||||||
|
|
||||||
These methods are available from this class:
|
These methods are available from this class:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -66,11 +65,15 @@ sub _create {
|
||||||
|
|
||||||
=head2 addToGroups ( groups )
|
=head2 addToGroups ( groups )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -89,13 +92,15 @@ sub addToGroups {
|
||||||
|
|
||||||
=head2 authMethod ( [ value ] )
|
=head2 authMethod ( [ value ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -115,7 +120,7 @@ sub authMethod {
|
||||||
|
|
||||||
=head2 dateCreated ( )
|
=head2 dateCreated ( )
|
||||||
|
|
||||||
Returns the epoch for when this user was created.
|
Returns the epoch for when this user was created.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -127,7 +132,7 @@ sub dateCreated {
|
||||||
|
|
||||||
=head2 delete ( )
|
=head2 delete ( )
|
||||||
|
|
||||||
Deletes this user.
|
Deletes this user.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -146,11 +151,15 @@ sub delete {
|
||||||
|
|
||||||
=head2 deleteFromGroups ( groups )
|
=head2 deleteFromGroups ( groups )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -182,23 +191,23 @@ sub identifier {
|
||||||
|
|
||||||
=head2 karma ( amount, source, description )
|
=head2 karma ( amount, source, description )
|
||||||
|
|
||||||
Returns the current level of karma this user has earned.
|
Returns the current level of karma this user has earned.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item amount
|
=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
|
||||||
|
|
||||||
|
|
@ -214,7 +223,7 @@ sub karma {
|
||||||
|
|
||||||
=head2 lastUpdated ( )
|
=head2 lastUpdated ( )
|
||||||
|
|
||||||
Returns the epoch for when this user was last modified.
|
Returns the epoch for when this user was last modified.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -226,14 +235,15 @@ sub lastUpdated {
|
||||||
|
|
||||||
=head2 new ( userId )
|
=head2 new ( userId )
|
||||||
|
|
||||||
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,17 +275,19 @@ 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
|
||||||
|
|
||||||
|
|
@ -297,12 +309,15 @@ sub profileField {
|
||||||
|
|
||||||
=head2 status ( [ value ] )
|
=head2 status ( [ value ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -322,11 +337,15 @@ sub status {
|
||||||
|
|
||||||
=head2 username ( [ value ] )
|
=head2 username ( [ value ] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -346,7 +365,7 @@ sub username {
|
||||||
|
|
||||||
=head2 userId ( )
|
=head2 userId ( )
|
||||||
|
|
||||||
Returns the userId for this user.
|
Returns the userId for this user.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ our @EXPORT = qw(&makeTabSafe &makeArrayTabSafe &randomizeHash &commify &randomi
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Utility
|
Package WebGUI::Utility
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
|
@ -47,12 +47,11 @@ 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
|
||||||
|
|
||||||
These subroutines are available from this package:
|
These subroutines are available from this package:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -61,11 +60,15 @@ our @EXPORT = qw(&makeTabSafe &makeArrayTabSafe &randomizeHash &commify &randomi
|
||||||
|
|
||||||
=head2 commify ( integer )
|
=head2 commify ( integer )
|
||||||
|
|
||||||
Returns a number with commas applied at each third character.
|
Returns a number with commas applied at each third character.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item integer
|
=item integer
|
||||||
|
|
||||||
Any old number will do.
|
Any old number will do.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -79,15 +82,19 @@ sub commify {
|
||||||
|
|
||||||
=head2 isIn ( value, list )
|
=head2 isIn ( value, list )
|
||||||
|
|
||||||
Returns a boolean value as to whether the value is in the array.
|
Returns a boolean value as to whether the value is in the array.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item value
|
=item value
|
||||||
|
|
||||||
The value to check for.
|
The value to check for.
|
||||||
|
|
||||||
=item list
|
=item list
|
||||||
|
|
||||||
An array to look for the value in.
|
An array to look for the value in.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -115,13 +122,15 @@ 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
|
||||||
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
@ -159,11 +170,15 @@ sub makeArrayTabSafe {
|
||||||
|
|
||||||
=head2 makeCommaSafe ( text )
|
=head2 makeCommaSafe ( text )
|
||||||
|
|
||||||
Replaces commas with semi-colons and carriage returns with spaces.
|
Replaces commas with semi-colons and carriage returns with spaces.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item text
|
=item text
|
||||||
|
|
||||||
The text to search through.
|
The text to search through.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -177,13 +192,17 @@ sub makeCommaSafe {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 makeCommaSafe ( text )
|
=head2 makeTabSafe ( text )
|
||||||
|
|
||||||
Replaces tabs with four spaces and carriage returns with a space each.
|
Replaces tabs with four spaces and carriage returns with a space each.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item text
|
=item text
|
||||||
|
|
||||||
The text to search through.
|
The text to search through.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -199,15 +218,19 @@ sub makeTabSafe {
|
||||||
|
|
||||||
=head2 randint ( low, high )
|
=head2 randint ( low, high )
|
||||||
|
|
||||||
Returns an integer between the low and high number.
|
Returns an integer between the low and high number.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item low
|
=item low
|
||||||
|
|
||||||
The lowest possible value. Defaults to 0.
|
The lowest possible value. Defaults to 0.
|
||||||
|
|
||||||
=item high
|
=item high
|
||||||
|
|
||||||
The highest possible value. Defaults to 1.
|
The highest possible value. Defaults to 1.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -223,11 +246,15 @@ sub randint {
|
||||||
|
|
||||||
=head2 randomizeArray ( array )
|
=head2 randomizeArray ( array )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -247,11 +274,15 @@ sub randomizeArray {
|
||||||
|
|
||||||
=head2 randomizeHash ( hashRef )
|
=head2 randomizeHash ( hashRef )
|
||||||
|
|
||||||
Resorts a hash tied to IxHash in random order. Returns a hash reference.
|
Resorts a hash tied to IxHash in random order. Returns a hash reference.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item hashRef
|
=item hashRef
|
||||||
|
|
||||||
A reference hash to randomize.
|
A reference hash to randomize.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -273,11 +304,15 @@ sub randomizeHash {
|
||||||
|
|
||||||
=head2 round ( real )
|
=head2 round ( real )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -289,13 +324,17 @@ sub round {
|
||||||
|
|
||||||
=head2 sortHash ( hashRef )
|
=head2 sortHash ( hashRef )
|
||||||
|
|
||||||
Sorts a hash by its values. Returns a hash reference.
|
Sorts a hash by its values. Returns a hash reference.
|
||||||
|
|
||||||
TIP: This subroutine can screw up your hash if the values aren't all unique.
|
TIP: This subroutine can screw up your hash if the values aren't all unique.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item hashRef
|
=item hashRef
|
||||||
|
|
||||||
A reference to the hash to be sorted.
|
A reference to the hash to be sorted.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -317,13 +356,17 @@ sub sortHash {
|
||||||
|
|
||||||
=head2 sortHashDecending
|
=head2 sortHashDecending
|
||||||
|
|
||||||
Sorts a hash in decending order by its values. Returns a hash reference.
|
Sorts a hash in decending order by its values. Returns a hash reference.
|
||||||
|
|
||||||
TIP: This subroutine can screw up your hash if the values aren't all unique.
|
TIP: This subroutine can screw up your hash if the values aren't all unique.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item hashRef
|
=item hashRef
|
||||||
|
|
||||||
A reference to the hash to be sorted.
|
A reference to the hash to be sorted.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,22 +35,22 @@ use WebGUI::Utility;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Wobject
|
Package WebGUI::Wobject
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
use WebGUI::Wobject;
|
use WebGUI::Wobject;
|
||||||
our @ISA = qw(WebGUI::Wobject);
|
our @ISA = qw(WebGUI::Wobject);
|
||||||
|
|
||||||
See the subclasses in lib/WebGUI/Wobjects for details.
|
See the subclasses in lib/WebGUI/Wobjects for details.
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
An abstract class for all other wobjects to extend.
|
An abstract class for all other wobjects to extend.
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
These methods are available from this class:
|
These methods are available from this class:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -77,24 +77,25 @@ 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.
|
||||||
|
|
||||||
=item yesURL
|
=item yesURL
|
||||||
|
|
||||||
A URL to the web method to execute if the user confirms the action.
|
A URL to the web method to execute if the user confirms the action.
|
||||||
|
|
||||||
=item noURL
|
=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
|
||||||
|
|
||||||
|
|
@ -119,19 +120,23 @@ sub confirm {
|
||||||
|
|
||||||
=head2 deleteCollateral ( tableName, keyName, keyValue )
|
=head2 deleteCollateral ( tableName, keyName, keyValue )
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
=item keyName
|
=item keyName
|
||||||
|
|
||||||
The name of the column that is the primary key in the table.
|
The name of the column that is the primary key in the table.
|
||||||
|
|
||||||
=item keyValue
|
=item keyValue
|
||||||
|
|
||||||
An integer containing the key value.
|
An integer containing the key value.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -145,7 +150,7 @@ sub deleteCollateral {
|
||||||
|
|
||||||
=head2 description ( )
|
=head2 description ( )
|
||||||
|
|
||||||
Returns this instance's description if it exists.
|
Returns this instance's description if it exists.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -215,7 +219,7 @@ sub discussionProperties {
|
||||||
|
|
||||||
=head2 displayTitle ( )
|
=head2 displayTitle ( )
|
||||||
|
|
||||||
Returns this instance's title if displayTitle is set to yes.
|
Returns this instance's title if displayTitle is set to yes.
|
||||||
|
|
||||||
=cut
|
=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,18 +279,21 @@ 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.
|
||||||
|
|
||||||
=item labelId
|
=item labelId
|
||||||
|
|
||||||
The internationalId of the form label for this file.
|
The internationalId of the form label for this file.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -331,21 +342,23 @@ sub get {
|
||||||
|
|
||||||
=head2 getCollateral ( tableName, keyName, keyValue )
|
=head2 getCollateral ( tableName, keyName, keyValue )
|
||||||
|
|
||||||
Returns a hash reference containing a row of collateral data.
|
Returns a hash reference containing a row of collateral data.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item tableName
|
=item tableName
|
||||||
|
|
||||||
The name of the table you wish to retrieve the data from.
|
The name of the table you wish to retrieve the data from.
|
||||||
|
|
||||||
=item keyName
|
=item keyName
|
||||||
|
|
||||||
The name of the column that is the primary key in the table.
|
The name of the column that is the primary key in the table.
|
||||||
|
|
||||||
=item keyValue
|
=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,35 +392,31 @@ 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
|
||||||
|
|
||||||
A string indicating the table that contains the collateral data.
|
A string indicating the table that contains the collateral data.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
An integer that uniquely identifies this collateral data item.
|
An integer that uniquely identifies this collateral data item.
|
||||||
|
|
||||||
=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,35 +442,31 @@ 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
|
||||||
|
|
||||||
A string indicating the table that contains the collateral data.
|
A string indicating the table that contains the collateral data.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
An integer that uniquely identifies this collateral data item.
|
An integer that uniquely identifies this collateral data item.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
@ -488,21 +492,19 @@ sub moveCollateralUp {
|
||||||
|
|
||||||
=head2 new ( properties )
|
=head2 new ( properties )
|
||||||
|
|
||||||
Constructor.
|
Constructor.
|
||||||
|
|
||||||
NOTE: This method should never need to be overridden or extended.
|
NOTE: This method should never need to be overridden or extended.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item properties
|
=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 {
|
||||||
|
|
@ -535,18 +541,21 @@ sub processMacros {
|
||||||
|
|
||||||
=head2 processTemplate ( templateId, vars )
|
=head2 processTemplate ( templateId, vars )
|
||||||
|
|
||||||
Returns the content generated from this template.
|
Returns the content generated from this template.
|
||||||
|
|
||||||
NOTE: Only for use in wobjects that support templates.
|
NOTE: Only for use in wobjects that support templates.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item templateId
|
=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,10 +571,9 @@ 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.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -583,27 +591,27 @@ 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
|
||||||
|
|
||||||
The name of the table to resequence.
|
The name of the table to resequence.
|
||||||
|
|
||||||
=item keyName
|
=item keyName
|
||||||
|
|
||||||
The key column name used to determine which data needs sorting within the table.
|
The key column name used to determine which data needs sorting within the table.
|
||||||
|
|
||||||
=item setName
|
=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
|
||||||
|
|
||||||
|
|
@ -626,25 +634,23 @@ sub reorderCollateral {
|
||||||
|
|
||||||
=head2 set ( [ hashRef, arrayRef ] )
|
=head2 set ( [ hashRef, arrayRef ] )
|
||||||
|
|
||||||
Stores the values specified in hashRef to the database.
|
Stores the values specified in hashRef to the database.
|
||||||
|
|
||||||
NOTE: This method should be extended by all subclasses.
|
NOTE: This method should be extended by all subclasses.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item hashRef
|
=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,52 +704,39 @@ 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
|
||||||
|
|
||||||
The name of the table to insert the data.
|
The name of the table to insert the data.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
@ -843,7 +804,7 @@ sub uiLevel {
|
||||||
|
|
||||||
=head2 www_approvePost ( )
|
=head2 www_approvePost ( )
|
||||||
|
|
||||||
Sets the status flag on a discussion message to "approved".
|
Sets the status flag on a discussion message to "approved".
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -860,9 +821,9 @@ sub www_approvePost {
|
||||||
|
|
||||||
=head2 www_copy ( )
|
=head2 www_copy ( )
|
||||||
|
|
||||||
Copies this instance to the clipboard.
|
Copies this instance to the clipboard.
|
||||||
|
|
||||||
NOTE: Should never need to be overridden or extended.
|
NOTE: Should never need to be overridden or extended.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -879,7 +840,7 @@ sub www_copy {
|
||||||
|
|
||||||
=head2 www_cut ( )
|
=head2 www_cut ( )
|
||||||
|
|
||||||
Moves this instance to the clipboard.
|
Moves this instance to the clipboard.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -897,7 +858,7 @@ sub www_cut {
|
||||||
|
|
||||||
=head2 www_delete ( )
|
=head2 www_delete ( )
|
||||||
|
|
||||||
Prompts a user to confirm whether they wish to delete this instance.
|
Prompts a user to confirm whether they wish to delete this instance.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -925,7 +886,7 @@ sub www_delete {
|
||||||
|
|
||||||
=head2 www_deleteConfirm ( )
|
=head2 www_deleteConfirm ( )
|
||||||
|
|
||||||
Moves this instance to the trash.
|
Moves this instance to the trash.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -944,7 +905,7 @@ sub www_deleteConfirm {
|
||||||
|
|
||||||
=head2 www_deleteFile ( )
|
=head2 www_deleteFile ( )
|
||||||
|
|
||||||
Displays a confirmation message relating to the deletion of a file.
|
Displays a confirmation message relating to the deletion of a file.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -960,7 +921,7 @@ sub www_deleteFile {
|
||||||
|
|
||||||
=head2 www_deleteFileConfirm ( )
|
=head2 www_deleteFileConfirm ( )
|
||||||
|
|
||||||
Deletes a file from this instance.
|
Deletes a file from this instance.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
@ -991,7 +951,7 @@ sub www_deleteMessage {
|
||||||
|
|
||||||
=head2 www_deleteMessageConfirm ( )
|
=head2 www_deleteMessageConfirm ( )
|
||||||
|
|
||||||
Deletes a message from a discussion.
|
Deletes a message from a discussion.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1007,7 +967,7 @@ sub www_deleteMessageConfirm {
|
||||||
|
|
||||||
=head2 www_denyPost ( )
|
=head2 www_denyPost ( )
|
||||||
|
|
||||||
Sets the status flag on a discussion message to "denied".
|
Sets the status flag on a discussion message to "denied".
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1023,13 +983,17 @@ sub www_denyPost {
|
||||||
|
|
||||||
=head2 www_edit ( formRows )
|
=head2 www_edit ( formRows )
|
||||||
|
|
||||||
Displays the common properties of any/all wobjects.
|
Displays the common properties of any/all wobjects.
|
||||||
|
|
||||||
NOTE: This method should be extended by all wobjects.
|
NOTE: This method should be extended by all wobjects.
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
=item formRows
|
=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
|
||||||
|
|
||||||
|
|
@ -1097,9 +1061,9 @@ sub www_edit {
|
||||||
|
|
||||||
=head2 www_editSave ( )
|
=head2 www_editSave ( )
|
||||||
|
|
||||||
Saves the default properties of any/all wobjects.
|
Saves the default properties of any/all wobjects.
|
||||||
|
|
||||||
NOTE: This method should be extended by all subclasses.
|
NOTE: This method should be extended by all subclasses.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1137,7 +1101,7 @@ sub www_editSave {
|
||||||
|
|
||||||
=head2 www_lockThread ( )
|
=head2 www_lockThread ( )
|
||||||
|
|
||||||
Locks a discussion thread from the current message down.
|
Locks a discussion thread from the current message down.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1154,7 +1118,7 @@ sub www_lockThread {
|
||||||
|
|
||||||
=head2 www_moveBottom ( )
|
=head2 www_moveBottom ( )
|
||||||
|
|
||||||
Moves this instance to the bottom of the page.
|
Moves this instance to the bottom of the page.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1172,7 +1136,7 @@ sub www_moveBottom {
|
||||||
|
|
||||||
=head2 www_moveDown ( )
|
=head2 www_moveDown ( )
|
||||||
|
|
||||||
Moves this instance down one spot on the page.
|
Moves this instance down one spot on the page.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1197,7 +1161,7 @@ sub www_moveDown {
|
||||||
|
|
||||||
=head2 www_moveTop ( )
|
=head2 www_moveTop ( )
|
||||||
|
|
||||||
Moves this instance to the top of the page.
|
Moves this instance to the top of the page.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1215,7 +1179,7 @@ sub www_moveTop {
|
||||||
|
|
||||||
=head2 www_moveUp ( )
|
=head2 www_moveUp ( )
|
||||||
|
|
||||||
Moves this instance up one spot on the page.
|
Moves this instance up one spot on the page.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1240,7 +1204,7 @@ sub www_moveUp {
|
||||||
|
|
||||||
=head2 www_paste ( )
|
=head2 www_paste ( )
|
||||||
|
|
||||||
Moves this instance from the clipboard to the current page.
|
Moves this instance from the clipboard to the current page.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1260,7 +1224,7 @@ sub www_paste {
|
||||||
|
|
||||||
=head2 www_post ( )
|
=head2 www_post ( )
|
||||||
|
|
||||||
Displays a discussion message post form.
|
Displays a discussion message post form.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1276,7 +1240,7 @@ sub www_post {
|
||||||
|
|
||||||
=head2 www_post ( )
|
=head2 www_post ( )
|
||||||
|
|
||||||
Saves a message post to a discussion.
|
Saves a message post to a discussion.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1293,7 +1257,7 @@ sub www_postSave {
|
||||||
|
|
||||||
=head2 www_search ( )
|
=head2 www_search ( )
|
||||||
|
|
||||||
Searches an attached discussion.
|
Searches an attached discussion.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1305,12 +1269,15 @@ sub www_search {
|
||||||
|
|
||||||
=head2 www_showMessage ( [menuItem] )
|
=head2 www_showMessage ( [menuItem] )
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -1327,7 +1294,7 @@ sub www_showMessage {
|
||||||
|
|
||||||
=head2 www_unlockThread ( )
|
=head2 www_unlockThread ( )
|
||||||
|
|
||||||
Unlocks a discussion thread from the current message on down.
|
Unlocks a discussion thread from the current message on down.
|
||||||
|
|
||||||
=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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue