00001 <?php
00027 class htmlElements {
00028
00033 static $html_elements = array(
00034 'img' => array('text' => false),
00035 'p' => array('text' => true),
00036 'pre' => array('text' => true),
00037 'span' => array('text' => true),
00038 'div' => array('text' => true),
00039 'applet' => array('text' => false),
00040 'embed' => array('text' => false, 'media' => true),
00041 'object' => array('text' => false, 'media' => true),
00042 'area' => array('imagemap' => true),
00043 'b' => array('text' => true, 'non-emphasis' => true),
00044 'i' => array('text' => true, 'non-emphasis' => true),
00045 'font' => array('text' => true, 'font' => true),
00046 'h1' => array('text' => true, 'header' => true),
00047 'h2' => array('text' => true, 'header' => true),
00048 'h3' => array('text' => true, 'header' => true),
00049 'h4' => array('text' => true, 'header' => true),
00050 'h5' => array('text' => true, 'header' => true),
00051 'h6' => array('text' => true, 'header' => true),
00052 'ul' => array('text' => true, 'list' => true),
00053 'dl' => array('text' => true, 'list' => true),
00054 'ol' => array('text' => true, 'list' => true),
00055 'blockquote' => array('text' => true, 'quote' => true),
00056 'q' => array('text' => true, 'quote' => true),
00057 'acronym' => array('acronym' => true, 'text' => true),
00058 'abbr' => array('acronym' => true, 'text' => true),
00059 'input' => array('form' => true),
00060 'select' => array('form' => true),
00061 'textarea' => array('form' => true),
00062
00063 );
00064
00072 function getElementsByOption($option, $value = true) {
00073 foreach(self::$html_elements as $k => $element) {
00074 if(isset($element[$option]) && $element[$option] == $value)
00075 $results[] = $k;
00076 }
00077 return $results;
00078 }
00079 }