cvs: pear /HTML_QuickForm QuickForm.php /HTML_QuickForm/QuickForm static.php
| From: | Bertrand Mansion | Date: | Sat, 01 Feb 2003 18:32:38 +0000 |
| Subject: | cvs: pear /HTML_QuickForm QuickForm.php /HTML_QuickForm/QuickForm static.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-8645@lists.php.net to get a copy of this message | ||
mansion Sat Feb 1 13:32:38 2003 EDT
Added files:
/pear/HTML_QuickForm/QuickForm static.php
Modified files:
/pear/HTML_QuickForm QuickForm.php
Log:
Add static element written by Wojciech Gdela.
Use this to add static text instead of a form element.
Index: pear/HTML_QuickForm/QuickForm.php
diff -u pear/HTML_QuickForm/QuickForm.php:1.53 pear/HTML_QuickForm/QuickForm.php:1.54
--- pear/HTML_QuickForm/QuickForm.php:1.53 Sat Feb 1 12:56:14 2003
+++ pear/HTML_QuickForm/QuickForm.php Sat Feb 1 13:32:37 2003
@@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
-// $Id: QuickForm.php,v 1.53 2003/02/01 17:56:14 mansion Exp $
+// $Id: QuickForm.php,v 1.54 2003/02/01 18:32:37 mansion Exp $
require_once('PEAR.php');
require_once('HTML/Common.php');
@@ -40,7 +40,8 @@
'textarea'
=>array('HTML/QuickForm/textarea.php','HTML_QuickForm_textarea'),
'link'
=>array('HTML/QuickForm/link.php','HTML_QuickForm_link'),
'advcheckbox'
=>array('HTML/QuickForm/advcheckbox.php','HTML_QuickForm_advcheckbox'),
- 'date'
=>array('HTML/QuickForm/date.php','HTML_QuickForm_date')
+ 'date'
=>array('HTML/QuickForm/date.php','HTML_QuickForm_date'),
+ 'static'
=>array('HTML/QuickForm/static.php','HTML_QuickForm_static')
);
// {{{ error codes
@@ -1429,7 +1430,7 @@
} // end func getRequiredNote
// }}}
- // {{{ _findValue()
+ // {{{ _findElementValue()
/**
* Tries to find the element value from the submitted values array
Index: pear/HTML_QuickForm/QuickForm/static.php
+++ pear/HTML_QuickForm/QuickForm/static.php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt.
|
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: static.php,v 1.1 2003/02/01 18:32:37 mansion Exp $
require_once("HTML/QuickForm/element.php");
/**
* HTML class for static data
*
* @author Wojciech Gdela <eltehaem@poczta.onet.pl>
* @access public
*/
class HTML_QuickForm_static extends HTML_QuickForm_element {
// {{{ properties
/**
* Display text
* @var string
* @access private
*/
var $_text = null;
// }}}
// {{{ constructor
/**
* Class constructor
*
* @param string $elementLabel (optional)Label
* @param string $text (optional)Display text
* @access public
* @return void
*/
function HTML_QuickForm_static($elementName=null, $elementLabel=null, $text=null)
{
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel);
$this->_persistantFreeze = false;
$this->_type = 'static';
$this->_text = $text;
} //end constructor
// }}}
// {{{ setName()
/**
* Sets the element name
*
* @param string $name Element name
* @access public
* @return void
*/
function setName($name)
{
$this->updateAttributes(array('name'=>$name));
} //end func setName
// }}}
// {{{ getName()
/**
* Returns the element name
*
* @access public
* @return string
*/
function getName()
{
return $this->getAttribute('name');
} //end func getName
// }}}
// {{{ setText()
/**
* Sets the text
*
* @param string $text
* @access public
* @return void
*/
function setText($text)
{
$this->_text = $text;
} // end func setText
// }}}
// {{{ toHtml()
/**
* Returns the static text element in HTML
*
* @access public
* @return string
*/
function toHtml()
{
$tabs = $this->_getTabs();
$html = $tabs.$this->_text;
return $html;
} //end func toHtml
// }}}
// {{{ getFrozenHtml()
/**
* Returns the value of field without HTML tags
*
* @access public
* @return string
*/
function getFrozenHtml()
{
return $this->toHtml();
} //end func getFrozenHtml
// }}}
} //end class HTML_QuickForm_static
?>