| 3634 |
} // function DebugOutput |
} // function DebugOutput |
| 3635 |
|
|
| 3636 |
} //class ends here |
} //class ends here |
| 3637 |
|
|
| 3638 |
|
class mosHtmlHelper { |
| 3639 |
|
var $_docTypes = array( |
| 3640 |
|
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">', |
| 3641 |
|
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">', |
| 3642 |
|
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">', |
| 3643 |
|
'xhtml-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', |
| 3644 |
|
'xhtml-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', |
| 3645 |
|
'xhtml-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">', |
| 3646 |
|
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' |
| 3647 |
|
); |
| 3648 |
|
var $_docTypesText = array( |
| 3649 |
|
'html4-strict' => 'HTML 4.01 Strict', |
| 3650 |
|
'html4-trans' => 'HTML 4.01 Transitional', |
| 3651 |
|
'html4-frame' => 'HTML 4.01 Frameset', |
| 3652 |
|
'xhtml-strict' => 'XHTML 1.0 Strict', |
| 3653 |
|
'xhtml-trans' => 'XHTML 1.0 Transitional', |
| 3654 |
|
'xhtml-frame' => 'XHTML 1.0 Frameset', |
| 3655 |
|
'xhtml11' => 'XHTML 1.1' |
| 3656 |
|
); |
| 3657 |
|
var $doctype = 'xhtml-trans'; |
| 3658 |
|
|
| 3659 |
|
/** |
| 3660 |
|
* Singleton accessor |
| 3661 |
|
*/ |
| 3662 |
|
function &getInstance () { |
| 3663 |
|
static $instance; |
| 3664 |
|
if (!is_object($instance)) $instance = new mosHtmlHelper(); |
| 3665 |
|
return $instance; |
| 3666 |
|
} |
| 3667 |
|
function __docType($type=null) { |
| 3668 |
|
static $obj; |
| 3669 |
|
if (!is_object($obj)) $obj =& mosHtmlHelper::getInstance(); |
| 3670 |
|
|
| 3671 |
|
if (array_key_exists($type, $obj->_docTypes)) return $obj->_docTypes[$type]; |
| 3672 |
|
return $obj->_docTypes[$obj->doctype]; |
| 3673 |
|
} |
| 3674 |
|
function renderDocType($type=null) { |
| 3675 |
|
static $obj; |
| 3676 |
|
if (!is_object($obj)) $obj =& mosHtmlHelper::getInstance(); |
| 3677 |
|
|
| 3678 |
|
echo $obj->__docType($type)."\n"; |
| 3679 |
|
} |
| 3680 |
|
function get($var) { |
| 3681 |
|
static $obj; |
| 3682 |
|
if (!is_object($obj)) $obj =& mosHtmlHelper::getInstance(); |
| 3683 |
|
|
| 3684 |
|
if(isset($obj->$var)) return $obj->$var; |
| 3685 |
|
return null; |
| 3686 |
|
} |
| 3687 |
|
function set($property, $value) { |
| 3688 |
|
static $obj; |
| 3689 |
|
if (!is_object($obj)) $obj =& mosHtmlHelper::getInstance(); |
| 3690 |
|
|
| 3691 |
|
if($property{0} == '_') return; // dont set private properties |
| 3692 |
|
if (isset($obj->$property)) $obj->$property = $value; |
| 3693 |
|
} |
| 3694 |
|
} // end class mosHtmlHelper |
| 3695 |
?> |
?> |