diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2015-07-06 22:42:14 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2015-07-06 22:42:35 +0200 |
| commit | 93ef642c25d65519b334fecad56bf6567eeb733b (patch) | |
| tree | 3b20360b66f99843498efe2ce38cdcab20d1689a /www/edit.php | |
| parent | c87f5bbf4f85b875c96d0953c25c2ca824b534d5 (diff) | |
| download | phorkie-93ef642c25d65519b334fecad56bf6567eeb733b.tar.gz phorkie-93ef642c25d65519b334fecad56bf6567eeb733b.zip | |
single file edit: jump to file after saving
Diffstat (limited to 'www/edit.php')
| -rw-r--r-- | www/edit.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/www/edit.php b/www/edit.php index e95ca3f..33b22c2 100644 --- a/www/edit.php +++ b/www/edit.php @@ -9,16 +9,20 @@ require_once 'www-header.php'; $repo = new Repository(); $repo->loadFromRequest(); -$repopo = new Repository_Post($repo); -if ($repopo->process($_POST, $_SESSION)) { - redirect($repo->getLink('display', null, true)); -} - $file = null; if (isset($_GET['file'])) { $file = $repo->getFileByName($_GET['file']); } +$repopo = new Repository_Post($repo); +if ($repopo->process($_POST, $_SESSION)) { + $anchor = ''; + if ($file !== null) { + $anchor = '#' . $file->getAnchorName(); + } + redirect($repo->getLink('display', null, true) . $anchor); +} + render( 'edit', array( |
