4 * folders_rename_getname.php
6 * Copyright (c) 1999-2004 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * Gets folder names and enables renaming
10 * Called from folders.php
13 * @package squirrelmail
16 /** Path for SquirrelMail required files. */
17 define('SM_PATH','../');
19 /* SquirrelMail required files. */
20 require_once(SM_PATH
. 'include/validate.php');
21 require_once(SM_PATH
. 'functions/global.php');
22 require_once(SM_PATH
. 'functions/imap_mailbox.php');
23 require_once(SM_PATH
. 'functions/html.php');
24 require_once(SM_PATH
. 'functions/display_messages.php');
25 require_once(SM_PATH
. 'functions/forms.php');
27 /* get globals we may need */
28 sqgetGlobalVar('key', $key, SQ_COOKIE
);
29 sqgetGlobalVar('username', $username, SQ_SESSION
);
30 sqgetGlobalVar('onetimepad',$onetimepad, SQ_SESSION
);
31 sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION
);
32 sqgetGlobalVar('old', $old, SQ_POST
);
33 /* end of get globals */
36 displayPageHeader($color, 'None');
38 plain_error_message(_("You have not selected a folder to rename. Please do so.").
39 '<BR><A HREF="../src/folders.php">'._("Click here to go back").'</A>.', $color);
43 if (substr($old, strlen($old) - strlen($delimiter)) == $delimiter) {
45 $old = substr($old, 0, strlen($old) - 1);
50 $old = imap_utf7_decode_local($old);
52 if (strpos($old, $delimiter)) {
53 $old_name = substr($old, strrpos($old, $delimiter)+
1, strlen($old));
54 $old_parent = substr($old, 0, strrpos($old, $delimiter));
61 displayPageHeader($color, 'None');
63 html_tag( 'table', '', 'center', '', 'width="95%" border="0"' ) .
65 html_tag( 'td', '<b>' . _("Rename a folder") . '</b>', 'center', $color[0] )
68 html_tag( 'td', '', 'center', $color[4] ) .
69 addForm('folders_rename_do.php').
71 '<br><b>' . htmlspecialchars($old_parent) . ' ' . htmlspecialchars($delimiter) . '</b>' .
72 addInput('new_name', $old_name, 25) . '<BR>' . "\n";
74 echo addHidden('isfolder', 'true');
76 echo addHidden('orig', $old).
77 addHidden('old_name', $old_name).
78 '<INPUT TYPE=SUBMIT VALUE="'._("Submit")."\">\n".
79 '</FORM><BR></td></tr></table>';