Ready for 7.10.29 development.
This commit is contained in:
commit
c806f99b7b
4236 changed files with 1217679 additions and 0 deletions
61
lib/WebGUI/Operation/FormHelpers.pm
Normal file
61
lib/WebGUI/Operation/FormHelpers.pm
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
package WebGUI::Operation::FormHelpers;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use Tie::IxHash;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::Asset::Wobject::Folder;
|
||||
use WebGUI::Form::Group;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::Pluggable;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::Utility;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Operation::FormHelpers
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Operational support for various things relating to forms and rich editors.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_formHelper ( session )
|
||||
|
||||
Calls a form helper. In the URL you must pass the form class name, the subroutine to call and any other
|
||||
parameters you wish the form helper to use. Here's an example:
|
||||
|
||||
/page?op=formHelper;class=File;sub=assetTree;param1=XXX
|
||||
|
||||
=cut
|
||||
|
||||
sub www_formHelper {
|
||||
my $session = shift;
|
||||
my $form = $session->form;
|
||||
my $class = "WebGUI::Form::".$form->get("class");
|
||||
my $sub = $form->get("sub");
|
||||
return "ERROR" unless (defined $sub && defined $class);
|
||||
my $output = eval { WebGUI::Pluggable::run($class, "www_".$sub, [$session]) };
|
||||
if ($@) {
|
||||
$session->errorHandler->error($@);
|
||||
return "ERROR";
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue