- fix [ 1274951 ] Unable to drag rank in asset manager
- fix [ 1276449 ] 6.7.1 content invisible after edit by content manager - Fixed a few bugs in the new form system related to UI levels and hidden fields.
This commit is contained in:
parent
97161c798e
commit
c687487df1
10 changed files with 208 additions and 171 deletions
|
|
@ -76,87 +76,6 @@ sub AUTOLOAD {
|
|||
return $class->new(@params)->toHtml;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _fixMacros {
|
||||
my $value = shift;
|
||||
$value =~ s/\^/\&\#94\;/g;
|
||||
return $value;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _fixQuotes {
|
||||
my $value = shift;
|
||||
$value =~ s/\"/\"\;/g;
|
||||
return $value;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _fixSpecialCharacters {
|
||||
my $value = shift;
|
||||
$value =~ s/\&/\&\;/g;
|
||||
return $value;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _fixTags {
|
||||
my $value = shift;
|
||||
$value =~ s/\</\<\;/g;
|
||||
$value =~ s/\>/\>\;/g;
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 dynamicField ( fieldType , hashRef )
|
||||
|
||||
Returns a dynamic configurable field.
|
||||
|
||||
=head3 fieldType
|
||||
|
||||
The field type to use. The field name is the name of the method from this forms package.
|
||||
|
||||
=head3 options
|
||||
|
||||
The field options. See the documentation for the desired field for more information.
|
||||
|
||||
=cut
|
||||
|
||||
sub dynamicField {
|
||||
my $fieldType = ucfirst(shift);
|
||||
my $param = shift;
|
||||
|
||||
# Set options for fields that use a list.
|
||||
if (isIn($fieldType,qw(SelectList CheckList RadioList))) {
|
||||
delete $param->{size};
|
||||
my %options;
|
||||
tie %options, 'Tie::IxHash';
|
||||
foreach (split(/\n/, $param->{possibleValues})) {
|
||||
s/\s+$//; # remove trailing spaces
|
||||
$options{$_} = $_;
|
||||
}
|
||||
if (exists $param->{options} && ref($param->{options}) eq "HASH") {
|
||||
%options = (%{$param->{options}} , %options);
|
||||
}
|
||||
$param->{options} = \%options;
|
||||
}
|
||||
# Convert value to list for selectList / checkList
|
||||
if (isIn($fieldType,qw(SelectList CheckList)) && ref $param->{value} ne "ARRAY") {
|
||||
my @defaultValues;
|
||||
foreach (split(/\n/, $param->{value})) {
|
||||
s/\s+$//; # remove trailing spaces
|
||||
push(@defaultValues, $_);
|
||||
}
|
||||
$param->{value} = \@defaultValues;
|
||||
}
|
||||
|
||||
# Return the appropriate field.
|
||||
no strict 'refs';
|
||||
return &$fieldType($param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue