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