1: <?php
2: /**
3: * Copyright 2013-2014 Horde LLC (http://www.horde.org/)
4: *
5: * See the enclosed file COPYING for license information (GPL). If you
6: * did not receive this file, see http://www.horde.org/licenses/gpl.
7: *
8: * @category Horde
9: * @copyright 2013-2014 Horde LLC
10: * @license http://www.horde.org/licenses/gpl GPL
11: * @package IMP
12: */
13:
14: /**
15: * Implementation of the account object for Virtual Folders.
16: *
17: * @author Michael Slusarz <slusarz@horde.org>
18: * @category Horde
19: * @copyright 2013-2014 Horde LLC
20: * @license http://www.horde.org/licenses/gpl GPL
21: * @package IMP
22: */
23: class IMP_Ftree_Account_Vfolder extends IMP_Ftree_Account
24: {
25: /* Virtual folder key. */
26: const VFOLDER_KEY = "vfolder\0";
27:
28: /**
29: */
30: public function __construct($id = null)
31: {
32: if (is_null($id)) {
33: throw new InvalidArgumentException('Constructor requires an account ID.');
34: }
35:
36: parent::__construct($id);
37: }
38:
39: /**
40: */
41: public function getList($query = array(), $mask = 0)
42: {
43: global $injector;
44:
45: $imp_search = $injector->getInstance('IMP_Search');
46: $out = array();
47:
48: if ($imp_search[strval($this)]->enabled) {
49: $out[] = array(
50: 'a' => IMP_Ftree::ELT_VFOLDER | IMP_Ftree::ELT_NOSELECT | IMP_Ftree::ELT_NONIMAP,
51: 'v' => self::VFOLDER_KEY
52: );
53: $out[] = array(
54: 'a' => IMP_Ftree::ELT_VFOLDER | IMP_Ftree::ELT_IS_SUBSCRIBED | IMP_Ftree::ELT_NONIMAP,
55: 'p' => self::VFOLDER_KEY,
56: 'v' => strval($this)
57: );
58: }
59:
60: return $out;
61: }
62:
63: /**
64: */
65: public function delete(IMP_Ftree_Element $elt)
66: {
67: return self::DELETE_ELEMENT_QUICK;
68: }
69:
70: }
71: