ContentManagement of SubPages Finished.

(BUG) Active link if Page and Page/subPage have the same Name.
This commit is contained in:
Kanti 2014-08-05 17:03:59 +02:00
commit be5c20d63e
3 changed files with 17 additions and 7 deletions

View file

@ -141,7 +141,7 @@ get("/:static/:sub/edit", function($static,$sub) {
header("location: $login");
}
});
post("/:static/:sub/edit", function() {
post("/:static/:sub/edit", function($static,$sub) {
$proper = is_csrf_proper(from($_REQUEST, 'csrf_token'));
if(!login())
@ -155,6 +155,10 @@ post("/:static/:sub/edit", function() {
$content = from($_REQUEST, 'content');
$oldfile = from($_REQUEST, 'oldfile');
$destination = from($_GET, 'destination');
if($destination === null)
{
$destination = $static . "/" . $sub;
}
if ($proper && !empty($title) && !empty($content)) {
if (!empty($url)) {
edit_page($title, $url, $content, $oldfile, $destination);
@ -1252,7 +1256,7 @@ get('/:static/add', function($static) {
header("location: $login");
}
});
post('/:static/add', function($static) {//not working
post('/:static/add', function($static) {
$proper = is_csrf_proper(from($_REQUEST, 'csrf_token'));