'; $out .= print_r($_POST, true); $out .= ''; $out .= '======'; foreach($_POST['chosen_files'] as $file) { if(file_exists($file)) { $md = file_get_contents($file); $out .= '
'; $out .= $pd->text($md); $out .= "
"; } } $out .= outputHTMLFooter(true); $outfile = !empty($_POST['outfile'])?$_POST['outfile']:DEFAULT_FILE; file_put_contents($outfile, $out); } function showAdminPage() { $out = getHTMLHeader(TITLE) .'
'."\n" .'
'."\n" .'
'."\n" .' '."\n" .' '."\n" .' '."\n" .'
'."\n" .'
'."\n" .' '."\n" .' '."\n" .' '."\n" .' '."\n"; foreach(glob(MD_DIR.'/*.md') as $file) { $base = basename($file, '.md'); $out.=' '."\n" .' ' .''."\n" .' '."\n"; } $out.=' '."\n" .'
'.$base.'
'."\n" .'
'."\n" .'
'."\n" .'
'."\n" .''."\n" .getHTMLFooter(); echo $out; } function getHTMLHeader($title = TITLE) { $out = ''."\n" .''."\n" .' '."\n" .' '.$title.''."\n" .' '."\n" .' '."\n" .' '."\n" .' '."\n"; return $out; } function getHTMLFooter() { $out = ' '."\n" .''."\n"; return $out; } ?>