Wiclear

You are here :

English Confirmation of history delete code

Sunday, 9. July 2006 14:14:23, by David Jobet

 

David(09/07/06) : done

In history.php

Modify handler array

//New event handlers
$contentBoxHandle"history_del"          = "deleteHistory";
$contentBoxHandle"history_del_all"      = "deleteAllHistory";
//added _confirmed to the array key
$userActionHandle"history_del_confirmed"          = "onDeleteHistory";
$userActionHandle"history_del_all_confirmed"      = "onDeleteAllHistory";

Add the following two functions

/**
* brief Confirm delete history 
*
* return html blob
*/
function deleteHistory(){
   //sdw - added to get user to confirm delete
   global $wiki;
   global $node;
   global $user;
   
   $id = varGet("id");
   $html = '<h1>Confirm delete history </h1>';
   $html .= '<p>This will permentally delete this version of the page from the wiki, you will not be able to undo this action.</p>';
   $html .= "<p>Please confirm you wish to delete this version of '{$node->title}'</p>";
   $html .= "<p><a href="?title={$node->title}

REDIRECT TO: http://wiclear.free.fr/index.php?title=amp%3Bmode%3Dhistory_del_confirmed&from=Confirmation%20of%20history%20delete%20code

amp;id={$id}

REDIRECT TO: http://wiclear.free.fr/index.php?title=amp%3Blang%3D%7B%24node-%26gt%3Blang-%26gt%3Bcode%7D%26quot%3B%26gt%3BYes%20%28delete%29%26lt%3B%2Fa%26gt%3B&from=Confirmation%20of%20history%20delete%20code

amp;mode=history&amp;lang={$node-&gt;lang-&gt;code}&quot;&gt;No (take me back)&lt;/a&gt;&lt;/p&gt;&quot;; return $html; }

and

/**
* brief Confirm delete all history
*
* return html blob
*/
function deleteAllHistory(){
   //sdw - added to get user to confirm delete
   global $wiki;
   global $node;
   global $user;
   
   $id = varGet("id");
   $html = '<h1>Confirm delete all history </h1>';
   $html .= '<p>This will permentally delete all previous versions of the page from the wiki, you will not be able to undo this action.</p>';
   $html .= "<p>Please confirm you wish to delete all previous versions of '{$node->title}'</p>";
   $html .= "<p><a href="?title={$node->title}

REDIRECT TO: http://wiclear.free.fr/index.php?title=amp%3Bmode%3Dhistory_del_all_confirmed&from=Confirmation%20of%20history%20delete%20code

amp;id={$id}

REDIRECT TO: http://wiclear.free.fr/index.php?title=amp%3Blang%3D%7B%24node-%26gt%3Blang-%26gt%3Bcode%7D%26quot%3B%26gt%3BYes%20%28delete%29%26lt%3B%2Fa%26gt%3B&from=Confirmation%20of%20history%20delete%20code

amp;mode=history&amp;lang={$node-&gt;lang-&gt;code}&quot;&gt;No (take me back)&lt;/a&gt;&lt;/p&gt;&quot;; return $html; }

No trackbacks yet

To make a trackback, use ping url http://wiclear.free.fr/tools/trackback/trackback.php?id=167

If your client support ping url auto discovery, you can also try it using directly this page's url

No comments yet