From 50e122e3318d6a58a595ed233f0a59e8d2d97958 Mon Sep 17 00:00:00 2001 From: Brian Buller Date: Tue, 18 Jul 2017 11:12:41 -0500 Subject: [PATCH] Looking Good --- manager.php => index.php | 62 ++++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 9 deletions(-) rename manager.php => index.php (57%) diff --git a/manager.php b/index.php similarity index 57% rename from manager.php rename to index.php index a895699..fcab710 100644 --- a/manager.php +++ b/index.php @@ -19,12 +19,9 @@ default: function buildStaticPage() { $pd = new Parsedown(); $title = !empty($_POST['title'])?$_POST['title']:TITLE; - $out = outputHTMLHeader($title, true); - $out .= '
';
-  $out .= print_r($_POST, true);
-  $out .= '
'; - $out .= '======'; - foreach($_POST['chosen_files'] as $file) { + $out = getHTMLHeader($title); + $selFiles = json_decode($_POST['chosen_files']); + foreach($selFiles as $file) { if(file_exists($file)) { $md = file_get_contents($file); $out .= '
'; @@ -32,15 +29,17 @@ function buildStaticPage() { $out .= "
"; } } - $out .= outputHTMLFooter(true); + $out .= getHTMLFooter(); $outfile = !empty($_POST['outfile'])?$_POST['outfile']:DEFAULT_FILE; file_put_contents($outfile, $out); + header('Location: '.$outfile); } function showAdminPage() { $out = getHTMLHeader(TITLE) - .'
'."\n" + .''."\n" .'
'."\n" + .' '."\n" .'
'."\n" .' '."\n" .' '."\n" @@ -55,7 +54,7 @@ function showAdminPage() { $base = basename($file, '.md'); $out.=' '."\n" .' '.$base.'' - .''."\n" + .'Add'."\n" .' '."\n"; } $out.=' '."\n" @@ -64,6 +63,7 @@ function showAdminPage() { .'
'."\n" .'
'."\n" .''."\n" .getHTMLFooter(); echo $out; @@ -95,6 +131,14 @@ function getHTMLHeader($title = TITLE) { .' .margin10 {'."\n" .' margin: 10px;'."\n" .' }'."\n" + .' .pure-button-secondary {'."\n" + .' background-color: #0A0;'."\n" + .' color: #FFF;'."\n" + .' }'."\n" + .' .pure-button-warning {'."\n" + .' background-color: #A00;'."\n" + .' color: #FFF;'."\n" + .' }'."\n" .' '."\n" .' '."\n" .' '."\n";