$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(