change: save before returning home
This commit is contained in:
parent
6b676c7ba1
commit
c18744c45f
23
index.php
23
index.php
|
@ -27,9 +27,6 @@
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
require 'libs/Parsedown.php';
|
|
||||||
$homelink = '<a accesskey="h" href="' . $root . '">home</a> ';
|
|
||||||
|
|
||||||
$action = '';
|
$action = '';
|
||||||
if (isset($_POST['action'])) $action = $_POST['action'];
|
if (isset($_POST['action'])) $action = $_POST['action'];
|
||||||
else if (isset($_GET['action'])) $action = $_GET['action'];
|
else if (isset($_GET['action'])) $action = $_GET['action'];
|
||||||
|
@ -37,6 +34,11 @@
|
||||||
$param = '';
|
$param = '';
|
||||||
if (isset($_GET['param'])) $param = $_GET['param'];
|
if (isset($_GET['param'])) $param = $_GET['param'];
|
||||||
|
|
||||||
|
if (isset($_POST['home']))
|
||||||
|
{
|
||||||
|
$action = 'save';
|
||||||
|
}
|
||||||
|
|
||||||
$content = '';
|
$content = '';
|
||||||
if ($action == 'save')
|
if ($action == 'save')
|
||||||
{
|
{
|
||||||
|
@ -52,6 +54,11 @@
|
||||||
|
|
||||||
$action = 'open';
|
$action = 'open';
|
||||||
$param = $title;
|
$param = $title;
|
||||||
|
|
||||||
|
if (isset($_POST['home']))
|
||||||
|
{
|
||||||
|
header('Location: index.php');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ($action == 'delete')
|
else if ($action == 'delete')
|
||||||
{
|
{
|
||||||
|
@ -61,6 +68,7 @@
|
||||||
|
|
||||||
if ($action == 'preview')
|
if ($action == 'preview')
|
||||||
{
|
{
|
||||||
|
require 'libs/Parsedown.php';
|
||||||
$title = $_POST['title'];
|
$title = $_POST['title'];
|
||||||
$content = $_POST['content'];
|
$content = $_POST['content'];
|
||||||
$Parsedown = new Parsedown();
|
$Parsedown = new Parsedown();
|
||||||
|
@ -91,8 +99,9 @@
|
||||||
$length = strlen($content);
|
$length = strlen($content);
|
||||||
|
|
||||||
echo '<form action="index.php" method="POST">
|
echo '<form action="index.php" method="POST">
|
||||||
<div>' . $homelink .
|
<div>
|
||||||
'<select name="action">
|
<input type="submit" name="home" value="home" accesskey="h">
|
||||||
|
<select name="action">
|
||||||
<option value="save">save</option>
|
<option value="save">save</option>
|
||||||
<option value="delete">delete</option>
|
<option value="delete">delete</option>
|
||||||
<option value="preview">preview</option>
|
<option value="preview">preview</option>
|
||||||
|
@ -136,8 +145,8 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo '<form action="index.php" method="GET">' .$homelink .
|
echo '<form action="index.php" method="GET">
|
||||||
'<select name="action">
|
<select name="action">
|
||||||
<option ' . ($action == 'open' ? 'selected' : '') . ' value="open">open</option>
|
<option ' . ($action == 'open' ? 'selected' : '') . ' value="open">open</option>
|
||||||
<option ' . ($action == 'filter' ? 'selected' : '') . ' value="filter">filter</option>
|
<option ' . ($action == 'filter' ? 'selected' : '') . ' value="filter">filter</option>
|
||||||
<option ' . ($action == 'search' ? 'selected' : '') . ' value="search">search</option>
|
<option ' . ($action == 'search' ? 'selected' : '') . ' value="search">search</option>
|
||||||
|
|
Loading…
Reference in New Issue