mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-22 04:23:01 +00:00
Add page moves to the recent changes page - fixes #151
This commit is contained in:
parent
104d267bed
commit
bd1cad3007
6 changed files with 43 additions and 4 deletions
|
@ -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.
|
- [Rest API] Added support for the `mode` parameter to the `random` action.
|
||||||
- Fixed various issues with both the module api & the rest api docs.
|
- Fixed various issues with both the module api & the rest api docs.
|
||||||
- Add json support to the search action :D
|
- Add json support to the search action :D
|
||||||
|
- Added page moves to the recent changes page (#151).
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Properly escaped content of short code box on file pages
|
- Properly escaped content of short code box on file pages
|
||||||
|
|
|
@ -352,6 +352,7 @@ summary { cursor: pointer; }
|
||||||
.diff-removed { background-color: rgba(255, 96, 96, 0.6); color: rgba(191, 38, 38, 1); }
|
.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; }
|
.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; }
|
.upload::before { content: "\\1f845"; margin: 0 0.1em 0 -1.1em; }
|
||||||
.new-comment::before { content: "\\1f4ac"; margin: 0 0.1em 0 -1.1em; }
|
.new-comment::before { content: "\\1f4ac"; margin: 0 0.1em 0 -1.1em; }
|
||||||
|
|
||||||
|
@ -3544,6 +3545,11 @@ function render_recent_change($rchange)
|
||||||
$result .= "$pageDisplayHtml $editorDisplayHtml $timeDisplayHtml";
|
$result .= "$pageDisplayHtml $editorDisplayHtml $timeDisplayHtml";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "move":
|
||||||
|
$resultClasses[] = "move";
|
||||||
|
$result .= "$rchange->oldpage ⭢ <a href='?page=" . rawurlencode($rchange->page) . "'>$pageDisplayHtml</a> $editorDisplayHtml $timeDisplayHtml";
|
||||||
|
break;
|
||||||
|
|
||||||
case "upload":
|
case "upload":
|
||||||
$resultClasses[] = "upload";
|
$resultClasses[] = "upload";
|
||||||
$result .= "<a href='?page=$rchange->page'>$pageDisplayHtml</a> $editorDisplayHtml $timeDisplayHtml (" . human_filesize($rchange->filesize) . ")";
|
$result .= "<a href='?page=$rchange->page'>$pageDisplayHtml</a> $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 with a nice message
|
||||||
exit(page_renderer::render_main("Moving " . htmlentities($env->page), "<p><a href='index.php?page=" . rawurlencode($env->page) . "'>" . htmlentities($env->page) . "</a> has been moved to <a href='index.php?page=" . rawurlencode($new_name) . "'>" . htmlentities($new_name) . "</a> successfully.</p>"));
|
exit(page_renderer::render_main("Moving " . htmlentities($env->page), "<p><a href='index.php?page=" . rawurlencode($env->page) . "'>" . htmlentities($env->page) . "</a> has been moved to <a href='index.php?page=" . rawurlencode($new_name) . "'>" . htmlentities($new_name) . "</a> successfully.</p>"));
|
||||||
});
|
});
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
"author": "Starbeamrainbowlabs",
|
"author": "Starbeamrainbowlabs",
|
||||||
"description": "Adds recent changes. Access through the 'recent-changes' action.",
|
"description": "Adds recent changes. Access through the 'recent-changes' action.",
|
||||||
"id": "feature-recent-changes",
|
"id": "feature-recent-changes",
|
||||||
"lastupdate": 1505512941,
|
"lastupdate": 1521408644,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -221,7 +221,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": 1511449784,
|
"lastupdate": 1521408303,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -250,6 +250,11 @@ function render_recent_change($rchange)
|
||||||
$result .= "$pageDisplayHtml $editorDisplayHtml $timeDisplayHtml";
|
$result .= "$pageDisplayHtml $editorDisplayHtml $timeDisplayHtml";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "move":
|
||||||
|
$resultClasses[] = "move";
|
||||||
|
$result .= "$rchange->oldpage ⭢ <a href='?page=" . rawurlencode($rchange->page) . "'>$pageDisplayHtml</a> $editorDisplayHtml $timeDisplayHtml";
|
||||||
|
break;
|
||||||
|
|
||||||
case "upload":
|
case "upload":
|
||||||
$resultClasses[] = "upload";
|
$resultClasses[] = "upload";
|
||||||
$result .= "<a href='?page=$rchange->page'>$pageDisplayHtml</a> $editorDisplayHtml $timeDisplayHtml (" . human_filesize($rchange->filesize) . ")";
|
$result .= "<a href='?page=$rchange->page'>$pageDisplayHtml</a> $editorDisplayHtml $timeDisplayHtml (" . human_filesize($rchange->filesize) . ")";
|
||||||
|
|
|
@ -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 with a nice message
|
||||||
exit(page_renderer::render_main("Moving " . htmlentities($env->page), "<p><a href='index.php?page=" . rawurlencode($env->page) . "'>" . htmlentities($env->page) . "</a> has been moved to <a href='index.php?page=" . rawurlencode($new_name) . "'>" . htmlentities($new_name) . "</a> successfully.</p>"));
|
exit(page_renderer::render_main("Moving " . htmlentities($env->page), "<p><a href='index.php?page=" . rawurlencode($env->page) . "'>" . htmlentities($env->page) . "</a> has been moved to <a href='index.php?page=" . rawurlencode($new_name) . "'>" . htmlentities($new_name) . "</a> successfully.</p>"));
|
||||||
});
|
});
|
||||||
|
|
|
@ -123,6 +123,7 @@ summary { cursor: pointer; }
|
||||||
.diff-removed { background-color: rgba(255, 96, 96, 0.6); color: rgba(191, 38, 38, 1); }
|
.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; }
|
.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; }
|
.upload::before { content: "\\1f845"; margin: 0 0.1em 0 -1.1em; }
|
||||||
.new-comment::before { content: "\\1f4ac"; margin: 0 0.1em 0 -1.1em; }
|
.new-comment::before { content: "\\1f4ac"; margin: 0 0.1em 0 -1.1em; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue