a ton of $session fixes (thanks to Colin), and a new $session checker, that supposedly, shouldn't be needed now. It can be backed out, however, easily.

This commit is contained in:
Matthew Wilson 2006-01-16 22:45:21 +00:00
parent 5fadc70eac
commit 09483e18c5
208 changed files with 505 additions and 533 deletions

View file

@ -65,7 +65,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session, "Asset");
push(@{$definition}, {

View file

@ -54,7 +54,7 @@ The default text to appear on the button. Defaults to an internationalized versi
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session,"WebGUI");
push(@{$definition}, {

View file

@ -58,7 +58,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -61,7 +61,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -55,7 +55,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -46,7 +46,7 @@ See the super class for additional details.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -56,7 +56,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -62,7 +62,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -35,7 +35,7 @@ Base class for all form field objects. Never use this class directly.
Subclasses will look like this:
use WebGUI::Form::subclass;
my $obj = WebGUI::Form::subclass->new(%params);
my $obj = WebGUI::Form::subclass->new($session,%params);
my $html = $obj->toHtml;
my $html = $obj->toHtmlAsHidden;
@ -149,7 +149,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
push(@{$definition}, {
formName=>{
@ -304,7 +304,7 @@ Returns a human readable name for this form control type. You MUST override this
sub getName {
my $self = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = $self->definition($session);
return $definition->[0]->{formName}->{defaultValue};
}
@ -397,6 +397,7 @@ Retrieves a value from a form GET or POST and returns it. If the value comes bac
sub getValueFromPost {
my $self = shift;
$self->session->errorHandler->warn("trying to get ".$self->get("name"));
my $formValue = $self->session->request->param($self->get("name"));
if (defined $formValue) {
return $formValue;
@ -430,7 +431,7 @@ Please note that an id attribute is automatically added to every form element wi
sub new {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my %raw;
# deal with a hash reference full of properties
if (ref $_[0] eq "HASH") {

View file

@ -71,7 +71,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -72,7 +72,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
@ -170,7 +170,7 @@ Renders the form field to HTML as a hidden field rather than whatever field type
sub toHtmlAsHidden {
my $self = shift;
return WebGUI::Form::Hidden->new(
return WebGUI::Form::Hidden->new($self->session,
name=>$self->get("name"),
value=>$self->session->datetime->epochToSet($self->get("value"))
)->toHtmlAsHidden;

View file

@ -67,7 +67,7 @@ If no value is specified, this will be used. Defaults to today and now.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -55,7 +55,7 @@ Defaults to "Text". Should be any valid field type.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
@ -97,7 +97,7 @@ array will be used.
sub new {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my %raw = @_;
my $param = \%raw;
my $fieldType = ucfirst($param->{fieldType});

View file

@ -54,7 +54,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -60,7 +60,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
@ -90,7 +90,7 @@ and DynamicField, the form class dispatcher.
sub getTypes {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
opendir(DIR,$session->config->getWebguiRoot."/lib/WebGUI/Form/");
my @rawTypes = readdir(DIR);
closedir(DIR);

View file

@ -63,7 +63,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
@ -106,7 +106,7 @@ sub displayForm {
my $action = join '_', '_', $self->get("name"), 'delete';
$fileForm .= $i18n->get(392)
. "&nbsp"x4
. WebGUI::Form::YesNo->new({-name=>$action, -value=>0})->toHtml;
. WebGUI::Form::YesNo->new($self->session,{-name=>$action, -value=>0})->toHtml;
}
my $hid = $self->toHtmlAsHidden();
$fileForm .= $hid;

View file

@ -63,7 +63,7 @@ A tooltip for what to do with this field. Defaults to a general explaination of
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -66,7 +66,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -71,7 +71,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -69,7 +69,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
@ -118,9 +118,9 @@ sub toHtml {
my $self = shift;
$self->session->style->setScript($self->session->config->get("extrasURL").'/textFix.js',{ type=>'text/javascript' });
$self->get("extras") .= ' onblur="fixChars(this.form.'.$self->get("name").')" mce_editable="true" ';
return $self->SUPER::toHtml.WebGUI::Asset::RichEdit->new($self->get("richEditId"))->getRichEditor($self->get('id'));
return $self->SUPER::toHtml.WebGUI::Asset::RichEdit->new($self->session,$self->get("richEditId"))->getRichEditor($self->get('id'));
my $i18n = WebGUI::International->new($self->session);
my $richEdit = WebGUI::Asset::RichEdit->new($self->get("richEditId"));
my $richEdit = WebGUI::Asset::RichEdit->new($self->session,$self->get("richEditId"));
if (defined $richEdit) {
return $self->SUPER::toHtml.$richEdit->getRichEditor($self->get('id'));
} else {

View file

@ -54,7 +54,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -62,7 +62,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -64,7 +64,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -66,7 +66,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -63,7 +63,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -75,7 +75,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -145,7 +145,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -62,7 +62,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -54,7 +54,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -58,7 +58,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -70,7 +70,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -55,7 +55,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -68,7 +68,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -62,7 +62,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -46,7 +46,7 @@ See the super class for additional details.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -63,7 +63,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session, 'Asset_Template');
push(@{$definition}, {
@ -131,7 +131,7 @@ editing the template show up if the user is allowed to do that.
sub setManageIcons {
my $self = shift;
my $template = WebGUI::Asset::Template->new($self->get('value'));
my $template = WebGUI::Asset::Template->new($self->session,$self->get('value'));
if (defined $template && $template->canEdit) {
my $returnUrl;
if (defined $self->session->asset && ref $self->session->asset eq "WebGUI::Asset::Template") {

View file

@ -62,7 +62,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -66,7 +66,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -64,7 +64,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
@ -113,6 +113,7 @@ sub toHtml {
$self->get("extras") .= ' onkeyup="doInputCheck(this.form.'.$self->get("name").',\'0123456789:\')"';
return $self->SUPER::toHtml
.WebGUI::Form::Button->new(
$self->session,
id=>$self->get('id'),
extras=>'style="font-size: 8pt;" onclick="window.timeField = this.form.'.$self->get("name").';clockSet = window.open(\''.$self->session->config->get("extrasURL"). '/timeChooser.html\',\'timeChooser\',\'WIDTH=230,HEIGHT=100\');return false"',
value=>$i18n->get(970)

View file

@ -46,7 +46,7 @@ See the super class for additional details.
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -58,7 +58,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -58,7 +58,7 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -59,7 +59,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {

View file

@ -58,7 +58,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
my $session = shift;
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
my $definition = shift || [];
my $i18n = WebGUI::International->new($session);
push(@{$definition}, {