bugfix, missing labels
This commit is contained in:
parent
7dc63c1aa0
commit
ea8415f902
7 changed files with 41 additions and 11 deletions
|
|
@ -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"));
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 ] )
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue