2
/////////////////////////////////////////////////////////
6
// (C)Copyright 2000-2002 Ryo Chijiiwa <Ryo@IlohaMail.org>
8
// This file is part of IlohaMail.
9
// IlohaMail is free software released under the GPL
10
// license. See enclosed file COPYING for details,
11
// or see http://www.fsf.org/copyleft/gpl.html
13
/////////////////////////////////////////////////////////
15
/********************************************************
17
AUTHOR: Ryo Chijiiwa <ryo@ilohamail.org>
20
This is the tool bar. Provides global access to main functionality, including:
21
1. Access to folder list, or folder contents (including INBOX)
22
2. Access to message composition page (link to "source/compose.php")
23
3. Access to search form (link to "source/search_form.php")
24
4. Access to contacts list (link to "source/contacts.php")
25
5. Access to preferences (link to "source/prefs.php")
30
Depending on whether or not "list_folders" preferences is enabled or not, this page
31
may display a pop-up menu of all folders, or a link to source/folders.php.
32
If the protocol does not support a given feature, it will not be displayed (e.g. "Folders"
33
and "Search" links will not be shown for POP3 accounts).
35
********************************************************/
37
include("../include/super2global.inc");
38
include("../include/nocache.inc");
40
function showLink($a){
41
echo $a[3]."<a href=\"".$a[0]."\" target=\"".$a[1]."\" class=\"menuText\">".$a[2]."</a>\n";
45
include_once("../include/ryosimap.inc");
46
include_once("../include/encryption.inc");
47
include_once("../include/session_auth.inc");
48
include_once("../include/icl.inc");
49
include_once("../lang/".$my_prefs["lang"]."tool.inc");
51
$linkc=$my_colors["tool_link"];
52
$bgc=$my_colors["tool_bg"];
53
$font_size = $my_colors["menu_font_size"];
54
$bodyString='<BODY LEFTMARGIN=0 RIGHTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 BGCOLOR="'.$bgc.'" TEXT="'.$linkc.'" LINK="'.$linkc.'" ALINK="'.$linkc.'" VLINK="'.$linkc.'">';
56
echo "User not specified.";
62
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=<?php echo $my_prefs["charset"]; ?>">
65
include("../include/css.inc");
71
$div = "<span class=\"menuText\"> | </span>";
73
if (($my_prefs["list_folders"])||(!$ICL_CAPABILITY["folders"])){
74
$links[] = array("main.php?folder=INBOX&user=$user", "list2", $toolStrings["inbox"], " ");
75
//if ($ICL_CAPABILITY["folders"])
76
//$links[] = array("folders.php?user=$user", "list1", $toolStrings["folders"], $div);
78
$target = ($my_prefs["compose_inside"]?"list2":"_blank");
79
$links[] = array("compose2.php?user=$user", $target, $toolStrings["compose"], $div);
80
if (($ICL_CAPABILITY["calendar"]) && (!$DISABLE_CALENDAR))
81
$links[] = array("calendar.php?user=$user", "list2", $toolStrings["calendar"], $div);
82
$links[] = array("contacts.php?user=$user", "list2", $toolStrings["contacts"], $div);
83
if (!$DISABLE_BOOKMARKS)
84
$links[] = array("bookmarks.php?user=$user", "list2", $toolStrings["bookmarks"], $div);
85
if ($ICL_CAPABILITY["search"])
86
$links[] = array("search_form.php?user=$user", "list2", $toolStrings["search"], $div);
87
$links[] = array("prefs.php?user=$user", "list2", $toolStrings["prefs"], $div);
89
echo "\n<form method=POST action=\"main.php\" target=\"list2\">\n";
91
<table width="100%"><tr class="menuText"><td valign="bottom">
93
if ((!$my_prefs["list_folders"]) && ($ICL_CAPABILITY["folders"])){
94
echo "<input type=hidden name=\"sort_field\" value=\"".$my_prefs["sort_field"]."\">\n";
95
echo "<input type=hidden name=\"sort_order\" value=\"".$my_prefs["sort_order"]."\">\n";
96
echo "<input type=hidden name=\"user\" value=\"".$user."\">\n";
98
$conn = iil_Connect($host, $loginID, $password, $AUTH_MODE);
100
include_once("../include/cache.inc");
101
$cached_folders = cache_read($loginID, $host, "folders");
102
if (is_array($cached_folders)){
103
echo "<!-- Read cache! //-->\n";
104
$folderlist = $cached_folders;
106
echo "<!-- No cache...";
107
if ($my_prefs["hideUnsubscribed"]) $folderlist = iil_C_ListSubscribed($conn, $my_prefs["rootdir"], "*");
108
else $folderlist = iil_C_ListMailboxes($conn, $my_prefs["rootdir"], "*");
109
$cache_result = cache_write($loginID, $host, "folders", $folderlist);
110
echo "write: $cache_result //-->\n";
112
//$folderlist=iil_C_ListMailboxes($conn, $my_prefs["rootdir"], "*");
115
if ($my_prefs["list_folders"]!=1){
116
include("../lang/".$my_prefs["lang"]."defaultFolders.inc");
117
echo "<select name=folder>\n";
118
RootedFolderOptions($folderlist, $defaults, $my_prefs["rootdir"]);
120
echo "<input type=submit value=\"".$toolStrings["go"]."\">";
122
$link = array("edit_folders.php?user=$user", "list2", $toolStrings["folders"]);
125
while ( list($k,$v) = each($links) ){
126
//echo "<span class=\"menuText\"> | </span>";
127
showLink($links[$k]);
129
//echo "<span class=\"menuText\"> | </span>";
131
</td><td align="right" valign="bottom">
132
<A HREF="login.php?logout=1&user=<?php echo $user?>" target="_top" class="menuText"><?php echo $toolStrings["logout"]?></A>