################################################################################### # # Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de # Embperl - Copyright (c) 2008-2014 Gerald Richter # # You may distribute under the terms of either the GNU General Public # License or the Artistic License, as specified in the Perl README file. # # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # $Id$ # ################################################################################### package Embperl::Form::Control::displaylink ; use strict ; use base 'Embperl::Form::Control' ; use Embperl::Inline ; # --------------------------------------------------------------------------- # # show_control_readonly - output readonly control # sub show_control_readonly { my ($self, $req) = @_ ; $self -> show_control ($req) ; } 1 ; __EMBPERL__ [# --------------------------------------------------------------------------- # # show_control - output the control #] [$ sub show_control ($self, $req) my $name = $self->{name}; my $hrefs = $self -> {href} ; my $targets = $self -> {target} ; my $opens = $self -> {open} ; my $displays = $self -> {link} || $self -> {value} ; my $form = $self -> form ; my $showoptions = $self -> {showoptions} ; my $state = $self -> {state} ; $hrefs = [$hrefs] if (!ref $hrefs) ; $targets = [$targets] if ($targets && !ref $targets) ; $opens = [$opens] if ($opens && !ref $opens) ; $displays = [$displays] if (!ref $displays) ; @hrefs = map { my $x = $_ ; $x =~ s/%%%name%%%/$epreq->Escape ($fdat{$name},6)/eg ; $x =~ s/%%(.+?)%%/$epreq->Escape ($fdat{$1}, 6)/eg ; $x } ref ($hrefs)?@$hrefs:($hrefs) ; @opens = map { my $x = $_ ; $x =~ s/%%%name%%%/$epreq->Escape ($fdat{$name},6)/eg ; $x =~ s/%%(.+?)%%/$epreq->Escape ($fdat{$1}, 6)/eg ; $x } ref ($opens)?@$opens:($opens) ; @displays = map { my $x = $_ ; $x =~ s/%%%name%%%/$fdat{$name}/g ; $x =~ s/%%(.+?)%%/$fdat{$1}/eg ; $x } @$displays ; my $dispn = 0 ; $]