]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/removepage.php
added themed ButtonSeparator between daylist buttons
[SourceForge/phpwiki.git] / lib / removepage.php
1 <?php
2 rcs_id('$Id: removepage.php,v 1.5 2002-01-23 05:10:22 dairiki Exp $');
3 require_once('lib/Template.php');
4
5 function RemovePage (&$request) {
6     global $Theme;
7     $pagename = $request->getArg('pagename');
8     $pagelink = $Theme->linkExistingWikiWord($pagename);
9     
10     if ($request->getArg('verify') != 'okay') {
11         $url = WikiURL($pagename, array('action' => 'remove', 'verify' => 'okay'));
12
13         $removeB = $Theme->makeButton(_("Remove the page now"), $url, 'wikiadmin');
14         $cancelB = $Theme->makeButton(_("Cancel"), WikiURL($pagename), 'wikiaction');
15         
16         $html[] = HTML::h2(fmt("You are about to remove '%s' permanently!", $pagelink));
17         $html[] =HTML::div(array('class' => 'toolbar'),
18                            $removeB,
19                            $Theme->getButtonSeparator(),
20                            $cancelB);
21     }
22     else {
23         $dbi = $request->getDbh();
24         $dbi->deletePage($pagename);
25         $html[] = HTML::h2(fmt("Removed page '%s' succesfully.", $pagename));
26     }
27     echo GeneratePage('MESSAGE', $html, _("Remove page"));
28 }
29
30 RemovePage($request);
31
32 // For emacs users
33 // Local Variables:
34 // mode: php
35 // tab-width: 8
36 // c-basic-offset: 4
37 // c-hanging-comment-ender-p: nil
38 // indent-tabs-mode: nil
39 // End:
40
41 ?>