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: * Handles the mailing list search query.
16: *
17: * Uses the List-Id header defined by RFC 2919 to identify mailing list
18: * messages.
19: *
20: * @author Michael Slusarz <slusarz@horde.org>
21: * @category Horde
22: * @copyright 2010-2014 Horde LLC
23: * @license http://www.horde.org/licenses/gpl GPL
24: * @package IMP
25: */
26: class IMP_Search_Element_Mailinglist extends IMP_Search_Element
27: {
28: /**
29: * Constructor.
30: *
31: * @param boolean $not If true, do a 'NOT' search of $text.
32: */
33: public function __construct($not = false)
34: {
35: /* Data element: (integer) Do a NOT search? */
36: $this->_data = intval(!empty($not));
37: }
38:
39: /**
40: */
41: public function createQuery($mbox, $queryob)
42: {
43: $queryob->headerText('list-id', '', $this->_data);
44:
45: return $queryob;
46: }
47:
48: /**
49: */
50: public function queryText()
51: {
52: return ($this->_data ? _("not") . ' ' : '') . _("Mailing List Messages");
53: }
54:
55: }
56: