Simplify some notification push() calls
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 27 Feb 2010 01:45:45 +0000 (18:45 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 3 Mar 2010 05:38:03 +0000 (22:38 -0700)
imp/compose-dimp.php
imp/compose-mimp.php
imp/compose.php
imp/folders.php
imp/lib/Ajax/Application.php
imp/lib/Mailbox.php
imp/message.php
imp/pgp.php
imp/saveimage.php
imp/smime.php

index ed0d9a5..c017665 100644 (file)
@@ -148,7 +148,7 @@ case 'resume':
         }
         $header = array_merge($header, $result['header']);
     } catch (IMP_Compose_Exception $e) {
-        $notification->push($e->getMessage(), 'horde.error');
+        $notification->push($e);
     }
     $get_sig = false;
     break;
index de46685..916c1ba 100644 (file)
@@ -96,7 +96,7 @@ case 'd':
             $sent_mail_folder = $identity->getValue('sent_mail_folder');
         }
     } catch (IMP_Compose_Exception $e) {
-        $notification->push($e, 'horde.error');
+        $notification->push($e);
     }
     break;
 
@@ -163,7 +163,7 @@ case _("Redirect"):
         exit;
     } catch (Horde_Exception $e) {
         $actionID = 'rc';
-        $notification->push($e, 'horde.error');
+        $notification->push($e);
     }
     break;
 
@@ -234,7 +234,7 @@ case _("Send"):
                 exit;
             }
         } catch (IMP_Compose_Exception $e) {
-            $notification->push($e, 'horde.error');
+            $notification->push($e);
         }
         break;
 
@@ -259,7 +259,7 @@ case _("Send"):
                 exit;
             }
         } catch (IMP_Compose_Exception $e) {
-            $notification->push($e, 'horde.error');
+            $notification->push($e);
         }
         break;
     }
index f7ccf79..934d9a6 100644 (file)
@@ -250,7 +250,7 @@ case 'draft':
             $sent_mail_folder = $identity->getValue('sent_mail_folder');
         }
     } catch (IMP_Compose_Exception $e) {
-        $notification->push($e, 'horde.error');
+        $notification->push($e);
     }
     $get_sig = false;
     break;
@@ -337,7 +337,7 @@ case 'redirect_send':
         }
         exit;
     } catch (Horde_Exception $e) {
-        $notification->push($e, 'horde.error');
+        $notification->push($e);
         $vars->actionID = 'redirect_compose';
         $get_sig = false;
     }
@@ -398,7 +398,7 @@ case 'send_message':
                 }
             } catch (IMP_Compose_Exception $e) {
                 if ($vars->actionID == 'save_draft') {
-                    $notification->push($e, 'horde.error');
+                    $notification->push($e);
                 }
             }
         }
@@ -508,7 +508,7 @@ case 'selectlist_process':
                         try {
                             $imp_compose->addMIMEPartAttachment($part);
                         } catch (IMP_Compose_Exception $e) {
-                            $notification->push($e, 'horde.error');
+                            $notification->push($e);
                         }
                     }
                 }
index 5659e93..50893b5 100644 (file)
@@ -120,7 +120,7 @@ case 'download_folder_zip':
                 fclose($mbox);
             } catch (Horde_Exception $e) {
                 fclose($mbox);
-                $notification->push($e, 'horde.error');
+                $notification->push($e);
                 break;
             }
             fseek($data, 0, SEEK_END);
index 14bec7a..9350bab 100644 (file)
@@ -79,7 +79,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
                 $result->mailbox = $this->_getMailboxResponse($imptree);
             }
         } catch (Horde_Exception $e) {
-            $GLOBALS['notification']->push($e, 'horde.error');
+            $GLOBALS['notification']->push($e);
             $result = false;
         }
 
@@ -169,7 +169,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
                 $result->mailbox = $this->_getMailboxResponse($imptree);
             }
         } catch (Horde_Exception $e) {
-            $GLOBALS['notification']->push($e, 'horde.error');
+            $GLOBALS['notification']->push($e);
         }
 
         return $result;
@@ -713,7 +713,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
             $GLOBALS['notification']->push(sprintf(_("%s was successfully added to your address book."), $this->_vars->name ? $this->_vars->name : $this->_vars->email), 'horde.success');
             return true;
         } catch (Horde_Exception $e) {
-            $GLOBALS['notification']->push($e, 'horde.error');
+            $GLOBALS['notification']->push($e);
             return false;
         }
     }
@@ -967,7 +967,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
                 }
             }
         } catch (Horde_Exception $e) {
-            $GLOBALS['notification']->push($e, 'horde.error');
+            $GLOBALS['notification']->push($e);
             $result = $this->_checkUidvalidity();
         }
 
@@ -1027,7 +1027,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
                 }
             }
         } catch (Horde_Exception $e) {
-            $GLOBALS['notification']->push($e, 'horde.error');
+            $GLOBALS['notification']->push($e);
             $result = $this->_checkUidvalidity();
         }
 
@@ -1494,7 +1494,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
             $sent = $imp_compose->buildAndSendMessage($this->_vars->message, $headers, Horde_Nls::getEmailCharset(), $this->_vars->html, $options);
         } catch (IMP_Compose_Exception $e) {
             $result->success = 0;
-            $GLOBALS['notification']->push($e, 'horde.error');
+            $GLOBALS['notification']->push($e);
             return $result;
         }
 
@@ -1614,7 +1614,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
             }
         } catch (IMP_Compose_Exception $e) {
             $result->success = 0;
-            $GLOBALS['notification']->push($e, 'horde.error');
+            $GLOBALS['notification']->push($e);
         }
 
         return $result;
@@ -1724,7 +1724,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
             try {
                 $GLOBALS['imp_imap']->ob()->openMailbox($this->_vars->view, $rw ? Horde_Imap_Client::OPEN_READWRITE : Horde_Imap_Client::OPEN_AUTO);
             } catch (Horde_Imap_Client_Exception $e) {
-                $GLOBALS['notification']->push($e->getMessage(), 'horde.error');
+                $GLOBALS['notification']->push($e);
                 return null;
             }
         }
index 52682f6..bf2f10f 100644 (file)
@@ -679,7 +679,7 @@ class IMP_Mailbox
             try {
                 $this->_threadob = $GLOBALS['imp_imap']->ob()->thread($this->_mailbox, array('criteria' => $_SESSION['imp']['imap']['thread']));
             } catch (Horde_Imap_Client_Exception $e) {
-                $GLOBALS['notification']->push($e, 'horde.error');
+                $GLOBALS['notification']->push($e);
                 return new Horde_Imap_Client_Thread(array(), 'uid');
             }
         }
index 39acb73..e1d5272 100644 (file)
@@ -154,7 +154,7 @@ case 'add_address':
         $contact_link = IMP::addAddress($vars->address, $vars->name);
         $notification->push(sprintf(_("Entry \"%s\" was successfully added to the address book"), $contact_link), 'horde.success', array('content.raw'));
     } catch (Horde_Exception $e) {
-        $notification->push($e, 'horde.error');
+        $notification->push($e);
     }
     break;
 
@@ -163,7 +163,7 @@ case 'strip_attachment':
     try {
         $imp_message->stripPart($indices_array, ($vars->actionID == 'strip_all') ? null : $vars->imapid);
     } catch (Horde_Exception $e) {
-        $notification->push($e, 'horde.error');
+        $notification->push($e);
     }
     break;
 }
index 336bced..3e40f16 100644 (file)
@@ -68,7 +68,7 @@ case 'process_import_public_key':
         $notification->push(_("No PGP public key imported."), 'horde.error');
         throw new Horde_Exception_Prior($e);
     } catch (Horde_Exception $e) {
-        $notification->push($e, 'horde.error');
+        $notification->push($e);
         $actionID = 'import_public_key';
         $imp_pgp->importKeyDialog('process_import_public_key', Horde_Util::getFormData('reload'));
     }
@@ -108,7 +108,7 @@ case 'process_import_personal_public_key':
         $notification->push(_("No personal PGP public key imported."), 'horde.error');
         throw new Horde_Exception_Prior($e);
     } catch (Horde_Exception $e) {
-        $notification->push($e->getMessage(), 'horde.error');
+        $notification->push($e);
         $imp_pgp->importKeyDialog('process_import_personal_public_key', Horde_Util::getFormData('reload'));
     }
     exit;
@@ -135,7 +135,7 @@ case 'process_import_personal_private_key':
         $notification->push(_("No personal PGP private key imported."), 'horde.error');
         throw new Horde_Exception_Prior($e);
     } catch (Horde_Exception $e) {
-        $notification->push($e->getMessage(), 'horde.error');
+        $notification->push($e);
         $imp_pgp->importKeyDialog('process_import_personal_private_key', Horde_Util::getFormData('reload'));
     }
     exit;
index dc364fb..8fc09a8 100644 (file)
@@ -31,7 +31,7 @@ case 'save_image':
     try {
         $registry->call('images/saveImage', array(null, Horde_Util::getFormData('gallery'), $image_data));
     } catch (Horde_Exception $e) {
-        $notification->push($e, 'horde.error');
+        $notification->push($e);
         break;
     }
     Horde_Util::closeWindowJS();
index 9e7be49..a6a9129 100644 (file)
@@ -50,7 +50,7 @@ case 'process_import_public_key':
         $notification->push(_("No S/MIME public key imported."), 'horde.error');
         throw new Horde_Exception_Prior($e);
     } catch (Horde_Exception $e) {
-        $notification->push($e, 'horde.error');
+        $notification->push($e);
         $actionID = 'import_public_key';
         $imp_smime->importKeyDialog('process_import_public_key', Horde_Util::getFormData('reload'));
     }