Tidy up page moving code a tad

This commit is contained in:
Starbeamrainbowlabs 2015-10-25 11:11:41 +00:00
parent 7577a6669c
commit 3e47422cc6
3 changed files with 3 additions and 5 deletions

View File

@ -2215,8 +2215,7 @@ register_module([
unset($pageindex->$page); unset($pageindex->$page);
$pageindex->$new_name->filename = $new_name; $pageindex->$new_name->filename = $new_name;
// If this page has an associated file, then we should move that too // If this page has an associated file, then we should move that too
if(isset($pageindex->$new_name->uploadedfile) and if(!empty($pageindex->$new_name->uploadedfile))
$pageindex->$new_name->uploadedfile == true)
{ {
// Update the filepath to point to the description and not the image // Update the filepath to point to the description and not the image
$pageindex->$new_name->filename = $pageindex->$new_name->filename . ".md"; $pageindex->$new_name->filename = $pageindex->$new_name->filename . ".md";

View File

@ -131,7 +131,7 @@
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds an action to allow administrators to move pages.", "description": "Adds an action to allow administrators to move pages.",
"id": "page-move", "id": "page-move",
"lastupdate": 1445771285, "lastupdate": 1445771483,
"optional": false "optional": false
}, },
{ {

View File

@ -55,8 +55,7 @@ register_module([
unset($pageindex->$page); unset($pageindex->$page);
$pageindex->$new_name->filename = $new_name; $pageindex->$new_name->filename = $new_name;
// If this page has an associated file, then we should move that too // If this page has an associated file, then we should move that too
if(isset($pageindex->$new_name->uploadedfile) and if(!empty($pageindex->$new_name->uploadedfile))
$pageindex->$new_name->uploadedfile == true)
{ {
// Update the filepath to point to the description and not the image // Update the filepath to point to the description and not the image
$pageindex->$new_name->filename = $pageindex->$new_name->filename . ".md"; $pageindex->$new_name->filename = $pageindex->$new_name->filename . ".md";