diff --git a/Changelog.md b/Changelog.md index 3da221d..e412e13 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t - [Rest API] Added support for the `mode` parameter to the `random` action. - Fixed various issues with both the module api & the rest api docs. - Add json support to the search action :D + - Added page moves to the recent changes page (#151). ### Fixed - Properly escaped content of short code box on file pages diff --git a/build/index.php b/build/index.php index b8aabf3..5cf6ea5 100644 --- a/build/index.php +++ b/build/index.php @@ -352,6 +352,7 @@ summary { cursor: pointer; } .diff-removed { background-color: rgba(255, 96, 96, 0.6); color: rgba(191, 38, 38, 1); } .newpage::before { content: "N"; margin: 0 0.3em 0 -1em; font-weight: bolder; text-decoration: underline dotted; } +.move::before { content: "\\1f69a"; font-size: 1.25em; margin: 0 0.1em 0 -1.1em; } .upload::before { content: "\\1f845"; margin: 0 0.1em 0 -1.1em; } .new-comment::before { content: "\\1f4ac"; margin: 0 0.1em 0 -1.1em; } @@ -3538,12 +3539,17 @@ function render_recent_change($rchange) $result .= "$pageDisplayHtml $editorDisplayHtml $timeDisplayHtml ($size_display)"; break; - + case "deletion": $resultClasses[] = "deletion"; $result .= "$pageDisplayHtml $editorDisplayHtml $timeDisplayHtml"; break; + case "move": + $resultClasses[] = "move"; + $result .= "$rchange->oldpage ⭢ $pageDisplayHtml $editorDisplayHtml $timeDisplayHtml"; + break; + case "upload": $resultClasses[] = "upload"; $result .= "$pageDisplayHtml $editorDisplayHtml $timeDisplayHtml (" . human_filesize($rchange->filesize) . ")"; @@ -7472,6 +7478,19 @@ register_module([ ); } + // Add a recent change announcing the move if the recent changes + // module is installed + if(module_exists("feature-recent-changes")) + { + add_recent_change([ + "type" => "move", + "timestamp" => time(), + "oldpage" => $page, + "page" => $new_name, + "user" => $env->user + ]); + } + // Exit with a nice message exit(page_renderer::render_main("Moving " . htmlentities($env->page), "

" . htmlentities($env->page) . " has been moved to " . htmlentities($new_name) . " successfully.

")); }); diff --git a/module_index.json b/module_index.json index f49709e..c32bebd 100755 --- a/module_index.json +++ b/module_index.json @@ -86,7 +86,7 @@ "author": "Starbeamrainbowlabs", "description": "Adds recent changes. Access through the 'recent-changes' action.", "id": "feature-recent-changes", - "lastupdate": 1505512941, + "lastupdate": 1521408644, "optional": false }, { @@ -221,7 +221,7 @@ "author": "Starbeamrainbowlabs", "description": "Adds an action to allow administrators to move pages.", "id": "page-move", - "lastupdate": 1511449784, + "lastupdate": 1521408303, "optional": false }, { diff --git a/modules/feature-recent-changes.php b/modules/feature-recent-changes.php index a10a42a..f70029b 100644 --- a/modules/feature-recent-changes.php +++ b/modules/feature-recent-changes.php @@ -244,12 +244,17 @@ function render_recent_change($rchange) $result .= "$pageDisplayHtml $editorDisplayHtml $timeDisplayHtml ($size_display)"; break; - + case "deletion": $resultClasses[] = "deletion"; $result .= "$pageDisplayHtml $editorDisplayHtml $timeDisplayHtml"; break; + case "move": + $resultClasses[] = "move"; + $result .= "$rchange->oldpage ⭢ $pageDisplayHtml $editorDisplayHtml $timeDisplayHtml"; + break; + case "upload": $resultClasses[] = "upload"; $result .= "$pageDisplayHtml $editorDisplayHtml $timeDisplayHtml (" . human_filesize($rchange->filesize) . ")"; diff --git a/modules/page-move.php b/modules/page-move.php index 5803968..b86b743 100644 --- a/modules/page-move.php +++ b/modules/page-move.php @@ -127,6 +127,19 @@ register_module([ ); } + // Add a recent change announcing the move if the recent changes + // module is installed + if(module_exists("feature-recent-changes")) + { + add_recent_change([ + "type" => "move", + "timestamp" => time(), + "oldpage" => $page, + "page" => $new_name, + "user" => $env->user + ]); + } + // Exit with a nice message exit(page_renderer::render_main("Moving " . htmlentities($env->page), "

" . htmlentities($env->page) . " has been moved to " . htmlentities($new_name) . " successfully.

")); }); diff --git a/theme_default.css b/theme_default.css index 1bc1c31..233ec59 100644 --- a/theme_default.css +++ b/theme_default.css @@ -123,6 +123,7 @@ summary { cursor: pointer; } .diff-removed { background-color: rgba(255, 96, 96, 0.6); color: rgba(191, 38, 38, 1); } .newpage::before { content: "N"; margin: 0 0.3em 0 -1em; font-weight: bolder; text-decoration: underline dotted; } +.move::before { content: "\\1f69a"; font-size: 1.25em; margin: 0 0.1em 0 -1.1em; } .upload::before { content: "\\1f845"; margin: 0 0.1em 0 -1.1em; } .new-comment::before { content: "\\1f4ac"; margin: 0 0.1em 0 -1.1em; }