| 1 | ################################################################################### | ||
| 2 | # | ||
| 3 | # Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de | ||
| 4 | # Embperl - Copyright (c) 2008-2015 Gerald Richter | ||
| 5 | # Embperl - Copyright (c) 2015-2023 actevy.io | ||
| 6 | # | ||
| 7 | # You may distribute under the terms of either the GNU General Public | ||
| 8 | # License or the Artistic License, as specified in the Perl README file. | ||
| 9 | # | ||
| 10 | # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR | ||
| 11 | # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | ||
| 12 | # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
| 13 | # | ||
| 14 | # $Id$ | ||
| 15 | # | ||
| 16 | ################################################################################### | ||
| 17 | |||
| 18 | package Embperl::Form::Control::scriptcode ; | ||
| 19 | |||
| 20 | use strict ; | ||
| 21 | use base 'Embperl::Form::Control' ; | ||
| 22 | |||
| 23 | use Embperl::Inline ; | ||
| 24 | |||
| 25 | sub noframe { return 1; } | ||
| 26 | |||
| 27 | # --------------------------------------------------------------------------- | ||
| 28 | # | ||
| 29 | # is_hidden - returns true if this is a hidden control | ||
| 30 | # | ||
| 31 | |||
| 32 | sub is_hidden | ||
| 33 | |||
| 34 | { | ||
| 35 | my ($self, $req) = @_ ; | ||
| 36 | |||
| 37 | return 1 ; | ||
| 38 | } | ||
| 39 | |||
| 40 | |||
| 41 | |||
| 42 | 1 ; | ||
| 43 | |||
| 44 | __EMBPERL__ | ||
| 45 | |||
| 46 | [# --------------------------------------------------------------------------- | ||
| 47 | # | ||
| 48 | # show_control - output the control | ||
| 49 | #] | ||
| 50 | |||
| 51 | [$ sub show ($self, $req) | ||
| 52 | |||
| 53 | my $name = $self -> {name}; | ||
| 54 | my $type = $self -> {scripttype} || 'text/javascript' ; | ||
| 55 | |||
| 56 | $] | ||
| 57 | <script type="[+ $type +]"> | ||
| 58 | //<!-- | ||
| 59 | [+ do { local $escmode = 0 ; $self -> {code} } +] | ||
| 60 | //--> | ||
| 61 | </script> | ||
| 62 | [$endsub$] | ||
| 63 | |||
| 64 | __END__ |