text = $text; $this->IsDynamicallyRendered = TRUE; } /** * Override parent method to prevent use of children * @return void * @access public */ function addChild() { // Should we kick an error message here? } /** * Outputs the text Widget. * @return void * @access public */ function render() { echo ( htmlspecialchars($this->text, ENT_NOQUOTES) ); } } /** * Allows a tag to be created, which cannot contain children e.g. img * @see http://wact.sourceforge.net/index.php/TagWidget * @access public * @package WACT_COMPONENT */ class TagWidget extends TagComponent { /** * Name of the tag * @var string * @access private */ var $tag; /** * Whether the tag is closing or not * @var boolean * @access private */ var $closing = true; /** * Constructs TagWidget * @param string name of tag * @param boolean whether tag is closing * @access public */ function TagWidget($tag,$closing=true) { $this->tag = htmlspecialchars($tag,ENT_QUOTES); $this->closing = $closing; $this->IsDynamicallyRendered = TRUE; } /** * Override parent method to prevent use of children * @return void * @access public */ function addChild() { // Should we kick an error message here? } /** * Outputs the tag * @return void * @access public */ function render() { echo ( '<'.$this->tag ); echo ( $this->renderAttributes()); if ( $this->closing ) echo ( '/>' ); else echo ( '>' ); } } /** * Allows a tag to be created, which can contain children * @see http://wact.sourceforge.net/index.php/TagContainerWidget * @access public * @package WACT_COMPONENT */ class TagContainerWidget extends TagComponent { /** * Name of the tag * @var string * @access private */ var $tag; /** * Constructs TagContainerWidget * @param string name of tag * @param boolean whether tag is closing * @access public */ function TagContainerWidget($tag) { $this->tag = htmlspecialchars($tag, ENT_QUOTES); $this->IsDynamicallyRendered = TRUE; } /** * Outputs the tag, rendering any child components as well * @return void * @access public */ function render() { echo ( '<'.$this->tag ); echo ( $this->renderAttributes().'>'); parent :: render(); echo ( 'tag.'>' ); } } ?>