DeleteAction-Talk
This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.
Comments
I just wanted to point something out that may seem obvious to experienced users:
1) After the deletepage.php script is added, the line include_once("cookbook/deletepage.php"); must be added to the local configuration file. (assuming the file was placed in the cookbook/ directory).
Menachem January 20, 2005, at 02:03 PM
I think it would be great if the delete action could display a confirmation page. That way I would feel more comfortable adding a Delete action link. Right now if somebody accidentally clicks it when they try to click edit or history, they'll wipe the page (I know we can retrieve but it's a bit of a pain). --NoelLlopis
$DefaultPasswords
['delete'] = '*';
then
if (isset($_GET['delete']) && ($_GET['delete']=="yes")) {
delete... --Kab July 15, 2005, at 09:35 AM
$HandleAuth['delete'] = 'edit';
$HandleAuth['delete'] = 'admin';
if ($LoginName == 'Logout')
{$DeleteText = 'Delete This Page';} else {$DeleteText = '';}
$HandleAuth['delete'] = 'edit';
- Wouldn't an alternative way to do this whole thing be to add a link along the lines of [[{$Name}?action=edit?text=delete | Delete]] to Site.PageActions? -i.e prepopulate the edit box with the word delete through the url - Not sure of the exact syntax. This would have the benefit of teaching the user the standard delete mechanism and allowing them to confirm. Francis March 02, 2007, at 09:32 AM
Why isn't the delete password shown next to the change delete password box on the Attributes page? All the other attributes show what password they're using (**** for a normal password, and id: or @group for AuthUser passwords) next to the box where you type to change it, but delete doesn't. --Daniel
Philippe? - 2010-11-23: This is because something is missing from the recipe. It took me a while to track down, and I hope it's correct, but you must add SDV($FmtPV['$PasswdDelete'], 'PasswdVar($pn, "delete")');
in addition to the include_once("$FarmD/cookbook/deletepage.php");
SteP 2010-11-26: Philippe is right, SDV needs adding either in your configuration file or with the other SDV statements in the recipe PHP file. In addition, you may want to add markup to SiteAdmin.AuthList to list delete attribute values.
DenningServices(.com) 20151214: Here is your complete edit scenario for implementation of this cool script.
The files and pages of server file local/config.php, and wiki pages SiteAdmin.AuthList and Site.PageActions can be edited to add the following:
SDV($FmtPV['$PasswdDelete'], 'PasswdVar($pn, "delete")'); // Allow function to be password protected. include_once("$FarmD/cookbook/deletepage.php");
SiteAdmin.AuthList Edits
Under the conditional: (:if exists {=$Group}.GroupAttributes:)
Add the following line: ||delete ||{{=$Group}.GroupAttributes$PasswdDelete} ||
I put mine right after the one for Edit.
Under the conditional: (:if ! equal {=$Name} GroupAttributes :)
Add the following line: ||delete ||{=$PasswdDelete} ||
Once again, mine is after Edit.
For Tabs you can also put "DELETE" instead of "DELETE THIS PAGE"
This allows Admin access only by default. If any other editors also need to see it who are not an Admin, then take the conditional away from the accesskey listing and manage each group or page attribute accordingly. Remember: with no conditional, every page will be at risk.
(:if auth admin:) [-'''No Confirm / No Undo'''-] * %item rel=nofollow class=delete accesskey='$[ak_delete]'% [[{*$FullName}?action=delete | %color=red%[-'''''$[DELETE THIS PAGE]'''''-]%%]] (:ifend:)
Now, the only thing left to do is copy the module to restorepage.php and use the renaming convention to be called by a pop-up that allows pages to be listed and restored. I may work on that one later.
I hope this helps. Shalom.
Talk page for the DeleteAction recipe (users?).