1 | <?php |
---|
2 | # ***** BEGIN LICENSE BLOCK ***** |
---|
3 | # Copyright (c) 2009 Olivier Azeau and contributors. All rights reserved. |
---|
4 | # |
---|
5 | # This is free software; you can redistribute it and/or modify |
---|
6 | # it under the terms of the GNU General Public License as published by |
---|
7 | # the Free Software Foundation; either version 2 of the License, or |
---|
8 | # (at your option) any later version. |
---|
9 | # |
---|
10 | # This is distributed in the hope that it will be useful, |
---|
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | # GNU General Public License for more details. |
---|
14 | # |
---|
15 | # You should have received a copy of the GNU General Public License |
---|
16 | # along with DotClear; if not, write to the Free Software |
---|
17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
18 | # |
---|
19 | # ***** END LICENSE BLOCK ***** |
---|
20 | |
---|
21 | class MyFormsTextField extends MyFormsField |
---|
22 | { |
---|
23 | public function __construct() { |
---|
24 | parent::__construct(func_get_args()); |
---|
25 | } |
---|
26 | |
---|
27 | public function Display() { |
---|
28 | return "<input type='text' ".$this->AttributesAsString()." value='".$this->ValueDisplay()."' />"; |
---|
29 | } |
---|
30 | |
---|
31 | public static function Register() { |
---|
32 | global $core; |
---|
33 | $core->tpl->addBlock('myformsTextField',array('MyFormsTextField','TplDisplay')); |
---|
34 | $core->tpl->addBlock('myformsTextField_Declare',array('MyFormsTextField','TplDeclare')); |
---|
35 | } |
---|
36 | |
---|
37 | // Display Field |
---|
38 | public static function TplDisplay($attr,$content) |
---|
39 | { |
---|
40 | return parent::DisplayObject(__CLASS__,$attr,$content); |
---|
41 | } |
---|
42 | |
---|
43 | // Declare Field |
---|
44 | public static function TplDeclare($attr,$content) |
---|
45 | { |
---|
46 | return parent::BuildDeclaration(__CLASS__,$attr,$content); |
---|
47 | } |
---|
48 | } |
---|
49 | |
---|
50 | MyFormsTextField::Register(); |
---|
51 | |
---|
52 | ?> |
---|