1: <?php
2: /**
3: * This class implements the personal message flag.
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_Flag_System_Personal extends IMP_Flag_System_Match_Address
16: {
17: /**
18: */
19: protected $_css = 'flagPersonal';
20:
21: /**
22: */
23: protected $_id = 'personal';
24:
25: /**
26: */
27: protected function _getLabel()
28: {
29: return _("Personal");
30: }
31:
32: /**
33: */
34: public function match($data)
35: {
36: if (is_array($data)) {
37: $identity = $GLOBALS['injector']->getInstance('IMP_Identity');
38:
39: foreach ($data as $val) {
40: if ($identity->hasAddress($val['inner'])) {
41: return true;
42: }
43: }
44: } else if (!is_null($data)) {
45: return true;
46: }
47:
48: return false;
49: }
50:
51: }
52: