Sorry folks. Changing onClick to onMouseDown so middle mouse/right mouse work correc...
[squirrelmail.git] / src / folders_delete.php
index 3b450048b322f0e8022d9e36c349a011ef9d139d..c65fcabd4f0a22e5bc528b3eb5d05849e738d8df 100644 (file)
@@ -3,17 +3,20 @@
 /**
  * folders_delete.php
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 1999-2005 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
- * Deletes folders from the IMAP server. 
+ * Deletes folders from the IMAP server.
  * Called from the folders.php
  *
- * $Id$
+ * @version $Id$
  * @package squirrelmail
  */
 
-/** Path for SquirrelMail required files. */
+/**
+ * Path for SquirrelMail required files.
+ * @ignore
+ */
 define('SM_PATH','../');
 
 /* SquirrelMail required files. */
@@ -23,6 +26,7 @@ require_once(SM_PATH . 'functions/imap.php');
 require_once(SM_PATH . 'functions/tree.php');
 require_once(SM_PATH . 'functions/display_messages.php');
 require_once(SM_PATH . 'functions/html.php');
+require_once(SM_PATH . 'functions/forms.php');
 
 /*
  *  Incoming values:
@@ -41,7 +45,7 @@ if ($mailbox == '') {
     displayPageHeader($color, 'None');
 
     plain_error_message(_("You have not selected a folder to delete. Please do so.").
-       '<BR><A HREF="../src/folders.php">'._("Click here to go back").'</A>.', $color);
+        '<br /><a href="../src/folders.php">'._("Click here to go back").'</a>.', $color);
     exit;
 }
 
@@ -54,20 +58,19 @@ if ( sqgetGlobalVar('backingout', $tmp, SQ_POST) ) {
 if( !sqgetGlobalVar('confirmed', $tmp, SQ_POST) ) {
     displayPageHeader($color, 'None');
 
-    echo '<br>' .
+    echo '<br />' .
         html_tag( 'table', '', 'center', '', 'width="95%" border="0"' ) .
         html_tag( 'tr',
             html_tag( 'td', '<b>' . _("Delete Folder") . '</b>', 'center', $color[0] )
         ) .
         html_tag( 'tr' ) .
         html_tag( 'td', '', 'center', $color[4] ) .
-        sprintf(_("Are you sure you want to delete %s?"), imap_utf7_decode_local($mailbox)).
-        '<FORM ACTION="folders_delete.php" METHOD="POST"><p>'.
-
-        '<INPUT TYPE=HIDDEN NAME="mailbox" VALUE="' . htmlspecialchars($mailbox) . "\">\n" .
-        '<INPUT TYPE=SUBMIT NAME="confirmed" VALUE="'._("Yes")."\">\n".
-        '<INPUT TYPE=SUBMIT NAME="backingout" VALUE="'._("No")."\">\n".
-        '</p></FORM><BR></td></tr></table>';
+        sprintf(_("Are you sure you want to delete %s?"), str_replace(array(' ','<','>'),array('&nbsp;','&lt;','&gt;'),imap_utf7_decode_local($mailbox))).
+        addForm('folders_delete.php', 'post')."<p>\n".
+        addHidden('mailbox', $mailbox).
+        addSubmit(_("Yes"), 'confirmed').
+        addSubmit(_("No"), 'backingout').
+        '</p></form><br /></td></tr></table>';
 
     exit;
 }
@@ -90,7 +93,7 @@ else
 /* Courier IMAP doesn't like subfolders of Trash
  * If global options say we can't move it into Trash
  * If it's already a subfolder of trash, we'll have to delete it */
-if (strtolower($imap_server_type) == 'courier' || 
+if (strtolower($imap_server_type) == 'courier' ||
     (isset($delete_folder) && $delete_folder) ||
     eregi('^'.$trash_folder.'.+', $mailbox) )
 {
@@ -138,4 +141,4 @@ sqimap_logout($imap_stream);
 $location = get_location();
 header ("Location: $location/folders.php?success=delete");
 
-?>
+?>
\ No newline at end of file