[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/felamimail/inc/ -> hook_notifywindow.inc.php (source)

   1  <?php
   2      /**************************************************************************\
   3      * eGroupWare - FeLaMiMail                                                  *
   4      * http://www.egroupware.org                                                *
   5      * --------------------------------------------                             *
   6      * This program is free software; you can redistribute it and/or modify it  *
   7      * under the terms of the GNU General Public License as published by the    *
   8      * Free Software Foundation; version 2 of the License                       *
   9      \**************************************************************************/
  10  
  11      /* $Id: hook_notifywindow.inc.php 18876 2005-07-23 15:52:49Z ralfbecker $ */
  12  
  13      $d1 = strtolower(substr(APP_INC,0,3));
  14      if($d1 == 'htt' || $d1 == 'ftp' )
  15      {
  16          echo "Failed attempt to break in via an old Security Hole!<br>\n";
  17          $GLOBALS['egw']->common->egw_exit();
  18      }
  19      unset($d1);
  20  
  21      if (@$GLOBALS['egw_info']['user']['apps']['felamimail'])
  22      {
  23          $my_msg_bootstrap = '';
  24  
  25          $my_msg_bootstrap =& CreateObject("felamimail.bofelamimail");
  26  
  27          $connectionStatus = $my_msg_bootstrap->openConnection('INBOX',OP_READONLY);
  28  
  29          $folderStatus = $my_msg_bootstrap->getFolderStatus('INBOX');
  30          #_debug_array($folderStatus);
  31          $my_msg_bootstrap->closeConnection();
  32          
  33          $current_uid=$folderStatus['uidnext'];
  34          
  35          $oldUidNext=$GLOBALS['egw']->session->appsession('notifywindow','felamimail');
  36          
  37          #if(!empty($old_uid))
  38          #{
  39          #    $new_msgs=$current_id-$old_id;
  40          #}
  41          #else
  42          #{
  43          #     $new_msgs=$inbox_data['number_new'];
  44          #}
  45          
  46          if ($connectionStatus == True)
  47          {
  48              // we reload the notify window, because after i did click on the CheckEmail link
  49              // it did not refresh itself anymore
  50              echo '<script language="JavaScript">'."\n";
  51              echo '    <!-- Activate Cloaking Device'."\n";
  52              echo '    function CheckEmail()'."\n";
  53              echo '    {'."\n";
  54              echo '        window.opener.document.location.href="'.$GLOBALS['egw']->link('/index.php','menuaction=felamimail.uifelamimail.viewMainScreen').'";'."\n";
  55              echo '        window.opener.focus()'."\r\n";
  56              #echo '          window.resizeTo(1,1);'."\r\n";
  57              echo '          window.blur();'."\r\n";
  58              echo '        location.reload()'."\n";
  59              echo '    }'."\n";
  60              echo '    //-->'."\n";
  61              echo '    </script>'."\n";
  62              echo "\r\n" . '<tr><td align="left"><!-- Mailbox info X10 -->' . "\r\n";
  63              echo '<table width="100%" style="border-color:#000000;border-style:solid;border-width:1px;"><tr>'."\r\n";
  64              echo '<td width="20%" valign="middle" align="center">'."\r\n";
  65              echo '<a href="JavaScript:CheckEmail();"><img src="'.$GLOBALS['egw']->common->image('felamimail','navbar').'" alt="email icon" border=0></a>'."\r\n";
  66              echo "<td>\r\n";
  67  
  68              if($folderStatus[recent]>0)
  69              {
  70                   echo '<a href="JavaScript:CheckEmail();"><b>'.lang('new').':</b> '.$folderStatus[recent].'</a><br>';
  71                   
  72                   if($oldUidNext != $folderStatus['uidnext'] || $folderStatus[recent]>0)
  73                  {
  74                      $urgent = True;
  75                  }
  76              }
  77              else
  78              {
  79                   echo '<a href="JavaScript:CheckEmail();"><b>'.lang('new').':</b> '.lang('None').'</a><br>'."\r\n";
  80              }
  81              
  82              if($folderStatus[unseen]>0)
  83              {
  84                   echo '<a href="JavaScript:CheckEmail();"><b>'.lang('unread').':</b> '.$folderStatus[unseen].'</a><br>'."\r\n";
  85              }
  86              else
  87              {
  88                   echo '<a href="JavaScript:CheckEmail();"><b>'.lang('unread').':</b> '.lang('None').'</a><br>'."\r\n";
  89              }
  90  
  91               echo '<a href="JavaScript:CheckEmail();"><b>INBOX:</b> '.$folderStatus[messages].'</a>'."\r\n";
  92  
  93              if($urgent == True)
  94              {
  95                  echo '<script type="text/javascript" language="Javascript 1.3">'."\r\n";
  96                  echo 'document.bgcolor="#666666";'."\r\n";
  97                  #echo 'window.resizeTo(300,170);'."\r\n";
  98                  echo 'window.focus();'."\r\n";
  99                  echo '</script>'."\r\n";
 100              }
 101  
 102              echo "</td></tr></table>\r\n";
 103              echo "\r\n".'<!-- Mailox info --></td></tr>'."\r\n";
 104          }
 105          $GLOBALS['egw']->session->appsession('notifywindow','felamimail',$folderStatus['uidnext']);
 106      }
 107  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7