$value) { if (in_array($key, array("id", "class", "title", "style", "bgcolor", "frame", "rules", "border", "cellspacing", "cellpadding", "summary", "align", "width")) ) { $table->setAttr($key, $value); } } } foreach ($lines as $line) { if (substr($line, 0, 1) == "-") { if (isset($row)) { if (isset($cell)) { if (isset($content)) { if (is_numeric(trim($content))) { $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); } else { $cell->pushContent(TransformText($content, $markup, $basepage)); } unset($content); } $row->pushContent($cell); unset($cell); } $table->pushContent($row); } $row = HTML::tr(); $attrs = parse_attributes(substr($line, 1)); foreach ($attrs as $key => $value) { if (in_array($key, array("id", "class", "title", "style", "bgcolor", "align", "valign")) ) { $row->setAttr($key, $value); } } continue; } if (substr($line, 0, 1) == "|" and isset($row)) { if (isset($cell)) { if (isset ($content)) { if (is_numeric(trim($content))) { $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); } else { $cell->pushContent(TransformText($content, $markup, $basepage)); } unset($content); } $row->pushContent($cell); } $cell = HTML::td(); $line = substr($line, 1); if ($line[0] == "*") { $attrs = parse_attributes(substr($line, 1)); foreach ($attrs as $key => $value) { if (in_array($key, array("id", "class", "title", "style", "colspan", "rowspan", "width", "height", "bgcolor", "align", "valign")) ) { $cell->setAttr($key, $value); } } continue; } } if (isset($row) and isset($cell)) { $line = str_replace("?\>", "?>", $line); $line = str_replace("\~", "~", $line); if (empty($content)) $content = ''; $content .= $line . "\n"; } } if (isset($row)) { if (isset($cell)) { if (isset($content)) { if (is_numeric(trim($content))) { $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); } else { $cell->pushContent(TransformText($content, $markup, $basepage)); } } $row->pushContent($cell); } $table->pushContent($row); } return $table; } } // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: