'; $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() { outputHTMLHeader(); $out = '
'."\n" .'
'."\n" .' '."\n" .' '."\n" .'
'."\n" .'
'."\n" .' '."\n" .' '."\n" .' '."\n" .' '."\n" .' '."\n"; foreach(glob(MD_DIR.'/*.md') as $file) { $out.=' '."\n" .' '."\n" .' '."\n"; } $out.= ' '."\n" .'
File
'.basename($file, '.md').'
'."\n" .'
'."\n" .' '."\n" .'
'."\n" .''."\n"; outputHTMLFooter(); } function outputHTMLHeader($title = TITLE, $ret = false) { $out = ''."\n" .''."\n" .' '."\n" .' '.$title.''."\n" .' '."\n" .' '."\n" .' '."\n"; if($ret) { return $out; } echo $out; } function outputHTMLFooter($ret = false) { $out = ' '."\n" .''."\n"; if($ret) { return $out; } echo $out; } ?>