phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: felamimail/inc class.bocaching.inc.php,1.1.1.1.2


From: Lars Kneschke <address@hidden>
Subject: [Phpgroupware-cvs] CVS: felamimail/inc class.bocaching.inc.php,1.1.1.1.2.2,1.1.1.1.2.2.8.1 class.bofelamimail.inc.php,1.2.2.12,1.2.2.12.2.1 class.socaching.inc.php,1.1.1.1.2.7,1.1.1.1.2.7.2.1 class.uidisplay.inc.php,1.1.2.4,1.1.2.4.2.1 class.uifelamimail.inc.php,1.2.2.12.2.1,1.2.2.12.2.2 hook_settings.inc.php,1.1.2.3.2.1,1.1.2.3.2.2
Date: Fri, 02 May 2003 02:57:10 -0400

Update of /cvsroot/phpgroupware/felamimail/inc
In directory subversions:/tmp/cvs-serv32231/inc

Modified Files:
      Tag: Version-0_9_16-branch
        class.bocaching.inc.php class.bofelamimail.inc.php 
        class.socaching.inc.php class.uidisplay.inc.php 
        class.uifelamimail.inc.php hook_settings.inc.php 
Log Message:
make felamimail working 0.9.16
and merge my last changes 



Index: class.bocaching.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.bocaching.inc.php,v
retrieving revision 1.1.1.1.2.2
retrieving revision 1.1.1.1.2.2.8.1
diff -C2 -r1.1.1.1.2.2 -r1.1.1.1.2.2.8.1
*** class.bocaching.inc.php     4 Jun 2002 12:15:23 -0000       1.1.1.1.2.2
--- class.bocaching.inc.php     2 May 2003 06:57:07 -0000       1.1.1.1.2.2.8.1
***************
*** 102,110 ****
                        return $this->socaching->getMessageCounter($_filter);
                }
! 
                function removeFromCache($_uid)
                {
                        $this->socaching->removeFromCache($_uid);
                }               
                // expects the result from imap_status ($mbox, 
"{".$imapServerAddress.":$imapPort}$mailbox", SA_ALL);
                function updateImapStatus($_status)
--- 102,116 ----
                        return $this->socaching->getMessageCounter($_filter);
                }
!               
!               function getNextMessage($_uid, $_sort, $_filter)
!               {
!                       return $this->socaching->getNextMessage($_uid, $_sort, 
$_filter);
!               }
!               
                function removeFromCache($_uid)
                {
                        $this->socaching->removeFromCache($_uid);
                }               
+               
                // expects the result from imap_status ($mbox, 
"{".$imapServerAddress.":$imapPort}$mailbox", SA_ALL);
                function updateImapStatus($_status)

Index: class.bofelamimail.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.bofelamimail.inc.php,v
retrieving revision 1.2.2.12
retrieving revision 1.2.2.12.2.1
diff -C2 -r1.2.2.12 -r1.2.2.12.2.1
*** class.bofelamimail.inc.php  11 Mar 2003 00:20:32 -0000      1.2.2.12
--- class.bofelamimail.inc.php  2 May 2003 06:57:07 -0000       1.2.2.12.2.1
***************
*** 78,82 ****
                        #$result = @imap_append($this->mbox, $mailboxString, 
"$header"."$_body");
                        $result = @imap_append($this->mbox, $mailboxString, 
"$header"."$body");
!                       print imap_last_error();
                        return $result;
                }
--- 78,82 ----
                        #$result = @imap_append($this->mbox, $mailboxString, 
"$header"."$_body");
                        $result = @imap_append($this->mbox, $mailboxString, 
"$header"."$body");
!                       #print imap_last_error();
                        return $result;
                }
***************
*** 93,100 ****
                        {
                                case "imap":
-                                       #$mailboxString = 
sprintf("{%s:%s/novalidate-cert}%s",
-                                       #               
$this->mailPreferences['imapServerAddress'],
-                                       #               
$this->mailPreferences['imapPort'],
-                                       #               $_folderName);
                                        $mailboxString = sprintf("{%s:%s}%s",
                                                        
$this->mailPreferences['imapServerAddress'],
--- 93,96 ----
***************
*** 162,166 ****
                                return $string;
                        }
!                       /* Decode from qp */
                        elseif (preg_match_all("/\=\?(.*?)\?q\?(.*?)\?\=/i", 
$string, $matches, PREG_SET_ORDER))
                        {
--- 158,162 ----
                                return $string;
                        }
!                       /* Decode from qouted printable */
                        elseif (preg_match_all("/\=\?(.*?)\?q\?(.*?)\?\=/i", 
$string, $matches, PREG_SET_ORDER))
                        {
***************
*** 172,176 ****
                                        // replace any _ with " ". You define " 
" as " " or "_" in qouted printable
                                        $matches[$i][2] = str_replace("_"," 
",$matches[$i][2]);
!                                       $string = 
str_replace($matches[$i][0],imap_qprint($matches[$i][2]),$string);
                                }
                                return $string;
--- 168,180 ----
                                        // replace any _ with " ". You define " 
" as " " or "_" in qouted printable
                                        $matches[$i][2] = str_replace("_"," 
",$matches[$i][2]);
!                                       switch($matches[$i][1])
!                                       {
!                                               case 'utf-8':
!                                                       $string = 
str_replace($matches[$i][0],utf8_decode(imap_qprint($matches[$i][2])),$string);
!                                                       break;
!                                               default:
!                                                       $string = 
str_replace($matches[$i][0],imap_qprint($matches[$i][2]),$string);
!                                                       break;
!                                       }
                                }
                                return $string;
***************
*** 408,411 ****
--- 412,417 ----
                        if(is_array($list))
                        {
+                               // return always the inbox
+                               $folders['INBOX'] = 'INBOX';
                                reset($list);
                                while (list($key, $val) = each($list))
***************
*** 437,440 ****
--- 443,452 ----
                        else
                        {
+                               if($_subscribedOnly == 'true' && 
+                                       
is_array(imap_list($this->mbox,$mailboxString,'INBOX')))
+                               {
+                                       $folders['INBOX'] = 'INBOX';
+                                       return $folders;
+                               }
                                return false;
                        }
***************
*** 690,693 ****
--- 702,706 ----
                                        if(isset($newPart)) 
                                        {
+                                       #print $value['charset']."<br>";
                                        switch ($value['encoding']) 
                                        {
***************
*** 698,702 ****
                                                case ENCQUOTEDPRINTABLE:
                                                        // use imap_qprint to 
decode
!                                                       $newPart = 
imap_qprint($newPart);
                                                        break;
                                                case ENCOTHER:
--- 711,723 ----
                                                case ENCQUOTEDPRINTABLE:
                                                        // use imap_qprint to 
decode
!                                                       
switch(strtolower($value['charset']))
!                                                       {
!                                                               case 'utf-8':
!                                                                       
$newPart = utf8_decode(imap_qprint($newPart));
!                                                                       break;
!                                                               default:
!                                                                       
$newPart = imap_qprint($newPart);
!                                                                       break;
!                                                       }
                                                        break;
                                                case ENCOTHER:
***************
*** 756,759 ****
--- 777,793 ----
                }
                
+               // return the qouta of the users INBOX
+               function getQuotaRoot()
+               {
+                       if(is_array($this->storageQuota))
+                       {
+                               return $this->storageQuota;
+                       }
+                       else
+                       {
+                               return false;
+                       }
+               }
+               
                function imap_createmailbox($_folderName, $_subscribe = False)
                {
***************
*** 781,784 ****
--- 815,832 ----
                }
  
+               function imapGetQuota($_username)
+               {
+                       $quota_value = @imap_get_quota($this->mbox, 
"user.".$_username);
+ 
+                       if(is_array($quota_value) && count($quota_value) > 0)
+                       {
+                               return array('limit' => 
$quota_value['limit']/1024);
+                       }
+                       else
+                       {
+                               return false;
+                       }
+               }               
+               
                function imap_get_quotaroot($_folderName)
                {
***************
*** 803,806 ****
--- 851,868 ----
                }
                
+               function imapSetQuota($_username, $_quotaLimit)
+               {
+                       if(is_numeric($_quotaLimit) && $_quotaLimit >= 0)
+                       {
+                               // enable quota
+                               $quota_value = imap_set_quota($this->mbox, 
"user.".$_username, $_quotaLimit*1024);
+                       }
+                       else
+                       {
+                               // disable quota
+                               $quota_value = imap_set_quota($this->mbox, 
"user.".$_username, -1);
+                       }
+               }
+               
                function moveMessages($_foldername, $_messageUID)
                {
***************
*** 841,846 ****
                }
  
!               function openConnection($_folderName='',$_options=0)
                {
                        if($_folderName == '')
                        {
--- 903,909 ----
                }
  
!               function openConnection($_folderName='', $_options=0, 
$_adminConnection=false)
                {
+                       
                        if($_folderName == '')
                        {
***************
*** 848,855 ****
                        }
                        
!                       $mailboxString = 
$this->createMailboxString($_folderName);
                        
!                       if(!$this->mbox = @imap_open ($mailboxString, 
!                                       $this->mailPreferences['username'], 
$this->mailPreferences['key'], $_options))
                        {
                                return imap_last_error();
--- 911,936 ----
                        }
                        
!                       if($_adminConnection)
!                       {
!                               $config = 
CreateObject('phpgwapi.config','qmailldap');
!                               $config->read_repository();
!                               $qmailldapConfig = $config->config_data;
!                               
!                               $folderName     = '';
!                               $username       = 
$qmailldapConfig['imapAdminUser'];
!                               $password       = 
$qmailldapConfig['imapAdminPassword'];
!                               $options        = '';
!                       }
!                       else
!                       {
!                               $folderName     = $_folderName;
!                               $username       = 
$this->mailPreferences['username'];
!                               $password       = $this->mailPreferences['key'];
!                               $options        = $_options;
!                       }
                        
!                       $mailboxString = 
$this->createMailboxString($_folderName);
! 
!                       if(!$this->mbox = imap_open ($mailboxString, $username, 
$password, $options))
                        {
                                return imap_last_error();
***************
*** 857,862 ****
                        else
                        {
!                               #$header = imap_headerinfo($this->mbox, 107);
!                               
#print"<pre>";print_r($header);print"</pre>";exit;
                                return True;
                        }
--- 938,950 ----
                        else
                        {
!                               // get the quota for this mailboxbox
!                               if (function_exists('imap_get_quotaroot'))
!                               {
!                                       $quota = 
imap_get_quotaroot($this->mbox, $_folderName);
!                                       if(is_array($quota['STORAGE'])) 
!                                       {
!                                               $storage = $this->storageQuota 
= $quota['STORAGE'];
!                                       }
!                               }
                                return True;
                        }
***************
*** 1020,1027 ****
                                                        {
                                                                $param = 
$this_part->parameters[$lcv];
!                                                               if 
(strtolower($param->attribute) == "name") 
                                                                {
!                                                                       
$this->structure[$part_no]["name"] = $param->value;
!                                                                       break;
                                                                }
                                                        }
--- 1108,1121 ----
                                                        {
                                                                $param = 
$this_part->parameters[$lcv];
!                                                               
switch(strtolower($param->attribute))
                                                                {
!                                                                       case 
'name':
!                                                                               
$this->structure[$part_no]["name"] = $param->value;
!                                                                               
break;
!                                                                       
!                                                                       case 
'charset':
!                                                                               
$this->structure[$part_no]["charset"] = $param->value;
!                                                                               
break;
!                                                                               
                                                                }
                                                        }
***************
*** 1157,1160 ****
--- 1251,1255 ----
                                                case ENCQUOTEDPRINTABLE:
                                                        // use imap_qprint to 
decode
+                                                       #print "qp<br>";
                                                        break;
                                                case ENCOTHER:

Index: class.socaching.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.socaching.inc.php,v
retrieving revision 1.1.1.1.2.7
retrieving revision 1.1.1.1.2.7.2.1
diff -C2 -r1.1.1.1.2.7 -r1.1.1.1.2.7.2.1
*** class.socaching.inc.php     11 Mar 2003 00:20:32 -0000      1.1.1.1.2.7
--- class.socaching.inc.php     2 May 2003 06:57:07 -0000       1.1.1.1.2.7.2.1
***************
*** 48,77 ****
                }
                
!               function getHeaders($_firstMessage='', $_numberOfMessages='', 
$_sort='', $_filter='')
                {
-                       switch($_sort)
-                       {
-                               case "0":
-                                       $sort = "order by date desc";
-                                       break;
-                               case "1":
-                                       $sort = "order by date asc";
-                                       break;
-                               case "2":
-                                       $sort = "order by sender_address desc";
-                                       break;
-                               case "3":
-                                       $sort = "order by sender_address asc";
-                                       break;
-                               case "4":
-                                       $sort = "order by subject desc";
-                                       break;
-                               case "5":
-                                       $sort = "order by subject asc";
-                                       break;
-                               default:
-                                       $sort = "order by date desc";
-                       }
-                       
                        if(is_array($_filter))
                        {
--- 48,54 ----
                }
                
!               // create sql from the filter array
!               function getFilterSQL($_filter)
                {
                        if(is_array($_filter))
                        {
***************
*** 94,98 ****
--- 71,84 ----
                                }
                                $filter = " and ($filter) ";
+                               return $filter;
                        }
+                       return '';
+                       
+               }
+               
+               function getHeaders($_firstMessage='', $_numberOfMessages='', 
$_sort='', $_filter='')
+               {
+                       $sort = $this->getSortSQL($_sort);
+                       $filter = $this->getFilterSQL($_filter);
                        
                        $query = sprintf("select uid, date, subject, 
sender_name, sender_address, to_name, to_address, size, attachments from 
phpgw_felamimail_cache ".
***************
*** 200,203 ****
--- 186,258 ----
                        
                        return $this->db->f("count");
+               }
+               
+               // get the next message
+               function getNextMessage($_uid, $_sort='', $_filter='')
+               {
+                       $sort = $this->getSortSQL($_sort);
+                       $filter = $this->getFilterSQL($_filter);
+                       
+                       $query = sprintf("select uid, date, subject, 
sender_name, sender_address, to_name, to_address from phpgw_felamimail_cache ".
+                                        "where accountid='%s' and 
hostname='%s' and foldername = '%s' and accountname='%s' %s $sort",
+                                        $this->accountid, 
addslashes($this->hostname),
+                                        addslashes($this->foldername), 
addslashes($this->accountname),
+                                        $filter);
+ 
+                       $this->db->query($query,__LINE__,__FILE__);
+                       
+                       while($this->db->next_record())
+                       {
+                               // we found the current message
+                               if($this->db->f('uid') == $_uid)
+                               {
+                                       // jump to the next messages
+                                       if($this->db->next_record())
+                                       {
+                                               $retValue['next'] = 
$this->db->f('uid');
+                                       }
+                                       // we are done
+                                       if($retValue) return $retValue;
+                                       
+                                       // we should never get here
+                                       return false;
+                               }
+                               else
+                               {
+                                       // we found (maybe!) the previous 
message
+                                       $retValue['previous'] = 
$this->db->f('uid');
+                               }
+                       }
+                       
+                       // we should never get here
+                       return false;
+               }
+               
+               function getSortSQL($_sort)
+               {
+                       switch($_sort)
+                       {
+                               case "0":
+                                       $sort = "order by date desc";
+                                       break;
+                               case "1":
+                                       $sort = "order by date asc";
+                                       break;
+                               case "2":
+                                       $sort = "order by sender_address desc";
+                                       break;
+                               case "3":
+                                       $sort = "order by sender_address asc";
+                                       break;
+                               case "4":
+                                       $sort = "order by subject desc";
+                                       break;
+                               case "5":
+                                       $sort = "order by subject asc";
+                                       break;
+                               default:
+                                       $sort = "order by date desc";
+                       }
+                       return $sort;
                }
                

Index: class.uidisplay.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.uidisplay.inc.php,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.4.2.1
diff -C2 -r1.1.2.4 -r1.1.2.4.2.1
*** class.uidisplay.inc.php     11 Mar 2003 00:20:32 -0000      1.1.2.4
--- class.uidisplay.inc.php     2 May 2003 06:57:07 -0000       1.1.2.4.2.1
***************
*** 27,36 ****
--- 27,48 ----
                {
                        $this->t                = $GLOBALS['phpgw']->template;
+                       #$this->t               = 
CreateObject('phpgwapi.Template_Smarty',PHPGW_APP_TPL);
                        $this->bofelamimail     = 
CreateObject('felamimail.bofelamimail');
+                       $this->bofilter         = 
CreateObject('felamimail.bofilter');
+                       $this->bopreferences    = 
CreateObject('felamimail.bopreferences');
+                       $this->mailPreferences  = 
$this->bopreferences->getPreferences();
+                       
                        $this->bofelamimail->openConnection();
                        
                        $this->mailbox          = 
$this->bofelamimail->sessionData['mailbox'];
+                       $this->sort             = 
$this->bofelamimail->sessionData['sort'];
+                       
                        $this->uid              = 
$GLOBALS['HTTP_GET_VARS']['uid'];
  
+                       $this->bocaching        = 
CreateObject('felamimail.bocaching',
+                                                       
$this->mailPreferences['imapServerAddress'],
+                                                       
$this->mailPreferences['username'],
+                                                       $this->mailbox);
+ 
                        $this->rowColor[0] = 
$GLOBALS['phpgw_info']["theme"]["bg01"];
                        $this->rowColor[1] = 
$GLOBALS['phpgw_info']["theme"]["bg02"];
***************
*** 56,59 ****
--- 68,75 ----
                        $bodyParts      = 
$this->bofelamimail->getMessageBody($this->uid);
                        $attachments    = 
$this->bofelamimail->getMessageAttachments($this->uid);
+                       $filterList     = $this->bofilter->getFilterList();
+                       $activeFilter   = $this->bofilter->getActiveFilter();
+                       $filter         = $filterList[$activeFilter];
+                       $nextMessage    = 
$this->bocaching->getNextMessage($this->uid, $this->sort, $filter);
  
                        #print "<pre>";print_r($rawheaders);print"</pre>";exit;
***************
*** 109,112 ****
--- 125,130 ----
                        
$this->t->set_block('displayMsg','message_organization');
                        
$this->t->set_block('displayMsg','message_attachement_row');
+                       
$this->t->set_block('displayMsg','previous_message_block');
+                       $this->t->set_block('displayMsg','next_message_block');
                        
                        $this->translate();
***************
*** 114,118 ****
                        if(!isset($GLOBALS['HTTP_GET_VARS']['printable']))
                        {
- 
                                // navbar
                                $linkData = array
--- 132,135 ----
***************
*** 171,174 ****
--- 188,223 ----
                                );
                                
$this->t->set_var("link_printable",$GLOBALS['phpgw']->link('/index.php',$linkData));
+                               
+                               if($nextMessage['previous'])
+                               {
+                                       $linkData = array
+                                       (
+                                               'menuaction'    => 
'felamimail.uidisplay.display',
+                                               'showHeader'    => 'false',
+                                               'uid'           => 
$nextMessage['previous']
+                                       );
+                                       
$this->t->set_var('previous_url',$GLOBALS['phpgw']->link('/index.php',$linkData));
+                                       
$this->t->parse('previous_message','previous_message_block',True);
+                               }
+                               else
+                               {
+                                       
$this->t->set_var('previous_message','&nbsp');
+                               }
+       
+                               if($nextMessage['next'])
+                               {
+                                       $linkData = array
+                                       (
+                                               'menuaction'    => 
'felamimail.uidisplay.display',
+                                               'showHeader'    => 'false',
+                                               'uid'           => 
$nextMessage['next']
+                                       );
+                                       
$this->t->set_var('next_url',$GLOBALS['phpgw']->link('/index.php',$linkData));
+                                       
$this->t->parse('next_message','next_message_block',True);
+                               }
+                               else
+                               {
+                                       
$this->t->set_var('next_message','&nbsp');
+                               }
        
                                $langArray = array
***************
*** 327,331 ****
                        #$body = 
preg_replace("/((http(s?):\/\/)|(www\.))([\w\.,-.,\/.,\?.,\=.,&amp;]+)/ie", 
                        #       "'<a 
href=\"/phpgroupware/redirect.php?go='.htmlentities(urlencode('http$3://$4$5')).'\"
 target=\"_blank\"><font color=\"blue\">$2$4$5</font></a>'", $body);
!                       $body = 
preg_replace("/((http(s?):\/\/)|(www\.))([\w,\-,\/,\?,\=,\.,&amp;,!\n,\%,@,\*,#]+)/ie",
 
                                "'<a 
href=\"/phpgroupware/redirect.php?go='.htmlentities(urlencode('http$3://$4$5')).'\"
 target=\"_blank\"><font color=\"blue\">$2$4$5</font></a>'", $body);
                        
--- 376,380 ----
                        #$body = 
preg_replace("/((http(s?):\/\/)|(www\.))([\w\.,-.,\/.,\?.,\=.,&amp;]+)/ie", 
                        #       "'<a 
href=\"/phpgroupware/redirect.php?go='.htmlentities(urlencode('http$3://$4$5')).'\"
 target=\"_blank\"><font color=\"blue\">$2$4$5</font></a>'", $body);
!                       $body = 
preg_replace("/((http(s?):\/\/)|(www\.))([\w,\-,\/,\?,\=,\.,&amp;,!\n,\%,@,\*,#,:,~,\+]+)/ie",
 
                                "'<a 
href=\"/phpgroupware/redirect.php?go='.htmlentities(urlencode('http$3://$4$5')).'\"
 target=\"_blank\"><font color=\"blue\">$2$4$5</font></a>'", $body);
                        
***************
*** 339,342 ****
--- 388,394 ----
                                "<a href=\"file:$1$2\" target=\"_blank\"><font 
color=\"blue\">$1$2</font></a>", $body);
                        
+                       // make the signate light grey
+                       $body = preg_replace("/(--)/im","<font 
color=\"grey\">$1</font>", $body);
+                       
                        // create links for email addresses
                        $linkData = array
***************
*** 526,529 ****
--- 578,587 ----
                        $this->t->set_var("lang_save",lang('save'));
                        $this->t->set_var("lang_printable",lang('print it'));
+                       $this->t->set_var("lang_reply",lang('reply'));
+                       $this->t->set_var("lang_reply_all",lang('reply all'));
+                       $this->t->set_var("lang_forward",lang('forward'));
+                       $this->t->set_var("lang_delete",lang('delete'));
+                       
$this->t->set_var("lang_previous_message",lang('previous message'));
+                       $this->t->set_var("lang_next_message",lang('next 
message'));
                        
                        
$this->t->set_var("th_bg",$GLOBALS['phpgw_info']["theme"]["th_bg"]);

Index: class.uifelamimail.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.uifelamimail.inc.php,v
retrieving revision 1.2.2.12.2.1
retrieving revision 1.2.2.12.2.2
diff -C2 -r1.2.2.12.2.1 -r1.2.2.12.2.2
*** class.uifelamimail.inc.php  1 May 2003 18:33:25 -0000       1.2.2.12.2.1
--- class.uifelamimail.inc.php  2 May 2003 06:57:07 -0000       1.2.2.12.2.2
***************
*** 277,280 ****
--- 277,281 ----
                        $this->t->set_block('body','header_row');
                        $this->t->set_block('body','error_message');
+                       $this->t->set_block('body','quota_block');
  
                        $this->translate();
***************
*** 282,305 ****
                        $this->t->set_var('oldMailbox',$urlMailbox);
                        $this->t->set_var('image_path',PHPGW_IMAGES);
  
!                       $images = array(
!                               'sm_envelope',
                                'read_small',
                                'unread_small',
                                'unread_flagged_small',
                                'unread_small',
!                               'unread_deleted_small'
                        );
!                       
!                       while(list($key,$value) = each($images))
                        {
!                               
$this->t->set_var($value,$GLOBALS['phpgw']->common->image('felamimail',$value));
                        }
-                       
                        // refresh settings
                        $refreshTime = $preferences['refreshTime'];
                        if($refreshTime > 0)
                        {
!                               
$this->t->set_var('refreshTime',sprintf("setTimeout( \"refresh()\", %s 
);",$refreshTime*60*1000));
                        }
                        else
--- 283,352 ----
                        $this->t->set_var('oldMailbox',$urlMailbox);
                        $this->t->set_var('image_path',PHPGW_IMAGES);
+                       
+                       // ui for the quotas
+                       if($quota = $this->bofelamimail->getQuotaRoot())
+                       {
+                               if($quota['limit'] == 0)
+                               {
+                                       $quotaPercent=100;
+                               }
+                               else
+                               {
+                                       
$quotaPercent=round(($quota['usage']*100)/$quota['limit']);
+                               }
+                               
$quotaLimit=$this->show_readable_size($quota['limit']*1024);
+                               
$quotaUsage=$this->show_readable_size($quota['usage']*1024);
  
!                               $this->t->set_var('leftWidth',$quotaPercent);
!                               if($quotaPercent > 90)
!                               {
!                                       $this->t->set_var('quotaBG','red');
!                               }
!                               elseif($quotaPercent > 80)
!                               {
!                                       $this->t->set_var('quotaBG','yellow');
!                               }
!                               else
!                               {
!                                       $this->t->set_var('quotaBG','#33ff33');
!                               }
!                               
!                               if($quotaPercent > 50)
!                               {
!                                       
$this->t->set_var('quotaUsage_right','&nbsp;');
!                                       
$this->t->set_var('quotaUsage_left',$quotaUsage .'/'.$quotaLimit);
!                               }
!                               else
!                               {
!                                       
$this->t->set_var('quotaUsage_left','&nbsp;');
!                                       
$this->t->set_var('quotaUsage_right',$quotaUsage .'/'.$quotaLimit);
!                               }
!                               
!                               
$this->t->parse('quota_display','quota_block',True);
!                       }
!                       else
!                       {
!                               $this->t->set_var('quota_display','&nbsp;');
!                       }
!                       
!                       // set the images
!                       $listOfImages = array(
                                'read_small',
                                'unread_small',
                                'unread_flagged_small',
                                'unread_small',
!                               'unread_deleted_small',
!                               'sm_envelope'
                        );
! 
!                       foreach ($listOfImages as $image) 
                        {
!                               
$this->t->set_var($image,$GLOBALS['phpgw']->common->image('felamimail',$image));
                        }
                        // refresh settings
                        $refreshTime = $preferences['refreshTime'];
                        if($refreshTime > 0)
                        {
!                               $this->t->set_var('refreshTime',sprintf("aktiv 
= window.setTimeout( \"refresh()\", %s );",$refreshTime*60*1000));
                        }
                        else
***************
*** 422,426 ****
                                                
if($headers['header'][$i]['attachments'] == "true")
                                                {
!                                                       $image = '<img 
src="'.PHPGW_IMAGES.'/attach.gif" border="0">';
                                                        
$headers['header'][$i]['subject'] = 
"$image&nbsp;".$headers['header'][$i]['subject'];
                                                }
--- 469,473 ----
                                                
if($headers['header'][$i]['attachments'] == "true")
                                                {
!                                                       $image = '<img 
src="'.$GLOBALS['phpgw']->common->image('felamimail','attach').'" border="0">';
                                                        
$headers['header'][$i]['subject'] = 
"$image&nbsp;".$headers['header'][$i]['subject'];
                                                }
***************
*** 725,729 ****
  
                /* Returns a string showing the size of the message/attachment 
*/
!               function show_readable_size($bytes)
                {
                        $bytes /= 1024;
--- 772,776 ----
  
                /* Returns a string showing the size of the message/attachment 
*/
!               function show_readable_size($bytes, $_mode='short')
                {
                        $bytes /= 1024;
***************
*** 733,737 ****
                        {
                                $bytes /= 1024;
!                               $type = 'm';
                        }
                        
--- 780,784 ----
                        {
                                $bytes /= 1024;
!                               $type = 'M';
                        }
                        
***************
*** 745,749 ****
                                settype($bytes, 'integer');
                        
!                       return $bytes . '<small>&nbsp;' . $type . '</small>';
                }
                
--- 792,796 ----
                                settype($bytes, 'integer');
                        
!                       return $bytes . '&nbsp;' . $type ;
                }
                

Index: hook_settings.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/hook_settings.inc.php,v
retrieving revision 1.1.2.3.2.1
retrieving revision 1.1.2.3.2.2
diff -C2 -r1.1.2.3.2.1 -r1.1.2.3.2.2
*** hook_settings.inc.php       8 Apr 2003 19:47:26 -0000       1.1.2.3.2.1
--- hook_settings.inc.php       2 May 2003 06:57:07 -0000       1.1.2.3.2.2
***************
*** 37,41 ****
        create_select_box('Refresh time in minutes','refreshTime',$refreshTime);
  
!       create_text_area('email signature','email_sig',3,40);
  
        $sortOrder = array(
--- 37,41 ----
        create_select_box('Refresh time in minutes','refreshTime',$refreshTime);
  
!       create_text_area('email signature','email_sig',3,50);
  
        $sortOrder = array(





reply via email to

[Prev in Thread] Current Thread [Next in Thread]