[cvs] [Wiki] changed: ImpAutomaticDefaultFolderCreation

Jan Schneider jan at horde.org
Wed Jun 7 14:41:36 PDT 2006


jan  Wed, 07 Jun 2006 14:41:36 -0700

Modified page: http://wiki.horde.org/ImpAutomaticDefaultFolderCreation
New Revision:  1.2
Change log:  Tweak maintenance class code

@@ -5,17 +5,18 @@
 <code type="php">
 <?php
 class Maintenance_Task_create_default_folders extends Maintenance_Task {
     function doMaintenance() {
-        global $imp, $prefs, $notification;
+        global $prefs;
         require_once IMP_BASE . '/lib/Folder.php';
+        $imp_folder = &IMP_Folder::singleton();
         $folder_options = array(
             'sent_mail_folder', 'drafts_folder', 'trash_folder', 'spam_folder'
         );
         foreach ($folder_options as $this_folder) {
-            $folder = IMP::folderPref($prefs->getValue($this_folder, true), true);
+            $folder = $prefs->getValue($this_folder, true);
             if ($folder) {
-                $imp_folder = &IMP_Folder::singleton();
+                $folder = IMP::folderPref($folder, true);
                 if (!$imp_folder->exists($folder)) {
                     $imp_folder->create($folder, true);
                 }
             }
@@ -25,10 +26,8 @@
     function describeMaintenance() {
         return _("This process makes sure the default folders are created on your account.");
     }
 }
-?>
-
 </code>
 
 Now you'll need to edit "horde/imp/lib/Maintenance/imp.php" to reflect this change:
 <code type="php">


More information about the cvs mailing list