$page_name\n"; print "
\n"; print $page_content; print "
\n"; } ###################################################################################################### print sections of an xml page # parameters: 1) array of sections to print # returns: the html for the sections function html_print_sections(&$sections) { $page_content = ''; foreach($sections as $sec) { $page_content .= "
\n"; $page_content .= "
{$sec['name']}
\n"; $page_content .= "
\n"; $paras = xml_force_array($sec['text']['para']); $page_content .= html_print_paragraphs($paras); $page_content .= "
\n"; $page_content .= "
\n"; } return $page_content; } ###################################################################################################### print paragraphs of an xml page # parameters: 1) array of paragraphs to print # returns: the html for the paragraphs function html_print_paragraphs(&$paragraphs) { $page_content = ''; foreach($paragraphs as $para) { $page_content .= '

'; if(is_array($para)) { foreach($para as $key => $value) { switch($key) { case 'line': if(is_array($value)) { foreach($value as $line) { $page_content .= '
'.$line; } } else { $page_content .= '
'.$value; } break; case 'paracontent': $page_content .= "$value\n"; break; case 'list': if($para['list']['type'] == 'ordered') { $page_content .= "

    \n"; } else { $page_content .= "
\n"; } else { $page_content .= "\n"; } break; case 'heading': $page_content .= "$value\n"; break; case 'link': if(is_array($value)) { $page_content .= " {$value['linktext']}\n"; } else { $page_content .= " $value\n"; } break; case 'image': $images = xml_force_array($para['image']); $page_content .= html_print_images($images); break; default: break; } } } else { $page_content .= $para; } $page_content .= "

\n"; } return $page_content; } ###################################################################################################### print images of an xml page # parameters: 1) array of images to print # returns: the html for the images function html_print_images(&$images) { $page_content = ''; foreach($images as $image) { if(is_array($image)) { foreach($image as $key => $value) { switch($key) { case 'link': $page_content .= "