exit(page_renderer::render_main("Moving $env->page - Error", "<p>You tried to move $env->page to $new_name, but the page with the name $env->page does not exist in the first place.</p>
<p>Nothing has been changed.</p>"));
if($env->page == $new_name)
exit(page_renderer::render_main("Moving $env->page - Error", "<p>You tried to move $page, but the new name you gave is the same as it's current name.</p>
<p>It is possible that you tried to use some characters in the new name that are not allowed and were removed.</p>
<p>Page names may not contain any of these characters: <code>?%*:|\"><()[]</code></p>"));
if(isset($pageindex->$page->uploadedfile) and
file_exists($new_name))
exit(page_renderer::render_main("Moving $env->page - Error - $settings->sitename", "<p>Whilst moving the file associated with $env->page, $settings->sitename detected a pre-existing file on the server's file system. Because $settings->sitename can't determine whether the existing file is important to another component of $settings->sitename or it's host web server, the move have been aborted - just in case.</p>
<p>If you know that this move is actually safe, please get your site administrator (" . $settings->admindetails_name . ") to perform the move manually. Their contact address can be found at the bottom of every page (including this one).</p>"));
// Move the page in the page index
$pageindex->$new_name = new stdClass();
foreach($pageindex->$page as $key => $value)
{
$pageindex->$new_name->$key = $value;
}
unset($pageindex->$page);
$pageindex->$new_name->filename = "$new_name.md";
// If this page has an associated file, then we should move that too
if(!empty($pageindex->$new_name->uploadedfile))
{
// Update the filepath to point to the description and not the image
add_help_section("60-move", "Moving Pages", "<p>If you are logged in as an administrator, then you have the power to move pages. To do this, click "Move" in the "More..." menu when browsing the pge you wish to move. Type in the new name of the page, and then click "Move Page".</p>");