1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-25 17:23:00 +00:00

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";