Re-add some lint fixes
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 20 Jul 2009 04:15:59 +0000 (22:15 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 20 Jul 2009 19:16:02 +0000 (13:16 -0600)
33 files changed:
imp/acl.php
imp/ajax.php
imp/attachment.php
imp/compose.php
imp/config/hooks.php.dist
imp/contacts.php
imp/lib/Compose.php
imp/lib/Crypt/Pgp.php
imp/lib/Crypt/Smime.php
imp/lib/DIMP.php
imp/lib/Fetchmail.php
imp/lib/IMP.php
imp/lib/Identity/imp.php
imp/lib/Imap/Flags.php
imp/lib/Imap/Tree.php
imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php
imp/lib/Message.php
imp/lib/Mime/Viewer/Itip.php
imp/lib/Mime/Viewer/Plain.php
imp/lib/Mime/Viewer/Smil.php
imp/lib/Quota.php
imp/lib/Quota/Command.php
imp/lib/Quota/Mdaemon.php
imp/lib/Search.php
imp/lib/Spam.php
imp/lib/UI/Compose.php
imp/lib/Views/ListMessages.php
imp/lib/api.php
imp/mailbox.php
imp/message.php
imp/pgp.php
imp/test.php
imp/view.php

index 0682a88..cd75a8c 100644 (file)
@@ -179,8 +179,7 @@ if (empty($_SESSION['imp']['admin'])) {
         if (in_array($user, $current_users)) {
             continue;
         }
-        $new_user_field .= "\n" . '<option>' . htmlspecialchars($user)
-            . '</option>';
+        $new_user_field .= "\n<option>" . htmlspecialchars($user) . '</option>';
     }
     $new_user_field .= "\n</select>";
 }
index 12d6a0a..2c57588 100644 (file)
@@ -94,7 +94,7 @@ function _getListMessages($mbox, $change)
     }
 
     $list_msg = new IMP_Views_ListMessages();
-    $res = $list_msg->ListMessages($args);
+    $res = $list_msg->listMessages($args);
 
     // TODO: This can potentially be optimized for arrival time sort - if the
     // cache ID changes, we know the changes must occur at end of mailbox.
@@ -481,7 +481,7 @@ case 'ShowPreview':
     );
 
     $show_msg = new IMP_Views_ShowMessage();
-    $result = (object) $show_msg->showMessage($args);
+    $result = (object)$show_msg->showMessage($args);
     break;
 
 case 'Html2Text':
@@ -634,7 +634,7 @@ case 'PurgeDeleted':
         $expunge_count = count($expunged[$mbox]);
         $display_folder = IMP::displayFolder($mbox);
         if ($expunge_count == 1) {
-            $notification->push(sprintf(_("1 message was purged from \"%s\"."),  $display_folder), 'horde.success');
+            $notification->push(sprintf(_("1 message was purged from \"%s\"."), $display_folder), 'horde.success');
         } else {
             $notification->push(sprintf(_("%s messages were purged from \"%s\"."), $expunge_count, $display_folder), 'horde.success');
         }
@@ -656,7 +656,7 @@ case 'ModifyPollFolder':
     $imptree = IMP_Imap_Tree::singleton();
 
     $result = new stdClass;
-    $result->add = (bool) $add;
+    $result->add = (bool)$add;
     $result->folder = $mbox;
 
     if ($add) {
@@ -664,10 +664,10 @@ case 'ModifyPollFolder':
         if ($info = $imptree->getElementInfo($mbox)) {
             $result->poll = array($mbox => $info['unseen']);
         }
-        $notification->push(sprintf(_("\"%s\" mailbox now polled for new mail."),  $display_folder), 'horde.success');
+        $notification->push(sprintf(_("\"%s\" mailbox now polled for new mail."), $display_folder), 'horde.success');
     } else {
         $imptree->removePollList($mbox);
-        $notification->push(sprintf(_("\"%s\" mailbox no longer polled for new mail."),  $display_folder), 'horde.success');
+        $notification->push(sprintf(_("\"%s\" mailbox no longer polled for new mail."), $display_folder), 'horde.success');
     }
     break;
 
index f09ab74..9e6c96c 100644 (file)
@@ -67,7 +67,7 @@ if ($conf['compose']['link_attachments_notify']) {
     } else {
         /* Create a random identifier for this file. */
         $id = uniqid(mt_rand());
-        $res = $vfsroot->writeData($full_path, $file_name . '.notify' , $id, true);
+        $res = $vfsroot->writeData($full_path, $file_name . '.notify', $id, true);
         if (is_a($res, 'PEAR_Error')) {
             Horde::logMessage($res, __FILE__, __LINE__, PEAR_LOG_ERR);
         } else {
index 690f9cd..9520694 100644 (file)
@@ -446,7 +446,7 @@ case 'send_message':
 
     if (Horde_Util::getFormData('resume_draft') &&
         $prefs->getValue('auto_delete_drafts') &&
-        ($thismailbox == IMP::folderPref($prefs->getValue('drafts_folder'), true)))  {
+        ($thismailbox == IMP::folderPref($prefs->getValue('drafts_folder'), true))) {
         $imp_message = IMP_Message::singleton();
         $idx_array = array($index . IMP::IDX_SEP . $thismailbox);
         if ($imp_message->delete($idx_array)) {
@@ -520,9 +520,7 @@ case 'fwd_digest':
     if (!empty($indices)) {
         $msglist = unserialize(urldecode($indices));
         $subject_header = $imp_compose->attachIMAPMessage($msglist);
-        if ($subject_header === false) {
-            // TODO: notification
-        } else {
+        if ($subject_header !== false) {
             $header['subject'] = $subject_header;
         }
     }
@@ -842,7 +840,7 @@ if ($redirect) {
                 $entry['select_tabindex'] = ++$tabindex;
                 $entry['select_name'] = htmlspecialchars($to_item[0]);
                 $entry['select_to'] = array();
-                for ($i = 1; $i < count($to_item); $i++) {
+                for ($i = 1, $items = count($to_item); $i < $items; ++$i) {
                     $entry['select_to'][] = array('val' => htmlspecialchars($to_item[$i]));
                 }
             } else {
@@ -973,7 +971,7 @@ if ($redirect) {
                     $entry['select_tabindex'] = ++$tabindex;
                     $entry['select_name'] = htmlspecialchars($item[0]);
                     $entry['select_arr'] = array();
-                    for ($i = 1; $i < count($item); $i++) {
+                    for ($i = 1, $items = count($item); $i < $items; ++$i) {
                         $entry['select_arr'][] = array('val' => htmlspecialchars($item[$i]));
                     }
                     $entry['input_value'] = null;
@@ -1114,8 +1112,8 @@ if ($redirect) {
     $d_read = $prefs->getValue('disposition_request_read');
     $t->set('rrr', $conf['compose']['allow_receipts'] && ($d_read != 'never'));
     if ($t->get('rrr')) {
-       $t->set('rrr_selected', ($d_read != 'ask') || (Horde_Util::getFormData('request_read_receipt') == 'on'));
-       $t->set('rrr_label', Horde::label('rrr', _("Request a _Read Receipt")));
+        $t->set('rrr_selected', ($d_read != 'ask') || (Horde_Util::getFormData('request_read_receipt') == 'on'));
+        $t->set('rrr_label', Horde::label('rrr', _("Request a _Read Receipt")));
     }
 
     $t->set('compose_html', (!is_null($rtemode) && !$prefs->isLocked('compose_html')));
index cff3309..7a21a8e 100644 (file)
@@ -472,7 +472,8 @@ if (!empty($GLOBALS['conf']['kolab']['enabled'])) {
     }
 
     if (!function_exists('_imp_hook_display_folder')) {
-        function _imp_hook_display_folder($mailbox) {
+        function _imp_hook_display_folder($mailbox)
+        {
             $type = Kolab::getMailboxType($mailbox);
             return empty($type) || ($type == 'mail');
         }
index 55e40ab..f3de457 100644 (file)
@@ -73,7 +73,7 @@ if (count($source_list) > 1) {
     $template->set('multiple_source', true);
     $s_list = array();
     foreach ($source_list as $key => $select) {
-       $s_list[] = array('val' => $key, 'selected' => ($key == $source), 'label' => htmlspecialchars($select));
+        $s_list[] = array('val' => $key, 'selected' => ($key == $source), 'label' => htmlspecialchars($select));
     }
     $template->set('source_list', $s_list);
 } else {
index 245fdac..cc39f44 100644 (file)
@@ -575,7 +575,7 @@ class IMP_Compose
                 ((strpos($save_attach, 'prompt') === 0) &&
                  empty($opts['save_attachments']))) {
                 $mime_message->buildMimeIds();
-                for ($i = 2; ; ++$i) {
+                for ($i = 2;; ++$i) {
                     if (!($oldPart = $mime_message->getPart($i))) {
                         break;
                     }
@@ -1310,7 +1310,7 @@ class IMP_Compose
                 " ---------\n" .
                 $this->_getMsgHeaders($h) . "\n\n";
 
-            $msg_post = "\n\n" . '----- ' .
+            $msg_post = "\n\n----- " .
                 ($from ? sprintf(_("End message from %s"), $from) : _("End message")) .
                 " -----\n";
         } else {
@@ -1318,7 +1318,6 @@ class IMP_Compose
             $msg_post = '';
         }
 
-
         $compose_html = $GLOBALS['prefs']->getValue('compose_html');
 
         $msg_text = $this->_getMessageText($contents, array(
@@ -2154,7 +2153,7 @@ class IMP_Compose
         if ($part->getPrimaryType() == 'multipart') {
             $mixed_part = new Horde_Mime_Part();
             $mixed_part->setType('multipart/mixed');
-            $mixed_part->addPart(part);
+            $mixed_part->addPart($part);
 
             $link_part = new Horde_Mime_Part();
             $link_part->setType('text/plain');
@@ -2452,9 +2451,6 @@ class IMP_Compose
     /**
      * Formats the address properly.
      *
-     * This method can be called statically, i.e.:
-     *   $ret = IMP_Compose::formatAddr();
-     *
      * @param string $addr  The address to format.
      *
      * @return string  The formatted address.
@@ -2473,9 +2469,6 @@ class IMP_Compose
      * any address that is either not valid or fails to expand. This function
      * will not search if the address string is empty.
      *
-     * This method can be called statically, i.e.:
-     *   $ret = IMP_Compose::expandAddresses();
-     *
      * @param string $addrString  The name(s) or address(es) to expand.
      *
      * @return array  All matching addresses.
@@ -2483,7 +2476,7 @@ class IMP_Compose
     static public function expandAddresses($addrString)
     {
         return preg_match('|[^\s]|', $addrString)
-            ? IMP_Compose::getAddressList(reset(array_filter(array_map('trim', Horde_Mime_Address::explode($addrString, ',;')))))
+            ? self::getAddressList(reset(array_filter(array_map('trim', Horde_Mime_Address::explode($addrString, ',;')))))
             : '';
     }
 
@@ -2491,16 +2484,13 @@ class IMP_Compose
      * Uses the Registry to expand names and return error information for
      * any address that is either not valid or fails to expand.
      *
-     * This method can be called statically, i.e.:
-     *   $ret = IMP_Compose::expandAddresses();
-     *
      * @param string $search  The term to search by.
      *
      * @return array  All matching addresses.
      */
     static public function getAddressList($search = '')
     {
-        $sparams = IMP_Compose::getAddressSearchParams();
+        $sparams = self::getAddressSearchParams();
         try {
             $res = $GLOBALS['registry']->call('contacts/search', array($search, $sparams['sources'], $sparams['fields'], true));
         } catch (Horde_Exception $e) {
@@ -2534,9 +2524,6 @@ class IMP_Compose
     /**
      * Determines parameters needed to do an address search
      *
-     * This method can be called statically, i.e.:
-     *   $ret = IMP_Compose::getAddressSearchParams();
-     *
      * @return array  An array with two keys: 'sources' and 'fields'.
      */
     static public function getAddressSearchParams()
index 6f4db8c..b65ea74 100644 (file)
@@ -466,6 +466,7 @@ class IMP_Crypt_Pgp extends Horde_Crypt_Pgp
     {
         $params = array(
             'actionID' => 'save_attachment_public_key',
+            'mailbox' => $mailbox,
             'uid' => $uid,
             'mime_id' => $id
         );
index fc078e1..a638c56 100644 (file)
@@ -325,6 +325,7 @@ class IMP_Crypt_Smime extends Horde_Crypt_Smime
     {
         $params = array(
             'actionID' => 'save_attachment_public_key',
+            'mailbox' => $mailbox,
             'uid' => $uid,
             'mime_id' => $id
         );
index 786e3d7..7d93640 100644 (file)
@@ -95,7 +95,7 @@ class DIMP
             header('Vary: Accept-Language');
         }
 
-        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">' . "\n" .
+        echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n" .
              (!empty($GLOBALS['language']) ? '<html lang="' . strtr($GLOBALS['language'], '_', '-') . '"' : '<html') . ">\n".
              "<head>\n";
 
@@ -164,7 +164,7 @@ class DIMP
         if (!empty($changes['a'])) {
             $result['a'] = array();
             foreach ($changes['a'] as $val) {
-                $result['a'][] = DIMP::_createFolderElt(is_array($val) ? $val : $imptree->element($val));
+                $result['a'][] = self::_createFolderElt(is_array($val) ? $val : $imptree->element($val));
             }
         }
 
@@ -174,7 +174,7 @@ class DIMP
                 // Skip the base element, since any change there won't ever be
                 // updated on-screen.
                 if ($val != IMP_Imap_Tree::BASE_ELT) {
-                    $result['c'][] = DIMP::_createFolderElt($imptree->element($val));
+                    $result['c'][] = self::_createFolderElt($imptree->element($val));
                 }
             }
         }
@@ -217,7 +217,7 @@ class DIMP
         $ob = new stdClass;
 
         if ($elt['children']) {
-           $ob->ch = 1;
+            $ob->ch = 1;
         }
         $ob->m = $elt['value'];
         if ($ob->m != $elt['name']) {
index 656816f..eadf334 100644 (file)
@@ -71,8 +71,6 @@ abstract class IMP_Fetchmail
 
     /**
      * Returns a list of available drivers, with a description of each.
-     * This function can be called statically:
-     *   $list = IMP_Fetchmail::listDrivers();
      *
      * @return array  The list of available drivers, with the driver name as
      *                the key and the description as the value.
@@ -100,8 +98,6 @@ abstract class IMP_Fetchmail
 
     /**
      * List the colors available for coloring fetched messages.
-     * This function can be called statically:
-     *   $list = IMP_Fetchmail::listColors();
      *
      * @return array  The list of available colors;
      */
@@ -115,8 +111,6 @@ abstract class IMP_Fetchmail
 
     /**
      * Returns a description of the driver.
-     * This function can be called statically:
-     *   $description = IMP_Fetchmail::description();
      *
      * @return string  The description of the driver.
      */
@@ -125,7 +119,6 @@ abstract class IMP_Fetchmail
     /**
      * Perform fetchmail on the list of accounts given. Outputs informaton
      * to the global notification driver.
-     * This function can be called statically.
      *
      * @param array $accounts  The list of account identifiers to fetch mail
      *                         for.
@@ -136,7 +129,7 @@ abstract class IMP_Fetchmail
 
         foreach ($accounts as $val) {
             $params = $fm_account->getAllValues($val);
-            $driver = IMP_Fetchmail::factory($params['driver'], $params);
+            $driver = self::factory($params['driver'], $params);
             if ($driver === false) {
                 continue;
             }
@@ -201,9 +194,9 @@ abstract class IMP_Fetchmail
     {
         /* Check for missing params. */
         $paramlist = $this->getParameterList();
-        if (array_diff($paramlist, array_keys($params))) {
-            // TODO: Error message here
-        }
+        /* if (array_diff($paramlist, array_keys($params))) {
+         *     TODO: Error message here
+         * } */
 
         $this->_params = $params;
     }
index 1176e7c..3363461 100644 (file)
@@ -186,9 +186,9 @@ class IMP
             (!empty($GLOBALS['conf']['hooks']['permsdenied']) ||
              (self::hasPermission('create_folders') &&
               self::hasPermission('max_folders')))) {
-            $text .= '<option value="" disabled="disabled">- - - - - - - -</option>' . "\n";
-            $text .= '<option value="*new*">' . _("New Folder") . "</option>\n";
-            $text .= '<option value="" disabled="disabled">- - - - - - - -</option>' . "\n";
+            $text .= "<option value=\"\" disabled=\"disabled\">- - - - - - - -</option>\n" .
+                '<option value="*new*">' . _("New Folder") . "</option>\n" .
+                "<option value=\"\" disabled=\"disabled\">- - - - - - - -</option>\n";
         }
 
         /* Add the list of mailboxes to the lists. */
@@ -241,7 +241,7 @@ class IMP
             try {
                 $notepads = $GLOBALS['registry']->call('notes/listNotepads', array(false, PERMS_EDIT));
                 if (count($notepads)) {
-                    $text .= '<option value="" disabled="disabled">&nbsp;</option><option value="" disabled="disabled">- - ' . _("Notepads") . ' - -</option>' . "\n";
+                    $text .= '<option value="" disabled="disabled">&nbsp;</option><option value="" disabled="disabled">- - ' . _("Notepads") . " - -</option>\n";
 
                     foreach ($notepads as $id => $notepad) {
                         $text .= sprintf('<option value="%s">%s</option>%s',
@@ -555,7 +555,7 @@ class IMP
             }
         }
 
-        if (IMP::canCompose()) {
+        if (self::canCompose()) {
             $menu->add(self::composeLink(array('mailbox' => $GLOBALS['imp_mbox']['mailbox'])), _("_New Message"), 'compose.png');
         }
 
@@ -577,7 +577,7 @@ class IMP
             $js_params = array(
                 'dialog_load' => Horde::applicationUrl('ajax.php', true, -1) . '/FetchmailDialog'
             );
-            $menu->add('javascript:IMPDialog.display(\'' . IMP::escapeJSON($js_params) . '\')', _("Fetch Mail"), 'fetchmail.png');
+            $menu->add('javascript:IMPDialog.display(\'' . self::escapeJSON($js_params) . '\')', _("Fetch Mail"), 'fetchmail.png');
         }
 
         if ($prefs->getValue('filter_menuitem')) {
@@ -1012,7 +1012,7 @@ class IMP
         }
 
         foreach ($enc_opts as $key => $val) {
-             $output .= '<option value="' . $key . '"' . (($default == $key) ? ' selected="selected"' : '') . '>' . $val . '</option>' . "\n";
+             $output .= '<option value="' . $key . '"' . (($default == $key) ? ' selected="selected"' : '') . '>' . $val . "</option>\n";
         }
 
         return $output;
@@ -1383,7 +1383,7 @@ class IMP
         }
 
         foreach (array_merge(array($js_url), $js_force) as $val) {
-            echo '<script type="text/javascript" src="' . $val . '"></script>' . "\n";
+            echo '<script type="text/javascript" src="' . $val . "\"></script>\n";
         }
     }
 
@@ -1486,7 +1486,7 @@ class IMP
         }
 
         foreach ($css_out as $file) {
-            echo '<link href="' . $file['u'] . '" rel="stylesheet" type="text/css" />' . "\n";
+            echo '<link href="' . $file['u'] . "\" rel=\"stylesheet\" type=\"text/css\" />\n";
         }
     }
 
@@ -1687,7 +1687,7 @@ class IMP
             'cancel_text' => _("Cancel")
         );
 
-        return 'IMPDialog.display(\'' . IMP::escapeJSON($js_params) . '\')';
+        return 'IMPDialog.display(\'' . self::escapeJSON($js_params) . '\')';
     }
 
     /**
index ca2f41b..e3dafdd 100644 (file)
@@ -47,7 +47,7 @@ class Identity_imp extends Identity
      * Reads all the user's identities from the prefs object or builds
      * a new identity from the standard values given in prefs.php.
      */
-    function __construct()
+    public function __construct()
     {
         parent::__construct();
         $this->_properties = array_merge(
index 5895b20..68db76f 100644 (file)
@@ -162,7 +162,7 @@ class IMP_Imap_Flags
 
         /* Flags are named PREFIX{$i}. Keep incrementing until we find the
          * next available flag. */
-        for ($i = 0; ; ++$i) {
+        for ($i = 0;; ++$i) {
             $curr = self::PREFIX . $i;
             if (!isset($this->_flags[$curr])) {
                 $this->_flags[$curr] = array(
index 6566f9c..e2daef3 100644 (file)
@@ -619,7 +619,7 @@ class IMP_Imap_Tree
                     $this->_currkey = $old['k'] + 1;
                     $this->_currparent = $old['p'];
                 } while ((($curr = $this->current()) == false) &&
-                         count($this->_currstack));
+                         !empty($this->_currstack));
             }
         }
 
@@ -665,7 +665,7 @@ class IMP_Imap_Tree
      */
     public function peek()
     {
-        for ($i = ($this->_currkey + 1); ; ++$i) {
+        for ($i = ($this->_currkey + 1);; ++$i) {
             if (!isset($this->_parent[$this->_currparent][$i])) {
                 return false;
             }
@@ -1896,7 +1896,6 @@ class IMP_Imap_Tree
                 }
             }
 
-
             switch ($mailbox['v']) {
             case 'INBOX':
                 $row['icon'] = 'folders/inbox.png';
index 26f600a..43022ae 100644 (file)
@@ -44,7 +44,7 @@ class IMP_LoginTasks_Task_DeleteSentmailMonthly extends Horde_LoginTasks_Task
         foreach (array_keys($old_folders) as $k) {
             foreach ($sent_mail_folders as $folder) {
                 if (preg_match('/^' . str_replace('/', '\/', $folder) . '-([^-]+)-([0-9]{4})$/i', $k, $regs)) {
-                    $folder_array[$k] = Horde_String::convertCharset((is_numeric($regs[1])) ? mktime(0, 0, 0,$regs[1], 1, $regs[2]) : strtotime("$regs[1] 1, $regs[2]"), Horde_Nls::getCharset(), 'UTF7-IMAP');
+                    $folder_array[$k] = Horde_String::convertCharset((is_numeric($regs[1])) ? mktime(0, 0, 0, $regs[1], 1, $regs[2]) : strtotime("$regs[1] 1, $regs[2]"), Horde_Nls::getCharset(), 'UTF7-IMAP');
                 }
             }
         }
index b68125d..c48575a 100644 (file)
@@ -507,7 +507,7 @@ class IMP_Message
             /* For stripping all parts, it only makes sense to strip base
              * parts. Stripping subparts may cause issues with display of the
              * parent multipart type. */
-            for ($i = 2; ; ++$i) {
+            for ($i = 2;; ++$i) {
                 $part = $contents->getMIMEPart($i, array('nocontents' => true));
                 if (!$part) {
                     break;
index 6f6a8d7..91f59ef 100644 (file)
@@ -813,7 +813,7 @@ class IMP_Horde_Mime_Viewer_Itip extends Horde_Mime_Viewer_Driver
                             } else {
                                 if ($event->end->compareDateTime($time_span_start) <= -1 ||
                                     $event->start->compareDateTime($time_span_end) >= 1) {
-                                   continue;
+                                    continue;
                                 }
                                 if ($event->end->compareDateTime($vevent_start) <= -1 ||
                                     $event->start->compareDateTime($vevent_end) >= 1) {
index 0742903..37b967c 100644 (file)
@@ -114,7 +114,7 @@ class IMP_Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain
 
         return array(
             $mime_id => array(
-                'data' => '<div class="fixed leftAlign">' . "\n" . $text . '</div>',
+                'data' => "<div class=\"fixed leftAlign\">\n" . $text . '</div>',
                 'status' => array(),
                 'type' => $type
             )
index 5abd83f..c4a677f 100644 (file)
@@ -16,7 +16,7 @@ class IMP_Horde_Mime_Viewer_Smil extends Horde_Mime_Viewer_Smil
     /**
      * User-defined function callback for start elements.
      *
-     * @param object $parser  Handle to the parser instance.
+     * @param object $parser  Handle to the parser instance (not used).
      * @param string $name    The name of this XML element.
      * @param array $attrs    List of this element's attributes.
      */
index c5e1a6a..9a08893 100644 (file)
@@ -49,7 +49,7 @@ class IMP_Quota
         $sig = hash('md5', serialize(array($driver, $params)));
 
         if (!isset(self::$_instances[$sig])) {
-            self::$_instances[$sig] = IMP_Quota::getInstance($driver, $params);
+            self::$_instances[$sig] = self::getInstance($driver, $params);
         }
 
         return self::$_instances[$sig];
@@ -126,7 +126,7 @@ class IMP_Quota
             'nolimit_short' => isset($this->_params['format']['nolimit_short'])
                 ? $this->_params['format']['nolimit_short']
                 : _("%.0f %s")
-       );
+        );
     }
 
     /**
index 8153ff8..998a351 100644 (file)
@@ -80,9 +80,9 @@ class IMP_Quota_Command extends IMP_Quota
         $cmdline = $this->_params['quota_path'] . ' -u ' . $_SESSION['imp']['user'] . ' | ' . $this->_params['grep_path'] . ' ' . $search_string;
         exec($cmdline, $quota_data, $return_code);
         if (($return_code == 0) && (count($quota_data) == 1)) {
-           $quota = split("[[:blank:]]+", trim($quota_data[0]));
-           $blocksize = $this->_blockSize();
-           return array('usage' => $quota[1] * $blocksize,
+            $quota = split("[[:blank:]]+", trim($quota_data[0]));
+            $blocksize = $this->_blockSize();
+            return array('usage' => $quota[1] * $blocksize,
                         'limit' => $quota[2] * $blocksize);
         }
 
index 6fc13c4..fcd6b6a 100644 (file)
@@ -58,9 +58,11 @@ class IMP_Quota_Mdaemon extends IMP_Quota
     {
         $contents = file_get_contents($path . '\imap.mrk');
 
+        $c_len = strlen($contents);
         $pointer = 36;
         $size = 0;
-        while ($pointer < strlen($contents)) {
+
+        while ($pointer < $c_len) {
             $details = unpack('a17Filename/a11Crap/VSize', substr($contents, $pointer, 36));
             $size += $details['Size'];
             $pointer += 36;
index 7a113c1..70b2b45 100644 (file)
@@ -81,7 +81,7 @@ class IMP_Search
      * 'id'  --  The ID of the search query in use.
      * </pre>
      */
-    function __construct($params = array())
+    public function __construct($params = array())
     {
         if (!empty($params['id'])) {
             $this->_id = $this->_strip($params['id']);
@@ -678,7 +678,7 @@ class IMP_Search
      */
     public function createSearchID($id)
     {
-        return 'impsearch' . "\0" . $this->_strip($id);
+        return 'impsearch\0' . $this->_strip($id);
     }
 
     /**
index 93eb065..a8ec15b 100644 (file)
@@ -59,7 +59,7 @@ class IMP_Spam
                     $prog = str_replace(array('%u','%l', '%d'),
                         array(
                             escapeshellarg(Horde_Auth::getAuth()),
-                                               escapeshellarg(Horde_Auth::getBareAuth()),
+                            escapeshellarg(Horde_Auth::getBareAuth()),
                             escapeshellarg(Horde_Auth::getAuthDomain())
                         ), $GLOBALS['conf'][$action]['program']);
                     $proc = proc_open($prog,
index a72da07..f7810a8 100644 (file)
@@ -84,9 +84,7 @@ class IMP_UI_Compose
     {
         $fwd_msg = $imp_compose->forwardMessage($imp_contents);
         $subject_header = $imp_compose->attachIMAPMessage(array($index), $fwd_msg['headers']);
-        if ($subject_header === false) {
-            // TODO: notification
-        } else {
+        if ($subject_header !== false) {
             $fwd_msg['headers']['subject'] = $subject_header;
         }
 
@@ -143,9 +141,9 @@ class IMP_UI_Compose
                 $clean_to .= $val . (($val[Horde_String::length($val) - 1] == ';') ? ' ' : ', ');
             }
             if ($expand) {
-               return $clean_to;
+                return $clean_to;
             } else {
-               return IMP_Compose::formatAddr($clean_to);
+                return IMP_Compose::formatAddr($clean_to);
             }
         }
 
index b1e1f1a..6c35651 100644 (file)
@@ -19,7 +19,7 @@ class IMP_Views_ListMessages
      *
      * @return array  TODO
      */
-    public function ListMessages($args)
+    public function listMessages($args)
     {
         $mbox = $args['mbox'];
         $is_search = false;
index ee2741e..3b2d915 100644 (file)
@@ -543,10 +543,10 @@ function _imp_cacheOutput($params)
         case 'fckeditor':
             return array(
                 'data' =>
-                     'FCKConfig.ToolbarSets["ImpToolbar"] = ' . $GLOBALS['prefs']->getValue('fckeditor_buttons') . ';' . "\n" .
+                     'FCKConfig.ToolbarSets["ImpToolbar"] = ' . $GLOBALS['prefs']->getValue('fckeditor_buttons') . ";\n" .
                      // To more closely match "normal" textarea behavior,
                      // send <BR> on enter instead of <P>.
-                     'FCKConfig.EnterMode = \'br\';' . "\n" .
+                     "FCKConfig.EnterMode = \'br\';\n" .
                      'FCKConfig.ShiftEnterMode = \'p\';',
                 'type' => 'text/javascript'
             );
index b7998c9..2775dc2 100644 (file)
@@ -12,7 +12,7 @@
  * @author  Michael Slusarz <slusarz@horde.org>
  */
 
-function _outputSummaries($msgs, $mbox)
+function _outputSummaries($msgs)
 {
     static $template;
 
@@ -707,7 +707,7 @@ while (list(,$ob) = each($mbox_info['overview'])) {
     if ($search_mbox) {
         if (empty($lastMbox) || ($ob['mailbox'] != $lastMbox)) {
             if (!empty($lastMbox)) {
-                _outputSummaries($msgs, $lastMbox);
+                _outputSummaries($msgs);
                 $msgs = array();
             }
             $folder_link = Horde::url(Horde_Util::addParameter('mailbox.php', 'mailbox', $ob['mailbox']));
@@ -858,7 +858,7 @@ while (list(,$ob) = each($mbox_info['overview'])) {
     $msgs[$ob['uid']] = $msg;
 }
 
-_outputSummaries($msgs, $lastMbox);
+_outputSummaries($msgs);
 
 /* Prepare the message footers template. */
 $mf_template = new Horde_Template();
index 8acb828..cc3ece3 100644 (file)
@@ -303,12 +303,12 @@ $xpriority = $mime_headers->getValue('x-priority');
 switch ($imp_ui->getXpriority($xpriority)) {
 case 'high':
     $basic_headers['priority'] = _("Priority");
-    $display_headers['priority'] = '<div class="msgflags flagHighpriority" title="' . htmlspecialchars(_("High Priority")) . '"></div>' . '&nbsp;' . $xpriority;
+    $display_headers['priority'] = '<div class="msgflags flagHighpriority" title="' . htmlspecialchars(_("High Priority")) . '"></div>&nbsp;' . $xpriority;
     break;
 
 case 'low':
     $basic_headers['priority'] = _("Priority");
-    $display_headers['priority'] = '<div class="msgflags flagLowpriority" title="' . htmlspecialchars(_("Low Priority")) . '"></div>' . '&nbsp;' . $xpriority;
+    $display_headers['priority'] = '<div class="msgflags flagLowpriority" title="' . htmlspecialchars(_("Low Priority")) . '"></div>&nbsp;' . $xpriority;
     break;
 }
 
index 94553c9..8115f1f 100644 (file)
@@ -376,7 +376,7 @@ if ($prefs->getValue('use_pgp')) {
             $t->set('personalkey-create-email-help', Horde_Help::link('imp', 'pgp-personalkey-create-email'));
             $t->set('personalkey-create-keylength-help', Horde_Help::link('imp', 'pgp-personalkey-create-keylength'));
             $t->set('personalkey-create-passphrase-help', Horde_Help::link('imp', 'pgp-personalkey-create-passphrase'));
-            $t->set('keygen',  addslashes(_("Key generation may take a long time to complete.  Continue with key generation?")));
+            $t->set('keygen', addslashes(_("Key generation may take a long time to complete.  Continue with key generation?")));
             $t->set('personal_import_url', Horde_Util::addParameter($selfURL, 'actionID', 'import_personal_public_key'));
             $t->set('personalkey-create-actions-help', Horde_Help::link('imp', 'pgp-personalkey-create-actions'));
         }
index 48a00ba..eee06f5 100644 (file)
@@ -94,7 +94,7 @@ function _doConnectionTest()
 
 function _errorMsg($e)
 {
-    echo '<span style="color:red">ERROR</span> - The server returned the following error message:' . "\n" .
+    echo "<span style="color:red">ERROR</span> - The server returned the following error message:\n" .
         '<pre>' . $e->getMessage() . '</pre><p />';
 }
 
index d5c4665..6bbe31b 100644 (file)
@@ -122,7 +122,7 @@ case 'download_render':
     case 'download_attach':
         $mime = $contents->getMIMEPart($id);
         if (!$name = $mime->getName(true)) {
-           $name = _("unnamed");
+            $name = _("unnamed");
         }
 
         /* Compress output? */
@@ -144,7 +144,7 @@ case 'download_render':
         $body = $render[$key]['data'];
         $type = $render[$key]['type'];
         if (!$name = $render[$key]['name']) {
-           $name = _("unnamed");
+            $name = _("unnamed");
         }
         break;
     }