1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: 15: 16: 17: 18: 19: 20: 21: 22:
23: class IMP_Prefs_Special_Drafts extends IMP_Prefs_Special_SpecialMboxes implements Horde_Core_Prefs_Ui_Special
24: {
25: 26:
27: public function init(Horde_Core_Prefs_Ui $ui)
28: {
29: }
30:
31: 32:
33: public function display(Horde_Core_Prefs_Ui $ui)
34: {
35: global $injector, $page_output;
36:
37: $page_output->addScriptFile('folderprefs.js');
38: $page_output->addInlineJsVars(array(
39: 'ImpFolderPrefs.mboxes.drafts' => _("Enter the name for your new drafts mailbox.")
40: ));
41:
42: $view = new Horde_View(array(
43: 'templatePath' => IMP_TEMPLATES . '/prefs'
44: ));
45: $view->addHelper('Horde_Core_View_Helper_Label');
46:
47: $iterator = new IMP_Ftree_IteratorFilter(
48: $injector->getInstance('IMP_Ftree')
49: );
50: $iterator->add($iterator::NONIMAP);
51: $iterator->mboxes = array('INBOX');
52:
53: $view->flist = new IMP_Ftree_Select(array(
54: 'basename' => true,
55: 'iterator' => $iterator,
56: 'new_mbox' => true,
57: 'selected' => IMP_Mailbox::getPref(IMP_Mailbox::MBOX_DRAFTS)
58: ));
59: $view->nombox = IMP_Mailbox::formTo(self::PREF_NO_MBOX);
60: $view->special_use = $this->_getSpecialUse(Horde_Imap_Client::SPECIALUSE_DRAFTS);
61:
62: return $view->render('drafts');
63: }
64:
65: 66:
67: public function update(Horde_Core_Prefs_Ui $ui)
68: {
69: return $this->_updateSpecialMboxes(
70: IMP_Mailbox::MBOX_DRAFTS,
71: IMP_Mailbox::formFrom($ui->vars->drafts),
72: $ui->vars->drafts_new,
73: Horde_Imap_Client::SPECIALUSE_DRAFTS,
74: $ui
75: );
76: }
77:
78: }
79: