Added All messages display
[squirrelmail.git] / src / folders_rename_getname.php
index 17c0c7eab4b80d7cd8d9af09b9df7bdd450d19d3..ae2e50bb98593808ee04d39e0f92207036ec7a84 100644 (file)
@@ -1,52 +1,69 @@
-<?
-   if (!isset($config_php))
-      include("../config/config.php");
-   if (!isset($strings_php))
-      include("../functions/strings.php");
-   if (!isset($page_header_php))
-      include("../functions/page_header.php");
-   if (!isset($imap_php))
-      include("../functions/imap.php");
+<?php
 
-   include("../src/load_prefs.php");
+/**
+ * folders_rename_getname.php
+ *
+ * Copyright (c) 1999-2001 The Squirrelmail Development Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * Gets folder names and enables renaming
+ * Called from folders.php
+ *
+ * $Id$
+ */
 
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
+/*****************************************************************/
+/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!!           ***/
+/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION.             ***/
+/***    + Base level indent should begin at left margin, as    ***/
+/***      the require_once below looks.                        ***/
+/***    + All identation should consist of four space blocks   ***/
+/***    + Tab characters are evil.                             ***/
+/***    + all comments should use "slash-star ... star-slash"  ***/
+/***      style -- no pound characters, no slash-slash style   ***/
+/***    + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD      ***/
+/***      ALWAYS USE { AND } CHARACTERS!!!                     ***/
+/***    + Please use ' instead of ", when possible. Note "     ***/
+/***      should always be used in _( ) function calls.        ***/
+/*** Thank you for your help making the SM code more readable. ***/
+/*****************************************************************/
 
-   $dm = sqimap_get_delimiter($imapConnection);
-   if (substr($old, strlen($old) - strlen($dm)) == $dm) {
+require_once('../src/validate.php');
+require_once('../functions/imap.php');
+
+   $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+
+   global $delimiter;
+   if (substr($old, strlen($old) - strlen($delimiter)) == $delimiter) {
       $isfolder = true;
       $old = substr($old, 0, strlen($old) - 1);
    }
    
-   if (strpos($old, $dm)) {
-      $old_name = substr($old, strrpos($old, $dm)+1, strlen($old));
-      $old_parent = substr($old, 0, strrpos($old, $dm));
+   if (strpos($old, $delimiter)) {
+      $old_name = substr($old, strrpos($old, $delimiter)+1, strlen($old));
+      $old_parent = substr($old, 0, strrpos($old, $delimiter));
    } else {
       $old_name = $old;
       $old_parent = "";
    }
 
-   echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
-   displayPageHeader($color, "None");
-   echo "<TABLE WIDTH=100% COLS=1>";
+   displayPageHeader($color, 'None');
+   echo "<br><TABLE align=center border=0 WIDTH=95% COLS=1>";
    echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
    echo _("Rename a folder");
    echo "</B></TD></TR>";
    echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
-   echo "<FORM ACTION=folders_rename_do.php METHOD=POST>\n";
+   echo "<FORM ACTION=\"folders_rename_do.php\" METHOD=\"POST\">\n";
    echo _("New name:");
-   echo " &nbsp;&nbsp;<INPUT TYPE=TEXT SIZE=25 NAME=new_name VALUE=\"$old_name\"><BR>\n";
-   if ($isfolder)
+   echo "<br><B>$old_parent . </B><INPUT TYPE=TEXT SIZE=25 NAME=new_name VALUE=\"$old_name\"><BR>\n";
+   if (isset($isfolder))
       echo "<INPUT TYPE=HIDDEN NAME=isfolder VALUE=\"true\">";
-   echo "<INPUT TYPE=HIDDEN NAME=orig VALUE=\"$old\">";
-   echo "<INPUT TYPE=SUBMIT VALUE=\"";
-   echo _("Submit");
-   echo "\">\n";
+   printf("<INPUT TYPE=HIDDEN NAME=orig VALUE=\"%s\">\n", $old);
+   printf("<INPUT TYPE=HIDDEN NAME=old_name VALUE=\"%s\">\n", $old_name);
+   echo "<INPUT TYPE=SUBMIT VALUE=\""._("Submit")."\">\n";
    echo "</FORM><BR></TD></TR>";
    echo "</TABLE>";
 
    /** Log out this session **/
    sqimap_logout($imapConnection);
 ?>
-
-