--- nfo/php/libs/com.newsblob.phphtmllib/HTMLTagClass.inc 2003/02/22 20:55:24 1.2 +++ nfo/php/libs/com.newsblob.phphtmllib/HTMLTagClass.inc 2004/05/06 16:23:38 1.4 @@ -3,7 +3,7 @@ /** * Holds the HTMLTagClass * - * $Id: HTMLTagClass.inc,v 1.2 2003/02/22 20:55:24 jonen Exp $ + * $Id: HTMLTagClass.inc,v 1.4 2004/05/06 16:23:38 jonen Exp $ * * @author Walter A. Boring IV * @package phpHtmlLib @@ -46,7 +46,7 @@ /** * The list of attributes not to render - * if HTML_RENDER_TYPE is "XHTML STRICT" + * if $GLOBALS["HTML_RENDER_TYPE"] is "XHTML STRICT" * * We comment this declaration out * to save memory, since only a small @@ -74,6 +74,9 @@ /** * Class Constructor + * + * {@source } + * * @param array - Associative array of * name="value" pairs of * tag atributes. @@ -83,8 +86,6 @@ * of parameters that will * be added to the content * of the tag automatically. - * - * @access public */ function HTMLTagClass( $attributes=NULL ) { if ( $attributes ) { @@ -105,8 +106,8 @@ //this is a magic test. It assumes that //someone has created the define for //HTML_RENDER_TYPE - if ( HTML_RENDER_TYPE == XHTML || - HTML_RENDER_TYPE == XHTML_STRICT ) { + if ( $GLOBALS["HTML_RENDER_TYPE"] == XHTML || + $GLOBALS["HTML_RENDER_TYPE"] == XHTML_STRICT ) { $this->_flags |= _XHTMLCOMPLIANT; } @@ -121,9 +122,12 @@ /** * Renders the tag, attributes, content and close tag. + * + * {@source } + * * @param int $indent_level the indentation level for this tag. + * @param boolean output in html viewable mode * @return string - * @access public */ function render($indent_level=NULL, $output_debug=0) { @@ -155,8 +159,11 @@ * This function is a shorthand helper * to setting the style attribute on a * tag. + * + * {@source } * * @param string - the style value. + * @return none */ function set_style( $value ) { $this->set_tag_attribute("style", $value); @@ -166,8 +173,11 @@ * This function is a shorthand helper * to setting the class attribute on a * tag. + * + * {@source } * * @param string - the class value. + * @return none */ function set_class( $value ) { $this->set_tag_attribute("class", $value); @@ -177,8 +187,11 @@ * This function is a shorthand helper * to setting the id attribute on a * tag. + * + * {@source } * * @param string - the class value. + * @return none */ function set_id( $value ) { $this->set_tag_attribute("id", $value); @@ -191,9 +204,12 @@ /** * renders the open tag. is - * @param int $indent_level the indentation level for this tag. - * @return string - * @access private + * + * {@source } + * @access private + * + * @param int the indentation level for this tag. + * @return string */ function _render_tag($indent_level, $output_debug=0) { if ( $output_debug ) { @@ -207,9 +223,12 @@ /** * Renders all of the content. * Content can be raw strings, or tag objects. - * @param int $indent_level the indentation level for this tag. + * + * {@source } + * @access private + * + * @param int the indentation level for this tag. * @return string - * @access private */ function _render_content($indent_level, $output_debug=0) { if ( $output_debug ) { @@ -221,9 +240,12 @@ /** * Renders the close tag (if needed) - * @param int $indent_level the indentation level for this tag. - * @return string - * @access private + * + * {@source } + * @access private + * + * @param int the indentation level for this tag. + * @return string */ function _render_close_tag($indent_level, $output_debug=0) { if ( $output_debug ) { @@ -240,13 +262,19 @@ * so we can override this by the child * tag, so it can add a link on content or * one of the attributes. + * + * {@source } + * @access private + * + * @param int the indentation level + * @return string */ function _render_tag_debug($indent_level) { $indent = $this->_render_indent($indent_level, TRUE); - $tag_prefix = htmlspecialchars( ($this->_tag_prefix ? $this->_tag_prefix : _TAG_PREFIX)); - $tab_postfix = htmlspecialchars( ($this->_tag_postfix ? $this->_tag_postfix : _TAG_SUFFIX)); + $tag_prefix = htmlspecialchars( (@$this->_tag_prefix ? $this->_tag_prefix : _TAG_PREFIX)); + $tab_postfix = htmlspecialchars( (@$this->_tag_postfix ? $this->_tag_postfix : _TAG_SUFFIX)); $str = $indent . $tag_prefix. ""; $str .= $this->_tag . ""; @@ -286,9 +314,12 @@ * so it acts like view source. * * Content can be raw strings, or tag objects. - * @param int $indent_level the indentation level for this tag. - * @return string - * @access private + * + * {@source } + * @access private + * + * @param int the indentation level for this tag. + * @return string */ function _render_content_debug($indent_level) { @@ -334,9 +365,12 @@ /** * this renders the close tag in debugging mode. - * @param int $indent_level the indentation level for this tag. - * @return string - * @access private + * + * {@source } + * @access private + * + * @param int the indentation level for this tag. + * @return string */ function _render_close_tag_debug( $indent_level ) { @@ -370,6 +404,9 @@ * that shouldn't be rendered if they * are in the $this->_xhtml_strict_attributes * array and HTML_RENDER_TYPE = XHTML STRICT + * + * {@source } + * @access private * * @param string - $name attribute name * @param mixed - $value attribute value @@ -396,24 +433,30 @@ } } - if ( HTML_RENDER_TYPE == XHTML_STRICT && + if ( $GLOBALS["HTML_RENDER_TYPE"] == XHTML_STRICT && @in_array($name, $this->_xhtml_strict_attributes) ) { $returnval = NULL; } } else { //hack to make non name-value pair work. //ie