1: <?php
2: /**
3: * This class implements the attachment 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_Attachment extends IMP_Flag_System_Match_Header
16: {
17: /**
18: */
19: protected $_css = 'flagAttachmsg';
20:
21: /**
22: */
23: protected $_id = 'attach';
24:
25: /**
26: */
27: protected function _getLabel()
28: {
29: return _("Message has Attachments");
30: }
31:
32: /**
33: */
34: public function match(Horde_Mime_Headers $data)
35: {
36: if (!($ctype = $data->getValue('content-type', Horde_Mime_Headers::VALUE_BASE))) {
37: return false;
38: }
39:
40: @list($primary, $sub) = explode('/', $ctype, 2);
41: return (($primary == 'multipart') &&
42: !in_array($sub, array('alternative', 'encrypt', 'related', 'signed')));
43: }
44:
45: }
46: