Browse Source

Some destination bug fixes (SubPages)

pull/74/head
Kanti 11 years ago
parent
commit
02c6a36a1a
2 changed files with 26 additions and 29 deletions
  1. +25
    -28
      system/admin/views/delete-page.html.php
  2. +1
    -1
      system/admin/views/edit-page.html.php

+ 25
- 28
system/admin/views/delete-page.html.php View File

@ -1,33 +1,30 @@
<?php
if(isset($_GET['destination'])) {
$destination = $_GET['destination'];
}
$url = $p->file;
$dir = substr($url, 0, strrpos($url, '/'));
$oldurl = str_replace($dir . '/','',$url);
$oldmd = str_replace('.md','',$oldurl);
$post = site_url() . $oldmd;
if(isset($destination)) {
if($destination == 'post') {
$back = $post;
}
else {
$back = site_url() . $destination;
}
}
else {
$back = site_url();
}
if (isset($_GET['destination'])) {
$destination = $_GET['destination'];
}
$url = $p->file;
$dir = substr($url, 0, strrpos($url, '/'));
$oldurl = str_replace($dir . '/', '', $url);
$oldmd = str_replace('.md', '', $oldurl);
$post = $p->url;
if (isset($destination)) {
if ($destination == 'post') {
$back = $post;
} else {
$back = site_url() . $destination;
}
} else {
$back = site_url();
}
?>
<?php echo '<p>Are you sure want to delete <strong>' . $p->title . '</strong>?</p>';?>
<p>Are you sure want to delete <strong><?php echo $p->title; ?></strong>?</p>
<form method="POST">
<input type="hidden" name="file" value="<?php echo $p->file ?>"/><br>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>">
<input type="submit" name="submit" value="Delete"/>
<span><a href="<?php echo $back ?>">Cancel</a></span>
<input type="hidden" name="file" value="<?php echo $p->file ?>"/><br>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<input type="submit" name="submit" value="Delete"/>
<span><a href="<?php echo $back ?>">Cancel</a></span>
</form>

+ 1
- 1
system/admin/views/edit-page.html.php View File

@ -27,7 +27,7 @@
$oldurl = str_replace($dir . '/','',$url);
$oldmd = str_replace('.md','',$oldurl);
$delete = site_url() . $oldmd . '/delete?destination=' . $destination;
$delete = $p->url . '/delete?destination=' . $destination;
?>
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css" />


Loading…
Cancel
Save