Dotclear

source: plugins/myForms/trunk/fields/TextField.php @ 2207

Revision 2207, 1.6 KB checked in by Oaz, 14 years ago (diff)

Unstable commit. Plugin under refactoring. Added Field classes hierarchy. Added Combo field. Added tests suite.

Line 
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
21class MyFormsTextField extends MyFormsField
22{
23  private $choices;
24 
25  public function __construct() {
26    parent::__construct(func_get_args());
27  }
28 
29  public function Display() {
30    return "<input type='text' ".$this->AttributesAsString()." value='".$this->ValueDisplay()."' />";
31  }
32 
33  public static function Register() {
34    global $core;
35    $core->tpl->addBlock('myformsTextField',array('MyFormsTextField','TplDisplay'));
36    $core->tpl->addBlock('myformsTextField_Declare',array('MyFormsTextField','TplDeclare'));
37  }
38 
39  // Display Field
40  public static function TplDisplay($attr,$content)
41  {
42    return parent::DisplayObject(__CLASS__,$attr,$content);
43  }
44 
45  // Declare Field
46  public static function TplDeclare($attr,$content)
47  {
48    return parent::BuildDeclaration(__CLASS__,$attr,$content);
49  }
50}
51?>
Note: See TracBrowser for help on using the repository browser.

Sites map