1: <?php
2: /**
3: * This class handles the mailing list search query.
4: *
5: * Uses the List-Id header defined by RFC 2919 to identify mailing list
6: * messages.
7: *
8: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
9: *
10: * See the enclosed file COPYING for license information (GPL). If you
11: * did not receive this file, see http://www.horde.org/licenses/gpl.
12: *
13: * @author Michael Slusarz <slusarz@horde.org>
14: * @category Horde
15: * @license http://www.horde.org/licenses/gpl GPL
16: * @package IMP
17: */
18: class IMP_Search_Element_Mailinglist extends IMP_Search_Element
19: {
20: /**
21: * Constructor.
22: *
23: * @param boolean $not If true, do a 'NOT' search of $text.
24: */
25: public function __construct($not = false)
26: {
27: /* Data element: (integer) Do a NOT search? */
28: $this->_data = intval(!empty($not));
29: }
30:
31: /**
32: */
33: public function createQuery($mbox, $queryob)
34: {
35: $queryob->headerText('list-id', '', $this->_data);
36:
37: return $queryob;
38: }
39:
40: /**
41: */
42: public function queryText()
43: {
44: return ($this->_data ? _("not") . ' ' : '') . _("Mailing List Messages");
45: }
46:
47: }
48: