1: <?php
2: /**
3: * This class provides a data structure for storing the virtual trash.
4: *
5: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
6: *
7: * See the enclosed file COPYING for license information (GPL). If you
8: * did not receive this file, see http://www.horde.org/licenses/gpl.
9: *
10: * @author Michael Slusarz <slusarz@horde.org>
11: * @category Horde
12: * @license http://www.horde.org/licenses/gpl GPL
13: * @package IMP
14: */
15: class IMP_Search_Vfolder_Vtrash extends IMP_Search_Vfolder_Builtin
16: {
17: /**
18: * Display this virtual folder in the preferences screen?
19: *
20: * @var boolean
21: */
22: public $prefDisplay = false;
23:
24: /**
25: * Initialization tasks.
26: */
27: protected function _init()
28: {
29: $this->_id = 'vtrash';
30: $this->_label = _("Virtual Trash");
31:
32: $this->add(new IMP_Search_Element_Flag(
33: Horde_Imap_Client::FLAG_DELETED,
34: true
35: ));
36: }
37:
38: /**
39: * Get object properties.
40: * Only create mailbox list on demand.
41: *
42: * @see __get()
43: */
44: public function __get($name)
45: {
46: switch ($name) {
47: case 'mboxes':
48: $imp_tree = $GLOBALS['injector']->getInstance('IMP_Imap_Tree');
49: $imp_tree->setIteratorFilter(IMP_Imap_Tree::FLIST_NOCONTAINER);
50: return array_keys(iterator_to_array($imp_tree));
51: }
52:
53: return parent::__get($name);
54: }
55:
56: }
57: