Autoload IMP::, MIMP::, and DIMP::.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 15 Jan 2009 06:37:02 +0000 (23:37 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 15 Jan 2009 06:37:02 +0000 (23:37 -0700)
imp/ajax.php
imp/config/prefs.php.dist
imp/lib/base.php

index a5aac35..1e5ea5c 100644 (file)
@@ -710,10 +710,7 @@ case 'SMIMEPersonal':
         $result->error = _("Invalid passphrase entered.");
     }
 
-    /* TODO - This code will eventually be moved to the API. But this function
-     * may be called by IMP so explicitly include DIMP.php. */
     if ($_SESSION['imp']['view'] != 'dimp') {
-        require_once IMP_BASE . '/lib/DIMP.php';
         $notify = false;
     }
 
@@ -728,10 +725,6 @@ case 'Fetchmail':
         $result->success = 1;
     }
 
-    /* TODO - This code will eventually be moved to the API. But this function
-     * may be called by IMP so explicitly include DIMP.php. */
-    require_once IMP_BASE . '/lib/DIMP.php';
-
     /* Don't send dimp notifications via this response since the listener
      * on the browser (dialog.js) doesn't know what to do with them. Instead,
      * notifications will be picked up via the PollFolders() call that is
@@ -742,12 +735,7 @@ case 'Fetchmail':
 
 case 'FetchmailDialog':
     $result = IMP_Fetchmail::fetchmailDialogForm();
-
-    /* TODO - This code will eventually be moved to the API. But this function
-     * may be called by IMP so explicitly include DIMP.php. */
-    require_once IMP_BASE . '/lib/DIMP.php';
     $notify = false;
-
     break;
 }
 
index d39a177..27f20be 100644 (file)
@@ -4,9 +4,6 @@
  */
 
 // Make sure that constants are defined.
-require_once dirname(__FILE__) . '/../lib/IMP.php';
-require_once dirname(__FILE__) . '/../lib/IMAP.php';
-require_once 'Horde/Imap/Client.php';
 $is_pop3 = isset($_SESSION['imp']['protocol']) && ($_SESSION['imp']['protocol'] == 'pop');
 
 $prefGroups['identities'] = array(
index 99b8f88..1d35486 100644 (file)
@@ -52,6 +52,7 @@ if (!defined('IMP_BASE')) {
 
 // Load the Horde Framework core, and set up inclusion paths.
 require_once HORDE_BASE . '/lib/core.php';
+Horde_Autoloader::addClassPath($imp_dir);
 Horde_Autoloader::addClassPattern('/^IMP_/', $imp_dir);
 
 // Registry.
@@ -73,9 +74,6 @@ case 'readonly':
 }
 $registry = &Registry::singleton($s_ctrl);
 
-// Need to explicitly load IMP.php
-require_once IMP_BASE . '/lib/IMP.php';
-
 // We explicitly do not check application permissions for the compose
 // and login pages, since those are handled below and need to fall through
 // to IMP-specific code.
@@ -211,14 +209,8 @@ $GLOBALS['imp_search'] = (isset($_SESSION['imp']) && strpos($GLOBALS['imp_mbox']
     : new IMP_Search();
 
 if ($viewmode == 'mimp') {
-    // Need to explicitly load MIMP.php
-    require_once IMP_BASE . '/lib/MIMP.php';
-
     // Mobile markup renderer.
     $debug = Util::nonInputVar('mimp_debug');
     $GLOBALS['mimp_render'] = new Horde_Mobile(null, $debug);
     $GLOBALS['mimp_render']->set('debug', !empty($debug));
-} elseif ($viewmode == 'dimp') {
-    // Need to explicitly load DIMP.php
-    require_once IMP_BASE . '/lib/DIMP.php';
 }