1: <?php
2: /**
3: * Copyright 2010-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 2010-2014 Horde LLC
10: * @license http://www.horde.org/licenses/gpl GPL
11: * @package IMP
12: */
13:
14: /**
15: * This class implements formatting for unseen messages. Unseen occurs when
16: * the seen flag (RFC 3501 [2.3.2]) is NOT set; thus, it can not be handled
17: * in the seen flag object.
18: *
19: * @author Michael Slusarz <slusarz@horde.org>
20: * @category Horde
21: * @copyright 2010-2014 Horde LLC
22: * @license http://www.horde.org/licenses/gpl GPL
23: * @package IMP
24: */
25: class IMP_Flag_System_Unseen extends IMP_Flag_System_Match_Flag
26: {
27: /**
28: */
29: protected $_abbreviation = 'U';
30:
31: /**
32: */
33: protected $_bgcolor = '#eef';
34:
35: /**
36: */
37: protected $_css = 'flagUnseen';
38:
39: /**
40: */
41: protected $_id = 'unseen';
42:
43: /**
44: */
45: protected function _getLabel()
46: {
47: return _("Unseen");
48: }
49:
50: /**
51: */
52: public function changed($obs, $add)
53: {
54: foreach ($obs as $val) {
55: if ($val instanceof IMP_Flag_Imap_Seen) {
56: return !$add;
57: }
58: }
59:
60: return null;
61: }
62:
63: /**
64: * @param array $data List of IMAP flags.
65: */
66: public function match($data)
67: {
68: return !in_array(Horde_Imap_Client::FLAG_SEEN, $data);
69: }
70:
71: }
72: