diff --git a/lib/WebGUI/Asset/Shortcut.pm b/lib/WebGUI/Asset/Shortcut.pm index 283e1db6f..931814d62 100644 --- a/lib/WebGUI/Asset/Shortcut.pm +++ b/lib/WebGUI/Asset/Shortcut.pm @@ -601,7 +601,7 @@ sub view { my %var = ( isShortcut => 1, 'shortcut.content' => $content, - 'shortcut.label' => WebGUI::International::get('3',"Asset_Shortcut"), + 'shortcut.label' => WebGUI::International::get('assetName',"Asset_Shortcut"), originalURL => $shortcut->getUrl ); return $self->processTemplate(\%var,$self->getValue("templateId")); diff --git a/lib/WebGUI/Asset/Wobject/EventsCalendar.pm b/lib/WebGUI/Asset/Wobject/EventsCalendar.pm index 330155b7b..529fd0508 100644 --- a/lib/WebGUI/Asset/Wobject/EventsCalendar.pm +++ b/lib/WebGUI/Asset/Wobject/EventsCalendar.pm @@ -117,7 +117,7 @@ sub getEditForm { $tabform->getTab("display")->selectBox( -name=>"startMonth", -options=>{ - "january"=>WebGUI::International::get('january','Asset_EventsCalendar'), + "january"=>WebGUI::International::get('january','DateTime'), "now"=>WebGUI::International::get(98,"Asset_EventsCalendar"), "current"=>WebGUI::International::get(82,"Asset_EventsCalendar"), "first"=>WebGUI::International::get(83,"Asset_EventsCalendar") diff --git a/lib/WebGUI/Form/DynamicField.pm b/lib/WebGUI/Form/DynamicField.pm index 28674bcfb..b6f9f76e7 100644 --- a/lib/WebGUI/Form/DynamicField.pm +++ b/lib/WebGUI/Form/DynamicField.pm @@ -111,9 +111,10 @@ sub new { } my $formObj = $cmd->new($param); ##Fix up methods for List type forms and restore the size to all Forms *except* - ##List type forms + ##List type forms. Historically, dynamically created forms have always + ##used the default size. if ($formObj->isa('WebGUI::Form::List')) { - $formObj->correctValues($param->{value}); + $formObj->correctValues(); $formObj->correctOptions($param->{possibleValues}); } elsif ($size) { diff --git a/lib/WebGUI/Form/List.pm b/lib/WebGUI/Form/List.pm index 987a2b81a..531e4b30d 100644 --- a/lib/WebGUI/Form/List.pm +++ b/lib/WebGUI/Form/List.pm @@ -91,8 +91,8 @@ method. =cut sub correctValues { - my ($self, $value) = @_; - return unless defined $value; + my ($self) = @_; + return unless defined $self->{value}; my @defaultValues; foreach (split(/\n/, $self->{value})) { s/\s+$//; # remove trailing spaces @@ -185,7 +185,8 @@ sub displayValue { =head2 getValues ( ) -Handle returning an array regardless of whether the form values are a scalar or array. +Safely handle returning values whether the stored data is scalar or an array +ref. =cut diff --git a/lib/WebGUI/Form/SelectBox.pm b/lib/WebGUI/Form/SelectBox.pm index 2c0a7c0cc..69b75ee49 100644 --- a/lib/WebGUI/Form/SelectBox.pm +++ b/lib/WebGUI/Form/SelectBox.pm @@ -37,6 +37,16 @@ The following methods are specifically available from this class. Check the supe =cut +##------------------------------------------------------------------- + +=head2 correctValues ( ) + +Override method from master class since SelectBox only support a single value + +=cut + +sub correctValues { } + #------------------------------------------------------------------- =head2 definition ( [ additionalTerms ] ) diff --git a/lib/WebGUI/Form/Template.pm b/lib/WebGUI/Form/Template.pm index 0c728854b..c65bf6112 100644 --- a/lib/WebGUI/Form/Template.pm +++ b/lib/WebGUI/Form/Template.pm @@ -88,7 +88,7 @@ sub definition { =head2 toHtml ( ) -Renders a database connection picker control. +Renders a template picker control. =cut @@ -103,6 +103,7 @@ sub toHtml { } } $self->{options} = $templateList; + $self->setManageIcons(); return $self->SUPER::toHtml(); } @@ -115,6 +116,21 @@ Renders the form field to HTML as a table row complete with labels, subtext, hov =cut sub toHtmlWithWrapper { + my $self = shift; + $self->setManageIcons(); + return $self->SUPER::toHtmlWithWrapper; +} + +#------------------------------------------------------------------- + +=head2 setManageIcons ( ) + +Adds code to the extras field of the form so that buttons for managing or +editing the template show up if the user is allowed to do that. + +=cut + +sub setManageIcons { my $self = shift; my $template = WebGUI::Asset::Template->new($self->{value}); if (defined $template && $template->canEdit) { @@ -126,9 +142,6 @@ sub toHtmlWithWrapper { $buttons .= manageIcon("func=manageAssets",$template->getParent->get("url")); $self->{subtext} = $buttons . $self->{subtext}; } - return $self->SUPER::toHtmlWithWrapper; } - 1; - diff --git a/lib/WebGUI/i18n/English/Asset_EventsCalendar.pm b/lib/WebGUI/i18n/English/Asset_EventsCalendar.pm index 9dfcc09f0..bc2e03836 100644 --- a/lib/WebGUI/i18n/English/Asset_EventsCalendar.pm +++ b/lib/WebGUI/i18n/English/Asset_EventsCalendar.pm @@ -2,6 +2,11 @@ package WebGUI::i18n::English::Asset_EventsCalendar; our $I18N = { + 'january' => { + message => q|January|, + lastUpdated => 1133711787 + }, + '61' => { message => q|Events Calendar, Add/Edit|, lastUpdated => 1066572488