MarkForDelete
Goal
Provide the opportunity to mark pages for deletion and collect them on a summary page for a peer review or later deletion by the administrator.
Answer
The mark for deletion process works this way
- put a snippet in your template which gives you a delete link
- when clicked, it leads to a form. Here you can give a short statement why the page should be deleted. Then
- a note is put on the page about its delete status
- a note is put on a summary page that collects all marked sites by week (example)
Installation
Note: "pagename" refers to "Group.Name" Include markfordelete.phpΔ in your config file:
include_once("$FarmD
/cookbook/markfordelete.php");
Set the parameters:
Mandatory
- $MarkForDeletePagename
- pagename of the summary page
- $MarkForDeleteForm
- pagename of the wiki site with the form (See Notes)
Optional
- $MarkForDeleteAllreadyOnPage
- message shown if a page is allready marked for deletion. can be a pagename for redirection or html formated string
- $MarkForDeletePutOnPage
- can be a pagename which is included or wiki markup formated string. (e.g. a Sticky Note)
- $MarkForDeleteLinkFmt
- format of the template link
- $MarkForDeleteExcludePattern
- pagename strings which should not get an delete link in RegEx style "term1|term2|...|termX"
Localization
'Week from' => 'Header on the summary page', 'New Deletion Candidate' => 'Text in the RecentChanges for the summary page', 'Marked for Deletion' => 'Text in the RecentChanges for the marked page', 'Delete' => 'Text of the template snippet',
The Template Snippet
Put in your skin template file
<!--function:MarkForDeleteLink-->
which outputs the deletion link. The deletion link will only be set if the current page is not already on the summary page and its name doesn't match someting in $MarkForDeleteExcludePattern.
The Form
There is a new Form variable which holds the name of the site you want to mark. The pagename of the form is set by $MarkForDeleteForm
.
The form should look something like this:
You want to mark the site [[{$PageToDelete}]] for deletion. (:input form "" post:) Why should the page be deleted: (:input text shortexplain size=80 :) (:input hidden action markfordelete :) (:input hidden perform true :) (:input hidden pagetodelete {$PageToDelete} :) (:input submit value="Go":) (:input end:) |
You want to mark the site for deletion. |
Notes
You can bypass the form, if you want, by providing paramters when calling the markfordelete action:
perform=1 pagetodelete=pagename
Releases
- v0.2 - Schlaefer November 21, 2005, at 06:17 AM
- v0.4 - Kt007 September 4, 2022, at 12:12 PM - Now fully functional with PHP 8
See Also
Contributors
Comments
See discussion at MarkForDelete-Talk?
User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.