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: * Bulk message search query.
16: *
17: * Precedence is a non-standard, discouraged header pursuant to RFC 2076
18: * [3.9]. However, it is widely used and may be useful in sorting out
19: * unwanted e-mail.
20: *
21: * @author Michael Slusarz <slusarz@horde.org>
22: * @category Horde
23: * @copyright 2010-2014 Horde LLC
24: * @license http://www.horde.org/licenses/gpl GPL
25: * @package IMP
26: */
27: class IMP_Search_Element_Bulk extends IMP_Search_Element
28: {
29: /**
30: * Constructor.
31: *
32: * @param boolean $not If true, do a 'NOT' search of $text.
33: */
34: public function __construct($not = false)
35: {
36: /* Data element: (integer) Do a NOT search? */
37: $this->_data = intval(!empty($not));
38: }
39:
40: /**
41: */
42: public function createQuery($mbox, $queryob)
43: {
44: $queryob->headerText('precedence', 'bulk', $this->_data);
45:
46: return $queryob;
47: }
48:
49: /**
50: */
51: public function queryText()
52: {
53: return ($this->_data ? _("not") . ' ' : '') . _("Bulk Messages");
54: }
55:
56: }
57: