style/nits
authorMichael M Slusarz <slusarz@curecanti.org>
Sun, 23 Nov 2008 18:08:26 +0000 (11:08 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 24 Nov 2008 05:37:27 +0000 (22:37 -0700)
imp/pgp.php

index c577828..28c4ae6 100644 (file)
 function _printKeyInfo($key = '')
 {
     $key_info = $GLOBALS['imp_pgp']->pgpPrettyKey($key);
-
-    if (empty($key_info)) {
-        _textWindowOutput('PGP Key Information', _("Invalid key"));
-    } else {
-        _textWindowOutput('PGP Key Information', $key_info);
-    }
+    _textWindowOutput('PGP Key Information', empty($key_info) ? _("Invalid key") : $key_info);
 }
 
 function _outputPassphraseDialog($secure_check, $symmetric = false)
@@ -62,11 +57,6 @@ function _importKeyDialog($target)
     echo $t->fetch(IMP_TEMPLATES . '/pgp/import_key.html');
 }
 
-function _reloadWindow()
-{
-    Util::closeWindowJS('opener.focus();opener.location.href="' . Util::getFormData('reload') . '";');
-}
-
 function _getImportKey()
 {
     $key = Util::getFormData('import_key');
@@ -149,7 +139,7 @@ case 'process_import_public_key':
             foreach ($key_info['signature'] as $sig) {
                 $notification->push(sprintf(_("PGP Public Key for \"%s (%s)\" was successfully added."), $sig['name'], $sig['email']), 'horde.success');
             }
-            _reloadWindow();
+            Util::closeWindowJS('opener.focus();opener.location.href="' . Util::getFormData('reload') . '";');
         }
     }
     exit;
@@ -199,7 +189,7 @@ case 'process_import_personal_private_key':
              * successfully - close the import popup window. */
             $imp_pgp->addPersonalPrivateKey($privateKey);
             $notification->push(_("PGP private key successfully added."), 'horde.success');
-            _reloadWindow();
+            Util::closeWindowJS('opener.focus();opener.location.href="' . Util::getFormData('reload') . '";');
         } else {
             /* Invalid private key imported - Redo private key import
              * screen. */
@@ -317,7 +307,7 @@ case 'process_symmetric_passphrase_dialog':
                 $cacheSess->setPruneFlag($oid, true);
                 Util::closeWindowJS($cacheSess->query($oid));
             } elseif (Util::getFormData('reload')) {
-                _reloadWindow();
+                Util::closeWindowJS('opener.focus();opener.location.href="' . Util::getFormData('reload') . '";');
             } else {
                 Util::closeWindowJS();
             }