Seems I forgot to add a file.....
authorcigamit <cigamit@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 1 Dec 2003 20:54:52 +0000 (20:54 +0000)
committercigamit <cigamit@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 1 Dec 2003 20:54:52 +0000 (20:54 +0000)
Since people seem to be having an uproar over this,
I will be removing it, and adding a seperate branch....

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6227 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/noframes.php [new file with mode: 0644]

diff --git a/functions/noframes.php b/functions/noframes.php
new file mode 100644 (file)
index 0000000..6c98bb8
--- /dev/null
@@ -0,0 +1,105 @@
+<?php
+/**
+ * noframes.php
+ *
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * This code makes SM No Frames compatible
+ *
+ * $Id$
+ * @package squirrelmail
+ */
+
+require_once(SM_PATH . 'functions/imap.php');
+
+global $use_frames, $allow_frames;
+sqgetGlobalVar('use_frames', $use_frames, SQ_COOKIE);
+
+switch ($allow_frames) {
+   case 4:    // if $use_frames unset, fall through to case 2
+      if (isset($use_frames))
+         break;
+   case 2:    // Do not use frames
+      $use_frames = 0;
+      break;
+   case 3:    // if $use_frames unset, fall through to case 1
+      if (isset($use_frames))
+         break;
+   default:   // default is also to use frames
+   case 1:    // use frames
+      $use_frames = 1;
+      break;
+}
+
+
+/**
+ * Displays the top html header or the left folder list
+ * if not using frames
+ *
+ * @return void
+ */
+function noframes_top() {
+    global $onetimepad, $password, $username, $domain, $trash_folder, $imapConnection,
+        $sent_folder, $draft_folder, $imapServerAddress, $imapPort, $left_size, 
+        $key, $delimiter, $color, $use_frames, $location_of_bar,
+        $auto_create_special, $date_format, $hour_format, $collapse_folders, $boxes;
+    if ($use_frames) return;
+    $size = $left_size - 20;
+    if ($location_of_bar == 'left' || $location_of_bar != 'right') {
+        $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); // the 10 is to hide the output
+        echo "<table width='100%' cellpadding=3 cellspacing=5 border=0>\n";
+        echo "<tr><td width='$size'><img src='" . SM_PATH . "images/blank.gif' width=$size height=1 border=0></td>";
+       echo "<td width='15'><img src='" . SM_PATH . "images/blank.gif' width=15 height=1 border=0></td>";
+       echo "<td width='100%'><img src='" . SM_PATH . "images/blank.gif' width=1 height=1 border=0></td></tr>";
+        echo "<tr><td valign=top>\n";
+        do_hook('left_main_before');
+        echo "<table cellpadding=0 width='100%'><tr><td><table cellpadding=1 cellspacing=0 width='100%'><tr bgcolor='$color[0]'>";
+       echo "<td><table width='100%' border=0 cellpadding=3 cellspacing=0>\n";
+        echo "<tr><td BGCOLOR='".$color[9]."' align=center>\n";
+        echo "<B>" . _("Folders") . "</B></td></tr><tr bgcolor='$color[4]'><td>\n";
+        require_once(SM_PATH . 'src/left_main.php');
+        echo "<br>\n</td></tr></table></td></tr></table></td></tr></table><br>\n";
+        do_hook('left_main_after');
+        echo "</td><td><img src='" . SM_PATH . "images/blank.gif' width=15 height=1 border=0></td></td><td valign=top>\n\n";
+    } else {
+        echo "<table width='100%' cellpadding=3 cellspacing=5 border=0>\n";
+        echo "<tr><td width='100%'></td><td width='15'><img src='" . SM_PATH . "images/blank.gif' width=15 height=1 border=0></td>";
+       echo "<td width='$size'><img src='" . SM_PATH . "images/blank.gif' width=$size height=1 border=0></td></tr>";
+        echo "<tr><td valign=top>\n\n";
+    }
+}
+
+/**
+ * Displays the bottom html header or the right folder list
+ * if not using frames
+ *
+ * @return void
+ */
+
+function noframes_bottom() {
+    global $onetimepad, $password, $username, $domain, $trash_folder, $imapConnection,
+        $sent_folder, $draft_folder, $imapServerAddress, $imapPort, $left_size, 
+        $key, $delimiter, $color, $use_frames, $location_of_bar,
+        $auto_create_special, $date_format, $hour_format, $collapse_folders, $boxes;
+    if ($use_frames) return;
+    if ($location_of_bar == 'left' || $location_of_bar != 'right') {
+        echo "</td></tr></table>\n";
+       echo "</body></html>";
+    } else {
+        $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); // the 10 is to hide the output
+        echo "</td><td><img src='" . SM_PATH . "images/blank.gif' width=15 height=1 border=0></td></td><td valign=top>\n\n";
+        do_hook('left_main_before');
+        echo "<table cellpadding=0 width='100%'><tr><td><table cellpadding=1 cellspacing=0 width='100%'><tr bgcolor='$color[0]'>";
+       echo "<td><table width='100%' border=0 cellpadding=3 cellspacing=0>\n";
+        echo "<tr><td BGCOLOR='".$color[9]."' align=center>\n";
+        echo "<B>" . _("Folders") . "</B></td></tr><tr bgcolor='$color[4]'><td>\n";
+        require_once(SM_PATH . 'src/left_main.php');
+        echo "<br>\n</td></tr></table></td></tr></table></td></tr></table><br>\n";
+        do_hook('left_main_after');
+        echo "</td></tr></table>\n";
+       echo "</body></html>\n";
+    }
+}
+
+?>
\ No newline at end of file