/**
* folders.php
*
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 1999-2004 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* Handles all interaction between the user and the other folder
* scripts which do most of the work. Also handles the Special
* Folders.
*
- * $Id$
+ * @version $Id$
+ * @package squirrelmail
*/
-/* Path for SquirrelMail required files. */
+/**
+ * Path for SquirrelMail required files.
+ * @ignore
+ */
define('SM_PATH','../');
/* SquirrelMail required files. */
require_once(SM_PATH . 'functions/imap.php');
require_once(SM_PATH . 'functions/plugin.php');
require_once(SM_PATH . 'functions/html.php');
+require_once(SM_PATH . 'functions/forms.php');
displayPageHeader($color, 'None');
) .
html_tag( 'tr' ) .
html_tag( 'td', '', 'center', $color[0] ) .
-
- "<FORM NAME=cf ACTION=\"folders_create.php\" METHOD=\"POST\">\n".
- "<input type=TEXT SIZE=25 NAME=folder_name><BR>\n".
- _("as a subfolder of").
- '<BR>'.
+ addForm('folders_create.php', 'POST', 'cf').
+ addInput('folder_name', '', 25).
+ "<BR>\n". _("as a subfolder of"). '<BR>'.
"<TT><SELECT NAME=subfolder>\n";
$show_selected = array();
echo "</SELECT></TT>\n";
if ($show_contain_subfolders_option) {
- echo '<br><input type=CHECKBOX NAME="contain_subs"> '
+ echo '<br>'.
+ addCheckBox('contain_subs', FALSE, '1') .' '
. _("Let this folder contain subfolders")
. '<BR>';
}
html_tag( 'td', '', 'center', $color[0] );
if ($count_special_folders < count($boxes)) {
- echo "<FORM ACTION=\"folders_rename_getname.php\" METHOD=\"POST\">\n"
+ echo addForm('folders_rename_getname.php')
. "<TT><SELECT NAME=old>\n"
. ' <OPTION VALUE="">[ ' . _("Select a folder") . " ]</OPTION>\n";
html_tag( 'td', '', 'center', $color[0] );
if ($count_special_folders < count($boxes)) {
- echo "<FORM ACTION=\"folders_delete.php\" METHOD=\"POST\">\n"
+ echo addForm('folders_delete.php')
. "<TT><SELECT NAME=mailbox>\n"
. ' <OPTION VALUE="">[ ' . _("Select a folder") . " ]</OPTION>\n";
html_tag( 'td', '', 'center', $color[0], 'width="50%"' );
if ($count_special_folders < count($boxes)) {
- echo "<FORM ACTION=\"folders_subscribe.php?method=unsub\" METHOD=\"POST\">\n"
+ echo addForm('folders_subscribe.php?method=unsub')
. "<TT><SELECT NAME=\"mailbox[]\" multiple size=8>\n";
for ($i = 0; $i < count($boxes); $i++) {
$use_folder = true;
($boxes[$i]["unformatted"] != $trash_folder) &&
($boxes[$i]["unformatted"] != $sent_folder) &&
($boxes[$i]["unformatted"] != $draft_folder)) {
- $box = $boxes[$i]["unformatted-dm"];
+ $box = htmlspecialchars($boxes[$i]["unformatted-dm"]);
$box2 = str_replace(' ', ' ',
- imap_utf7_decode_local($boxes[$i]["unformatted-disp"]));
+ htmlspecialchars(imap_utf7_decode_local($boxes[$i]["unformatted-disp"])));
echo " <OPTION VALUE=\"$box\">$box2\n";
}
}
}
}
if ($use_folder == true) {
- $box[$q] = $boxes_all[$i]['unformatted-dm'];
- $box2[$q] = imap_utf7_decode_local($boxes_all[$i]['unformatted-disp']);
+ $box[$q] = htmlspecialchars($boxes_all[$i]['unformatted-dm']);
+ $box2[$q] = htmlspecialchars(imap_utf7_decode_local($boxes_all[$i]['unformatted-disp']));
$q++;
}
}
if ($box && $box2) {
- echo "<FORM ACTION=\"folders_subscribe.php?method=sub\" METHOD=\"POST\">\n"
+ echo addForm('folders_subscribe.php?method=sub')
. '<tt><select name="mailbox[]" multiple size=8>';
for ($q = 0; $q < count($box); $q++) {
}
} else {
/* don't perform the list action -- this is much faster */
- echo "<FORM ACTION=\"folders_subscribe.php?method=sub\" METHOD=\"POST\">\n"
+ echo addForm('folders_subscribe.php?method=sub')
. _("Subscribe to:") . '<br>'
. '<tt><input type="text" name="mailbox[]" size=35>'
. '<INPUT TYPE=SUBMIT VALUE="'. _("Subscribe") . "\">\n"