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 the attachment flag.
16: *
17: * @author Michael Slusarz <slusarz@horde.org>
18: * @category Horde
19: * @copyright 2010-2014 Horde LLC
20: * @license http://www.horde.org/licenses/gpl GPL
21: * @package IMP
22: */
23: class IMP_Flag_System_Attachment extends IMP_Flag_System_Match_Header
24: {
25: /**
26: */
27: protected $_css = 'flagAttachmsg';
28:
29: /**
30: */
31: protected $_id = 'attach';
32:
33: /**
34: */
35: protected function _getLabel()
36: {
37: return _("Message has Attachments");
38: }
39:
40: /**
41: * @param Horde_Mime_Headers $data
42: */
43: public function match($data)
44: {
45: if (!($ctype = $data->getValue('content-type', Horde_Mime_Headers::VALUE_BASE))) {
46: return false;
47: }
48:
49: @list($primary, $sub) = explode('/', $ctype, 2);
50: return (($primary == 'multipart') &&
51: !in_array($sub, array('alternative', 'encrypt', 'related', 'signed')));
52: }
53:
54: }
55: